19 #ifndef TPIE_UNCOMPRESSED_STREAM_H
20 #define TPIE_UNCOMPRESSED_STREAM_H
80 template <
typename IT>
103 template <
typename IT>
157 float blockFactor=1.0,
158 bool includeDefaultFileAccessor=
true) throw() {
162 if (includeDefaultFileAccessor)
168 file_stream_base::swap(other);
171 friend struct stream_item_array_operations;
181 template <
typename T>
188 #endif // TPIE_UNCOMPRESSED_STREAM_H
static void write_array(Stream &stream, const IT &start, const IT &end)
Write several items to the stream.
static memory_size_type block_memory_usage(double blockFactor)
Amount of memory used by a single block given the block factor.
Memory management subsystem.
static void read_array(Stream &stream, const IT &start, const IT &end)
Reads several items from the stream.
const item_type & read_back()
Read an item from the stream.
stream_size_type offset() const
Calculate the current offset in the stream.
T item_type
The type of the items stored in the stream.
memory_size_type m_index
Item index into the current block, or maxint if we don't have a block.
Streams that support substreams.
bool is_writable() const
Check if we can write to the file.
void skip_back()
Advance the stream position to the previous item.
void seek(stream_offset_type offset, offset_type whence=beginning)
Moves the logical offset in the stream.
void write(const item_type &item)
Write an item to the stream.
const item_type & peek()
Get next item from stream without advancing the position.
static memory_size_type memory_usage(float blockFactor=1.0, bool includeDefaultFileAccessor=true)
Calculate the amount of memory used by a single uncompressed_stream.
Simple class acting both as file and a file::stream.
void write(const IT &start, const IT &end)
Write several items to the stream.
uncompressed_stream(double blockFactor=1.0, file_accessor::file_accessor *fileAccessor=NULL)
Construct a new uncompressed_stream.
void update_block()
Fetch block from disk as indicated by m_nextBlock, writing old block to disk if needed.
Item type-agnostic file_stream operations.
const item_type & read()
Read an item from the stream.
stream_size_type size() const
Get the size of the file measured in items.
static memory_size_type memory_usage()
Return memory usage of this file accessor.
void read(const IT &start, const IT &end)
Reads several items from the stream.
void skip()
Advance the stream position to the next item.