15 #ifndef FOXXLL_IO_REQUEST_HEADER 16 #define FOXXLL_IO_REQUEST_HEADER 51 constexpr
static bool debug =
false;
103 std::ostream &
print(std::ostream& out)
const final;
117 throw *(error_.get());
120 const char *
io_type()
const override;
143 #endif // !FOXXLL_IO_REQUEST_HEADER uint64_t offset_type
type for offsets within a file
friend class linuxaio_queue
std::unique_ptr< io_error > error_
std::ostream & operator<<(std::ostream &o, const stats &s)
static constexpr bool debug
offset_type offset_
offset within file
request(const completion_handler &on_complete, file *file, void *buffer, offset_type offset, size_type bytes, read_or_write op)
file * file_
file implementation to perform I/O with
size_type bytes_
number of bytes at buffer_ to transfer
size_t size_type
type for block transfer sizes
constexpr size_t BlockAlignment
void * buffer_
data buffer to transfer
void check_errors()
Rises an exception if there were error with the I/O.
const char * io_type() const override
Identifies the type of I/O implementation.
size_t reference_count() const noexcept
Return the number of references to this object (for debugging)
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
High-performance smart pointer used as a wrapping reference counting pointer.
completion_handler on_complete_
void release_file_reference()
void check_alignment() const
void check_nref_failed(bool after)
request & operator=(const request &)=delete
non-copyable: delete assignment operator
Request object encapsulating basic properties like file and offset.
std::ostream & print(std::ostream &out) const final
Dumps properties of a request.
void check_nref(bool after=false)
offset_type offset() const
Provides reference counting abilities for use with CountingPtr.
void error_occured(const char *msg)
read_or_write op_
READ or WRITE.