Public Member Functions | |
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) |
Open file for reading and/or writing. More... | |
void | close () |
memory_size_type | read_block (void *data, stream_size_type blockNumber, memory_size_type itemCount) |
Read the given number of items from the given block into the given buffer. More... | |
void | write_block (const void *data, stream_size_type blockNumber, memory_size_type itemCount) |
Write the given number of items from the given buffer into the given block. More... | |
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) |
Static Public Member Functions | |
static memory_size_type | memory_usage () |
Return memory usage of this file accessor. More... | |
Definition at line 35 of file stream_accessor.h.
|
inline |
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 185 of file stream_accessor.h.
Referenced by tpie::file_stream_base::truncate(), and tpie::file_base::truncate().
|
inline |
Maximum size (in bytes) of the user data.
Definition at line 178 of file stream_accessor.h.
Referenced by tpie::file_base_crtp< file_stream_base >::max_user_data_size().
|
inlinestatic |
Return memory usage of this file accessor.
Definition at line 158 of file stream_accessor.h.
Referenced by tpie::file< T >::memory_usage(), and tpie::file_stream< item_type >::memory_usage().
|
inline |
Open file for reading and/or writing.
|
inline |
Path of the file currently open.
Definition at line 168 of file stream_accessor.h.
Referenced by tpie::file_base_crtp< file_stream_base >::path().
|
inline |
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. |
|
inline |
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().
|
inline |
|
inline |
Size (in bytes) of the user data.
Definition at line 173 of file stream_accessor.h.
Referenced by tpie::file_base_crtp< file_stream_base >::user_data_size().
|
inline |
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. |
Referenced by tpie::file_stream_base::flush_block().
|
inline |
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().