25 file*
file,
void* buffer, offset_type offset, size_type
bytes,
27 : on_complete_(on_complete),
28 file_(file), buffer_(buffer), offset_(offset), bytes_(bytes),
31 TLX_LOG <<
"request_with_state[" <<
static_cast<void*
>(
this) <<
"]::request(...), ref_cnt=" <<
reference_count();
37 TLX_LOG <<
"request_with_state[" <<
static_cast<void*
>(
this) <<
"]::~request(), ref_cnt=" <<
reference_count();
43 TLX_LOG1 <<
"Offset is not aligned: modulo " <<
47 TLX_LOG1 <<
"Size is not a multiple of " <<
51 TLX_LOG1 <<
"Buffer is not aligned: modulo " <<
58 TLX_LOG1 <<
"WARNING: serious error, reference to the request is lost " <<
59 (after ?
"after" :
"before") <<
" serve()" <<
65 " op=" << ((
op_ ==
READ) ?
"READ" :
"WRITE") <<
72 out <<
"File object address: " <<
file_ 73 <<
" Buffer address: " <<
static_cast<void*
>(
buffer_)
75 <<
" Transfer size: " <<
bytes_ <<
" bytes" 76 " Type of transfer: " << ((
op_ ==
READ) ?
"READ" :
"WRITE");
105 return req.
print(out);
std::unique_ptr< io_error > error_
std::ostream & operator<<(std::ostream &o, const stats &s)
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)
virtual const char * io_type() const =0
file * file_
file implementation to perform I/O with
size_type bytes_
number of bytes at buffer_ to transfer
constexpr size_t BlockAlignment
void * buffer_
data buffer to transfer
void delete_request_ref()
decrement referenced requests
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
static const size_t bytes
number of bytes in uint_pair
void release_file_reference()
void check_alignment() const
void check_nref_failed(bool after)
Request object encapsulating basic properties like file and offset.
std::ostream & print(std::ostream &out) const final
Dumps properties of a request.
void add_request_ref()
increment referenced requests
void error_occured(const char *msg)
#define TLX_LOG
Default logging method: output if the local debug variable is true.
read_or_write op_
READ or WRITE.