TPIE

2362a60
tpie::compressor_buffer Class Reference

A buffer for elements belonging to a specific stream block. More...

#include <tpie/compressed/buffer.h>

Public Member Functions

 compressor_buffer (memory_size_type capacity)
 
compressor_buffer_state::type get_state () const
 
void set_state (compressor_buffer_state::type to)
 
void transition_state (compressor_buffer_state::type from, compressor_buffer_state::type to)
 
bool is_busy ()
 
char * get ()
 Get pointer to buffer storage. More...
 
const char * get () const
 Get pointer to buffer storage. More...
 
memory_size_type size () const
 Get number of bytes used to store items. More...
 
memory_size_type capacity () const
 Get maximal byte size of buffer. More...
 
void set_size (memory_size_type size)
 Set number of bytes used to store items. More...
 
void set_capacity (memory_size_type capacity)
 Resize internal buffer, clearing all elements. More...
 
void reset ()
 Return buffer to a newly constructed state. More...
 
memory_size_type get_block_size ()
 
stream_size_type get_read_offset ()
 
void set_block_size (memory_size_type s)
 
void set_read_offset (stream_size_type s)
 

Detailed Description

A buffer for elements belonging to a specific stream block.

Definition at line 85 of file buffer.h.

Member Function Documentation

memory_size_type tpie::compressor_buffer::capacity ( ) const
inline

Get maximal byte size of buffer.

Definition at line 156 of file buffer.h.

References tpie::array< T, Allocator >::size().

156  {
157  return m_storage.size();
158  }
size_type size() const
Return the size of the array.
Definition: array.h:526
char* tpie::compressor_buffer::get ( )
inline

Get pointer to buffer storage.

Definition at line 135 of file buffer.h.

References tpie::array< T, Allocator >::get().

135  {
136  return m_storage.get();
137  }
T * get()
Return a raw pointer to the array content.
Definition: array.h:531
const char* tpie::compressor_buffer::get ( ) const
inline

Get pointer to buffer storage.

Definition at line 142 of file buffer.h.

References tpie::array< T, Allocator >::get().

142  {
143  return m_storage.get();
144  }
T * get()
Return a raw pointer to the array content.
Definition: array.h:531
void tpie::compressor_buffer::reset ( )
inline

Return buffer to a newly constructed state.

Definition at line 178 of file buffer.h.

References tpie::compressor_buffer_state::dirty.

178  {
180  m_size = 0;
181  m_readOffset = 1111111111111111111ull;
182  m_blockSize = std::numeric_limits<memory_size_type>::max();
183  }
The buffer is different from the contents on the disk.
Definition: buffer.h:69
void tpie::compressor_buffer::set_capacity ( memory_size_type  capacity)
inline

Resize internal buffer, clearing all elements.

Definition at line 170 of file buffer.h.

References tpie::array< T, Allocator >::resize().

170  {
171  m_storage.resize(capacity);
172  m_size = 0;
173  }
memory_size_type capacity() const
Get maximal byte size of buffer.
Definition: buffer.h:156
void resize(size_t size, const T &elm)
Change the size of the array.
Definition: array.h:485
void tpie::compressor_buffer::set_size ( memory_size_type  size)
inline

Set number of bytes used to store items.

Definition at line 163 of file buffer.h.

References size().

163  {
164  m_size = size;
165  }
memory_size_type size() const
Get number of bytes used to store items.
Definition: buffer.h:149
memory_size_type tpie::compressor_buffer::size ( ) const
inline

Get number of bytes used to store items.

Definition at line 149 of file buffer.h.

Referenced by set_size().

149  {
150  return m_size;
151  }

The documentation for this class was generated from the following file: