commore
1.0.6-SNAPSHOT
|
#include <CommBuffer.h>
Classes | |
class | Page |
class | PageIterator |
struct | Pos |
Public Types | |
enum | { DEFAULT_PAGE_SIZE = 4096 } |
typedef Page * | PPage |
Public Member Functions | |
CommBuffer () | |
CommBuffer (size_t page_size) | |
CommBuffer (const CommBuffer &C) | |
CommBuffer & | operator= (const CommBuffer &C) |
~CommBuffer () | |
bool | operator== (const CommBuffer &C) const |
bool | operator!= (const CommBuffer &C) const |
void | set_size (size_t size) |
size_t | size () const |
void | clear () |
bool | is_ascii () const |
void | set_is_ascii (bool is_ascii) |
void | update_ascii_flags () |
void | update_headers () |
Byte * | allocate (size_t &size) |
Byte * | allocate_in_new_page (size_t size, bool reserveHeader) |
size_t | add_size (size_t size) |
void | splice (CommBuffer &x) |
void | dump () const |
void | rewind () |
long | write_byte (const Byte *b, size_t size) |
long | write_raw (const Byte *b, size_t size) |
long | read_byte (Byte *b, size_t size) const |
long | write_using_dictionary (const AString &v) |
long | write (const AString &v) |
long | write (const String &v) |
long | write (const StringBuffer &v) |
long | write (const Blob &v) |
long | write (const TimePeriod &v) |
long | write (const TimeDate &v) |
long | write (const Symbol &v) |
long | write (const Tuple &v) |
long | write (const Bool &v) |
long | write (const Int &v) |
long | write (const UInt &v) |
long | write (const long &v) |
long | write (const unsigned long &v) |
long | write (const Long &v) |
long | write (const ULong &v) |
long | write (const Short &v) |
long | write (const UShort &v) |
long | write (const Float &v) |
long | write (const Double &v) |
long | write (const ArrayInt &v) |
long | write (const ArrayLong &v) |
long | write (const ArrayFloat &v) |
long | write (const ArrayDouble &v) |
long | write (const ListBool &v) |
long | write (const ListInt &v) |
long | write (const ListUInt &v) |
long | write (const ListLong &v) |
long | write (const ListULong &v) |
long | write (const ListShort &v) |
long | write (const ListUShort &v) |
long | write (const ListFloat &v) |
long | write (const ListDouble &v) |
long | write (const ListAString &v) |
long | write (const ListString &v) |
long | write (const ListStringBuffer &v) |
long | write (const ListTimePeriod &v) |
long | write (const ListTimeDate &v) |
long | write (const ListBlob &v) |
long | write (const ListSymbol &v) |
long | write (const ListTuple &v) |
long | write (const ListArrayInt &v) |
long | write (const ListArrayLong &v) |
long | write (const ListArrayFloat &v) |
long | write (const ListArrayDouble &v) |
long | read_using_dictionary (AString &v) const |
long | read (AString &v) const |
long | read (String &v) const |
long | read (StringBuffer &v) const |
long | read (Blob &v) const |
long | read (TimePeriod &v) const |
long | read (TimeDate &v) const |
long | read (Symbol &v) const |
long | read (Tuple &v) const |
long | read (Bool &v) const |
long | read (Int &v) const |
long | read (UInt &v) const |
long | read (long &v) const |
long | read (unsigned long &v) const |
long | read (Long &v) const |
long | read (ULong &v) const |
long | read (Short &v) const |
long | read (UShort &v) const |
long | read (Float &v) const |
long | read (Double &v) const |
long | read (ArrayInt &v) const |
long | read (ArrayLong &v) const |
long | read (ArrayFloat &v) const |
long | read (ArrayDouble &v) const |
long | read (ListBool &v) const |
long | read (ListInt &v) const |
long | read (ListUInt &v) const |
long | read (ListLong &v) const |
long | read (ListULong &v) const |
long | read (ListShort &v) const |
long | read (ListUShort &v) const |
long | read (ListFloat &v) const |
long | read (ListDouble &v) const |
long | read (ListAString &v) const |
long | read (ListString &v) const |
long | read (ListStringBuffer &v) const |
long | read (ListTimePeriod &v) const |
long | read (ListTimeDate &v) const |
long | read (ListBlob &v) const |
long | read (ListSymbol &v) const |
long | read (ListTuple &v) const |
long | read (ListArrayInt &v) const |
long | read (ListArrayLong &v) const |
long | read (ListArrayFloat &v) const |
long | read (ListArrayDouble &v) const |
Pos | get_pos () const |
void | set_pos (const Pos &pos) |
long | write (OBStream &o) const |
long | read (IBStream &o) |
long | write_file (const Path &file_name) const |
long | read_file (const Path &file_name) |
AString | to_string () const |
PPage | get_last () |
Friends | |
class | PageIterator |
Commore internal use A CommBuffer is a structure used to serialize the Commore data types. The main operations are all the overoloaded read/write methods. different data types can be written in the Commbuffer one after another, and should later be read in the same order. The Tuple is one of the data types handled by the CommBuffer. A Tuple is a structure used to hold a set of named data and as such, it is the most convenient type for use with the CommBuffer. Indeed, a complex structure stored in a Tuple can be serialized with one write call, and deserialized with one read call.
Compression and encryption should be handled by this class.
typedef Page* commore::CommBuffer::PPage |
CommBuffer::CommBuffer | ( | ) |
CommBuffer::CommBuffer | ( | size_t | page_size | ) |
CommBuffer::CommBuffer | ( | const CommBuffer & | C | ) |
CommBuffer::~CommBuffer | ( | ) |
size_t CommBuffer::add_size | ( | size_t | size | ) |
Add size to last buffer page size return new CommBuffer size
Byte * CommBuffer::allocate | ( | size_t & | size | ) |
Return pointer on free space of last buffer page. If last page is full it allocate a new page. size return the free space sise
Byte * CommBuffer::allocate_in_new_page | ( | size_t | size, |
bool | reserveHeader | ||
) |
Return pointer on free space of last buffer page. it always allocate a new page.
void CommBuffer::clear | ( | ) |
void commore::CommBuffer::dump | ( | ) | const |
Dump buffer content to log stream
|
inline |
CommBuffer::Pos CommBuffer::get_pos | ( | ) | const |
|
inline |
bool CommBuffer::operator!= | ( | const CommBuffer & | C | ) | const |
CommBuffer & CommBuffer::operator= | ( | const CommBuffer & | C | ) |
bool CommBuffer::operator== | ( | const CommBuffer & | C | ) | const |
long CommBuffer::read | ( | AString & | v | ) | const |
long CommBuffer::read | ( | String & | v | ) | const |
long CommBuffer::read | ( | StringBuffer & | v | ) | const |
long CommBuffer::read | ( | Blob & | v | ) | const |
long CommBuffer::read | ( | TimePeriod & | v | ) | const |
long CommBuffer::read | ( | TimeDate & | v | ) | const |
long CommBuffer::read | ( | Symbol & | v | ) | const |
long CommBuffer::read | ( | Tuple & | v | ) | const |
long CommBuffer::read | ( | Bool & | v | ) | const |
long CommBuffer::read | ( | Int & | v | ) | const |
long CommBuffer::read | ( | UInt & | v | ) | const |
long CommBuffer::read | ( | long & | v | ) | const |
long CommBuffer::read | ( | unsigned long & | v | ) | const |
long CommBuffer::read | ( | Long & | v | ) | const |
long CommBuffer::read | ( | ULong & | v | ) | const |
long CommBuffer::read | ( | Short & | v | ) | const |
long CommBuffer::read | ( | UShort & | v | ) | const |
long CommBuffer::read | ( | Float & | v | ) | const |
long CommBuffer::read | ( | Double & | v | ) | const |
long CommBuffer::read | ( | ArrayInt & | v | ) | const |
long CommBuffer::read | ( | ArrayLong & | v | ) | const |
long CommBuffer::read | ( | ArrayFloat & | v | ) | const |
long CommBuffer::read | ( | ArrayDouble & | v | ) | const |
long CommBuffer::read | ( | ListBool & | v | ) | const |
long CommBuffer::read | ( | ListInt & | v | ) | const |
long CommBuffer::read | ( | ListUInt & | v | ) | const |
long CommBuffer::read | ( | ListLong & | v | ) | const |
long CommBuffer::read | ( | ListULong & | v | ) | const |
long CommBuffer::read | ( | ListShort & | v | ) | const |
long CommBuffer::read | ( | ListUShort & | v | ) | const |
long CommBuffer::read | ( | ListFloat & | v | ) | const |
long CommBuffer::read | ( | ListDouble & | v | ) | const |
long CommBuffer::read | ( | ListAString & | v | ) | const |
long CommBuffer::read | ( | ListString & | v | ) | const |
long CommBuffer::read | ( | ListStringBuffer & | v | ) | const |
long CommBuffer::read | ( | ListTimePeriod & | v | ) | const |
long CommBuffer::read | ( | ListTimeDate & | v | ) | const |
long CommBuffer::read | ( | ListBlob & | v | ) | const |
long CommBuffer::read | ( | ListSymbol & | v | ) | const |
long CommBuffer::read | ( | ListTuple & | v | ) | const |
long CommBuffer::read | ( | ListArrayInt & | v | ) | const |
long CommBuffer::read | ( | ListArrayLong & | v | ) | const |
long CommBuffer::read | ( | ListArrayFloat & | v | ) | const |
long CommBuffer::read | ( | ListArrayDouble & | v | ) | const |
long CommBuffer::read | ( | IBStream & | o | ) |
long CommBuffer::read_byte | ( | Byte * | b, |
size_t | size | ||
) | const |
long CommBuffer::read_file | ( | const Path & | file_name | ) |
long CommBuffer::read_using_dictionary | ( | AString & | v | ) | const |
void CommBuffer::rewind | ( | ) |
Reset reader pos of Buffer
|
inline |
void CommBuffer::set_pos | ( | const Pos & | pos | ) |
|
inline |
|
inline |
void CommBuffer::splice | ( | CommBuffer & | x | ) |
Move Buffer content from x to this x become empty!
AString CommBuffer::to_string | ( | ) | const |
void CommBuffer::update_ascii_flags | ( | ) |
void CommBuffer::update_headers | ( | ) |
long CommBuffer::write | ( | const AString & | v | ) |
long CommBuffer::write | ( | const String & | v | ) |
long CommBuffer::write | ( | const StringBuffer & | v | ) |
long CommBuffer::write | ( | const Blob & | v | ) |
long CommBuffer::write | ( | const TimePeriod & | v | ) |
long CommBuffer::write | ( | const TimeDate & | v | ) |
long CommBuffer::write | ( | const Symbol & | v | ) |
long CommBuffer::write | ( | const Tuple & | v | ) |
long CommBuffer::write | ( | const Bool & | v | ) |
long CommBuffer::write | ( | const Int & | v | ) |
long CommBuffer::write | ( | const UInt & | v | ) |
long CommBuffer::write | ( | const long & | v | ) |
long CommBuffer::write | ( | const unsigned long & | v | ) |
long CommBuffer::write | ( | const Long & | v | ) |
long CommBuffer::write | ( | const ULong & | v | ) |
long CommBuffer::write | ( | const Short & | v | ) |
long CommBuffer::write | ( | const UShort & | v | ) |
long CommBuffer::write | ( | const Float & | v | ) |
long CommBuffer::write | ( | const Double & | v | ) |
long CommBuffer::write | ( | const ArrayInt & | v | ) |
long CommBuffer::write | ( | const ArrayLong & | v | ) |
long CommBuffer::write | ( | const ArrayFloat & | v | ) |
long CommBuffer::write | ( | const ArrayDouble & | v | ) |
long CommBuffer::write | ( | const ListBool & | v | ) |
long CommBuffer::write | ( | const ListInt & | v | ) |
long CommBuffer::write | ( | const ListUInt & | v | ) |
long CommBuffer::write | ( | const ListLong & | v | ) |
long CommBuffer::write | ( | const ListULong & | v | ) |
long CommBuffer::write | ( | const ListShort & | v | ) |
long CommBuffer::write | ( | const ListUShort & | v | ) |
long CommBuffer::write | ( | const ListFloat & | v | ) |
long CommBuffer::write | ( | const ListDouble & | v | ) |
long CommBuffer::write | ( | const ListAString & | v | ) |
long CommBuffer::write | ( | const ListString & | v | ) |
long CommBuffer::write | ( | const ListStringBuffer & | v | ) |
long CommBuffer::write | ( | const ListTimePeriod & | v | ) |
long CommBuffer::write | ( | const ListTimeDate & | v | ) |
long CommBuffer::write | ( | const ListBlob & | v | ) |
long CommBuffer::write | ( | const ListSymbol & | v | ) |
long CommBuffer::write | ( | const ListTuple & | v | ) |
long CommBuffer::write | ( | const ListArrayInt & | v | ) |
long CommBuffer::write | ( | const ListArrayLong & | v | ) |
long CommBuffer::write | ( | const ListArrayFloat & | v | ) |
long CommBuffer::write | ( | const ListArrayDouble & | v | ) |
long CommBuffer::write | ( | OBStream & | o | ) | const |
long CommBuffer::write_byte | ( | const Byte * | b, |
size_t | size | ||
) |
Write en read raw Byte in the buffer
long CommBuffer::write_file | ( | const Path & | file_name | ) | const |
long CommBuffer::write_raw | ( | const Byte * | b, |
size_t | size | ||
) |
long CommBuffer::write_using_dictionary | ( | const AString & | v | ) |
|
friend |