13 #ifndef FOXXLL_IO_FILEPERBLOCK_FILE_HEADER 14 #define FOXXLL_IO_FILEPERBLOCK_FILE_HEADER 27 template <
class base_file_type>
30 constexpr
static bool debug =
false;
75 const char *
io_type()
const final;
82 #endif // !FOXXLL_IO_FILEPERBLOCK_FILE_HEADER
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.
virtual ~fileperblock_file()
const char * io_type() const final
std::string filename_prefix_
request::size_type size_type
the size of a request
virtual void discard(offset_type offset, offset_type length)
offset_type current_size_
tlx::counting_ptr< base_file_type > lock_file_
fileperblock_file(const std::string &filename_prefix, int mode, int queue_id=DEFAULT_QUEUE, int allocator_id=NO_ALLOCATOR, unsigned int device_id=DEFAULT_DEVICE_ID)
std::string filename_for_block(offset_type offset)
Constructs a file name for a given block.
static const int DEFAULT_QUEUE
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
virtual void lock()
Locks file for reading and writing (acquires a lock in the file system).
High-performance smart pointer used as a wrapping reference counting pointer.
static const size_t bytes
number of bytes in uint_pair
static constexpr bool debug
virtual void set_size(offset_type new_size)
static const int NO_ALLOCATOR
void serve(void *buffer, offset_type offset, size_type bytes, request::read_or_write op) final
virtual void export_files(offset_type offset, offset_type length, std::string filename)
Rename the file corresponding to the offset such that it is out of reach for deleting.
virtual offset_type size()