Inherits tpie::file_accessor::stream_accessor_base< file_accessor_t >.
Public Member Functions | |
virtual memory_size_type | read_block (void *, stream_size_type, memory_size_type) override |
Read the given number of items from the given block into the given buffer. More... | |
virtual void | write_block (const void *, stream_size_type, memory_size_type) override |
Write the given number of items from the given buffer into the given block. More... | |
void | set_size (stream_size_type amt) |
bool | empty () |
stream_size_type | file_size () |
void | truncate_bytes (stream_size_type size) |
void | write (const stream_size_type byteOffset, const void *data, const memory_size_type size) |
void | append (const void *data, memory_size_type size) |
memory_size_type | read (const stream_size_type byteOffset, void *data, memory_size_type size) |
memory_size_type | block_items () const |
memory_size_type | block_size () const |
void | open (const std::string &path, bool read, bool write, memory_size_type itemSize, memory_size_type blockSize, memory_size_type maxUserDataSize, cache_hint cacheHint, int compressionFlags) |
Open file for reading and/or writing. More... | |
void | close () |
memory_size_type | read_user_data (void *data, memory_size_type count) |
Read user data into the given buffer. More... | |
void | write_user_data (const void *data, memory_size_type count) |
Write user data to the stream. More... | |
stream_size_type | size () const |
Number of items in stream. More... | |
const std::string & | path () const |
Path of the file currently open. More... | |
memory_size_type | user_data_size () const |
Size (in bytes) of the user data. More... | |
memory_size_type | max_user_data_size () const |
Maximum size (in bytes) of the user data. More... | |
stream_size_type | byte_size () const |
Size (in bytes) of entire stream as laid out on disk after padding the final block to alignment boundary, including the header and user data. More... | |
void | truncate (stream_size_type items) |
void | set_last_block_read_offset (stream_size_type n) |
stream_size_type | get_last_block_read_offset () |
bool | get_compressed () |
int | get_compression_flags () |
Static Public Member Functions | |
static memory_size_type | memory_usage () |
Return memory usage of this file accessor. More... | |
Protected Member Functions | |
memory_size_type | boundary () const |
Returns the boundary on which we align blocks. More... | |
memory_size_type | align_to_boundary (memory_size_type z) const |
Given a memory offset, rounds up to the nearest alignment boundary. More... | |
memory_size_type | header_size () const |
The size of header and user data with padding included. More... | |
memory_size_type | item_size () const |
Protected Attributes | |
file_accessor_t | m_fileAccessor |
Definition at line 31 of file byte_stream_accessor.h.
|
inlineprotectedinherited |
Given a memory offset, rounds up to the nearest alignment boundary.
Definition at line 97 of file stream_accessor_base.h.
Referenced by tpie::file_accessor::stream_accessor_base< tpie::file_accessor::posix >::header_size().
|
inlineprotectedinherited |
Returns the boundary on which we align blocks.
Definition at line 91 of file stream_accessor_base.h.
Referenced by tpie::file_accessor::stream_accessor_base< tpie::file_accessor::posix >::align_to_boundary().
|
inlineinherited |
Size (in bytes) of entire stream as laid out on disk after padding the final block to alignment boundary, including the header and user data.
Definition at line 204 of file stream_accessor_base.h.
Referenced by tpie::file_stream_base::flush_block(), tpie::file_stream_base::truncate(), and tpie::file_base::truncate().
|
inlineprotectedinherited |
The size of header and user data with padding included.
This is the offset at which the first logical block begins.
Definition at line 103 of file stream_accessor_base.h.
Referenced by tpie::file_accessor::stream_accessor_base< tpie::file_accessor::posix >::byte_size(), tpie::file_accessor::stream_accessor< file_accessor_t >::read_block(), and tpie::file_accessor::stream_accessor< file_accessor_t >::write_block().
|
inlineinherited |
Maximum size (in bytes) of the user data.
Definition at line 197 of file stream_accessor_base.h.
Referenced by tpie::file_base_crtp< file_stream_base >::max_user_data_size().
|
inlinestaticinherited |
Return memory usage of this file accessor.
Definition at line 177 of file stream_accessor_base.h.
Referenced by tpie::file< T >::memory_usage(), and tpie::uncompressed_stream< T >::memory_usage().
|
inlineinherited |
Open file for reading and/or writing.
|
inlineinherited |
Path of the file currently open.
Definition at line 187 of file stream_accessor_base.h.
Referenced by tpie::file_base_crtp< file_stream_base >::path().
|
inlineoverridevirtual |
Read the given number of items from the given block into the given buffer.
data | Buffer in which to store data. Must be able to hold at least sizeof(T)*itemCount bytes. |
blockNumber | Number of block in which to begin reading. |
itemCount | Number of items to read from beginning of given block. Must be less than m_blockItems. |
Implements tpie::file_accessor::stream_accessor_base< file_accessor_t >.
Definition at line 34 of file byte_stream_accessor.h.
|
inlineinherited |
Read user data into the given buffer.
data | Buffer in which to store user data. |
count | Size of buffer, in bytes. The method will read at most this number of bytes. |
Referenced by tpie::file_base_crtp< file_stream_base >::read_user_data().
|
inlineinherited |
Number of items in stream.
Definition at line 182 of file stream_accessor_base.h.
Referenced by tpie::file_accessor::stream_accessor< file_accessor_t >::read_block(), and tpie::file_accessor::stream_accessor< file_accessor_t >::write_block().
|
inlineinherited |
Size (in bytes) of the user data.
Definition at line 192 of file stream_accessor_base.h.
Referenced by tpie::file_base_crtp< file_stream_base >::user_data_size().
|
inlineoverridevirtual |
Write the given number of items from the given buffer into the given block.
data | Buffer from which to write data. Must hold at least sizeof(T)*itemCount bytes of data. |
blockNumber | Number of block in which to write. |
itemCount | Number of items to write to beginning of given block. Must be less than m_blockItems. |
Implements tpie::file_accessor::stream_accessor_base< file_accessor_t >.
Definition at line 41 of file byte_stream_accessor.h.
|
inlineinherited |
Write user data to the stream.
data | Buffer from which to write user data. |
count | Number of bytes to write. Cannot exceed max_user_data_size(). |
Referenced by tpie::file_base_crtp< file_stream_base >::write_user_data().