15 #ifndef FOXXLL_IO_MEMORY_FILE_HEADER 16 #define FOXXLL_IO_MEMORY_FILE_HEADER 48 ptr_(nullptr), size_(0)
57 const char *
io_type()
const final;
64 #endif // !FOXXLL_IO_MEMORY_FILE_HEADER void set_size(offset_type newsize) final
const char * io_type() const final
void serve(void *buffer, offset_type offset, size_type bytes, request::read_or_write op) final
static const unsigned int DEFAULT_DEVICE_ID
request::offset_type offset_type
the offset of a request, also the size of the file
Implementation of some file methods based on serving_request.
memory_file(int queue_id=DEFAULT_QUEUE, int allocator_id=NO_ALLOCATOR, unsigned int device_id=DEFAULT_DEVICE_ID)
constructs file object.
request::size_type size_type
the size of a request
offset_type size_
size of memory area
static const int DEFAULT_QUEUE
static const size_t bytes
number of bytes in uint_pair
static const int NO_ALLOCATOR
void lock() final
Locks file for reading and writing (acquires a lock in the file system).
std::mutex mutex_
sequentialize function calls
void discard(offset_type offset, offset_type size) final
Implementation of file based on new[] and memcpy.
char * ptr_
pointer to memory area of "file"