RSTT 3.2.1 Regional Seismic Travel Time

Loading...
Searching...
No Matches
util::DataBuffer Class Reference

A byte array container used to hold binary data in the same manner as disk based file system. More...

`#include <DataBuffer.h>`

## Public Member Functions
| DataBuffer ()
| DataBuffer (bool doPad)
| DataBuffer (string *str)
| DataBuffer (const DataBuffer &db)
virtual | ~DataBuffer ()
DataBuffer & | operator= (const DataBuffer &db)
void | dumpBuffer ()
void | writeToFile (ofstream &ofs)
void | writeToFile (fstream &ofs)
void | readFromFile (fstream &ifs, int num_bytes)
void | readFromFile (ifstream &ifs, int num_bytes)
void | readFromFile (fstream &ifs, int64 filePos, int num_bytes)
void | readFromFile (ifstream &ifs, int64 filePos, int num_bytes)
const string & | readMD5HashKey ()
string | generateMD5HashKey ()
string | generateDataBufMD5HashKey ()
void | align4Byte ()
| Aligns the DataBuffer position pointer on a 4 byte boundary if it is not currently aligned as such.
void | align8Byte ()
| Aligns the DataBuffer position pointer on an 8 byte boundary if it is not currently aligned as such.
void | checkBufferSize (int sincr)
| Checks the current buffer storage size and increments to see if it can contain sincr more bytes. If not it increments the size so that sincr bytes can be added safely.
void | clear ()
| Clear the DataBuffer.
const string & | readString ()
| Read a string and return a reference to be assigned to another string in the client. This function assumes the length of the string occurs imediately before the actual string data.
void | readString (string &str, int num_chars)
| Read num_chars from 'this' databuffer into the input string, str.
void | readCharArray (char *array, int num_chars)
| Read num_chars characters from 'this' DataBuffer into /em array.
uByte | readByte ()
| Read a byte from the buffer and update the iterator.
uByte | readByte (int pos)
| Read a byte from the positions specified by pos ... doesn't update dbDataPos.
void | readByteArray (uByte *array, int num_bytes)
| Read num_bytes characters from 'this' DataBuffer into array.
bool | readBool ()
| Read a bool from the buffer and update the iterator.
bool | readBool (int pos)
| Read a bool from the positions specified by pos ... doesn't update dbDataPos.
void | readBoolArray (bool *array, int num_bools)
| Read num_bools booleans from 'this' DataBuffer into array.
int | readInt32 ()
| Read an int from the buffer. Make sure the buffer is 4byte alligned before reading.
int | readInt32 (int pos)
| Read the int from the positions specified by pos ... doesn't update dbDataPos.
int | readRawInt32 ()
| Read an Int32 ... don't check for alignment ... fast but client is responsible for alignment.
void | readIntArray (int *array, int num_ints)
| Read num_ints integers from 'this' DataBuffer into array.
int64 | readInt64 ()
| Read a long from the buffer. Make sure the buffer is 8byte alligned before reading.
int64 | readInt64 (int pos)
| Read the long from the positions specified by pos ... doesn't update dbDataPos.
int64 | readRawInt64 ()
| Read a long ... don't check for alignment ... fast but client is responsible for alignment.
void | readLongArray (int64 *array, int num_longs)
| Read num_longs int64s from 'this' DataBuffer into array.
float | readFloat ()
| Read a float from the buffer. Make sure the buffer is 4byte alligned before reading.
float | readFloat (int pos)
| Read the float from the positions specified by pos ... doesn't update dbDataPos.
float | readRawFloat ()
| Read a float ... don't check for alignment ... fast but client is responsible for alignment.
void | readFloatArray (float *array, int num_floats)
| Read num_floats floats from 'this' DataBuffer into array.
double | readDouble ()
| Read a double from the buffer. Make sure the buffer is 8byte alligned before reading.
double | readDouble (int pos)
| Just read the double from the positions specified by pos ... doesn't update dbDataPos.
double | readRawDouble ()
| Read a double ... don't check for alignment ... fast but client is responsible for alignment.
void | readDoubleArray (double *array, int num_doubles)
| Read num_doubles doubles from 'this' DataBuffer into array.
void | writeString (const string &in_string)
| Write the string in_string into 'this' DataBuffer.
void | writeString (char *char_string)
| Write the string char_string into 'this' DataBuffer.
void | writeCharArray (const char *array, int num_chars)
| Write num_chars of the character array into 'this' DataBuffer.
void | writeByte (uByte b)
| Write a byte (b) to the DataBuffer. Make sure the buffer is sized appropriately before writing.
void | writeByte (uByte b, int pos)
| Write a uByte (b) at databuffer position pos. Does not update the iterator.
void | writeRawByte (uByte b)
| Write a uByte (b) ... don't check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly.
void | writeByteArray (const uByte *array, int num_bytes)
| Write num_bytes uBytes from the input array into 'this' DataBuffer.
void | writeBool (bool b)
| Write a bool (b) to the DataBuffer. Make sure the buffer is sized appropriately before writing.
void | writeBool (bool b, int pos)
| Write a bool (b) at databuffer position pos. Does not update the iterator.
void | writeRawBool (bool b)
| Write a bool (b) ... do not check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly.
void | writeBoolArray (const bool *array, int num_bools)
| Write num_bools bools from the input array into 'this' DataBuffer.
void | writeInt32 (int i)
| Write an Int32 (i) to the DataBuffer. Make sure the buffer is 4byte alligned and sized appropriatly before reading.
void | writeInt32 (int i, int pos)
| Write an int (i) at databuffer position pos. Do not update the iterator.
void | writeRawInt32 (int i)
| Write an Int32 (i) ... do not check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly.
void | writeIntArray (const int *array, int num_ints)
| Write num_ints ints from the input array into 'this' DataBuffer.
void | writeInt64 (int64 i)
| Write an Int64 (i) to the DataBuffer. Make sure the buffer is 8byte alligned and sized appropriatly before reading.
void | writeInt64 (int64 i, int pos)
| Write a long (i) at databuffer position pos. Does not update the iterator.
void | writeRawInt64 (int64 i)
| Write an Int64 (i) ... don't check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly.
void | writeLongArray (const int64 *array, int num_longs)
| Write num_longs longs from the input array into 'this' DataBuffer.
void | writeFloat (float f)
| Write a float (f) to the DataBuffer. Make sure the buffer is 4byte alligned and sized appropriatly before reading.
void | writeFloat (float f, int pos)
| Write a float (f) at databuffer position pos. Does not update the iterator.
void | writeRawFloat (float f)
| Write a float (f) ... do not check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly.
void | writeFloatArray (const float *array, int num_floats)
| Write num_floats floats from the input array into 'this' DataBuffer.
void | writeDouble (double d)
| Write a double (d) to the DataBuffer. Make sure the buffer is 8byte alligned and sized appropriatly before reading.
void | writeDouble (double d, int pos)
| Write a double (d) at databuffer position pos. Does not update the iterator.
void | writeRawDouble (double d)
| Write a double (d) ... do not check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly.
void | writeDoubleArray (const double *array, int num_doubles)
| Write num_doubles doubles from the input array into 'this' DataBuffer.
virtual string | get_class_name () const
| Returns the class name.
virtual int | class_size () const
| Returns the class size (in bytes).
void | setSize (int num_bytes)
| Set the size of the data buffer to num_bytes.
int | size ()
| Return the current DataBuffer size.
void | resetPos ()
| Reset the buffers iterator location to zero.
void | setPosToEnd ()
| Set the buffers iterator position to dbSize. If current iterator exceeds dbsize then dbsize is set and dbDataPos is unchanged.
int | getPos () const
| Return the buffers iterator location.
void | incrementPos (int increment)
| Increment the buffers iterator by increment bytes. This is an unsafe operation. If dbDataPos + increment > dbSize. dbSize is NOT checked.
void | decrementPos (int decrement)
| Decrement the buffers iterator by decrement bytes. This is an unsafe operation. If dbDataPos - decrement < 0.
string | getData () const
| Return a reference to the DataBuffer.
int | getCapacity () const
| Return allocated capacity of 'this' DataBuffer.
char * | getPosPointer ()
| Return a pointer to the current iterator location in the buffer.
char * | getPosPointer (int pos)
| Return a Pointer to position pos in the buffer.
void | setByteOrderReverse (bool bor)
| Sets the byte order reverse flag to bor.
void | byteOrderReverseOn ()
| Sets the byte order reverse flag to true.
void | byteOrderReverseOff ()
| Sets the byte order reverse flag to false.
bool | isByteOrderReversed () const
| Returns true if the byte order in reads and writes is reversed for all 2, 4, or 8 byte intrinsincs (short, int, long, float, double, etc.).
void | reserve (int sze)
| brief Reserves space in the DataBuffer

## Static Public Member Functions
static void | reverseBOArray (int n, char *a, int s)
static void | reverseBO2Array (int n, char *a)
static void | reverseBO4Array (int n, char *a)
static void | reverseBO8Array (int n, char *a)
static void | reverseBO2 (char *d)
| Reverses byte order of d. d is assumed to point to an 2 byte element.
static void | reverseBO4 (char *d)
| Reverses byte order of d. d is assumed to point to an 4 byte element.
static void | reverseBO8 (char *d)
| Reverses byte order of d. d is assumed to point to an 8 byte element.
static string | class_name ()
| Static function that returns the class name.
static int | getAllocationReqSize ()

## Static Public Attributes
static const int | ALLOCATION_REQ_SIZE
| Default allocation requirement size for a data buffer.

## Protected Attributes
string * | dbData
| A string object is used to contain the actual data.
int | dbDataPos
| The current iterator position in the data container (dbData).
int | dbSize
| The current size of the data container.
bool | dbPad
| A boolean, that if true, maintains 4 and 8 byte alignment in support of double alignment compilation.
bool | dbReverse
| A boolean, that if true, reverses the byte order of all 2, 4, and 8 byte intrinsics (shorts, ints, long, floats, doubles, etc.). This flag is set by the FileDatabase object only and otherwise defaults to false. The flag is used to convert byte order between big- and little- endian formats.
bool | dbOwnStr
| A boolean, that if true, indicates the storage string for this DataBuffer is owned and therefore deleted when the DataBuffer is deleted.

## Detailed Description

A byte array container used to hold binary data in the same manner as disk based file system.

The object contains a padding facility to maintain 1, 4, and 8 byte aligned objects so that the objects that utilize this class can be compiled as doubly aligned. This object is used extensively in support of database object serialization. The class contains a long list of methods and properties supporting read/write capability for string, char, byte, bool, int, long, float, and double types. Most types also contain an array read/write capability. Finally, the ability to read and write compressed data is provided using the zlib library facility.

Definition at line 80 of file DataBuffer.h.

## Constructor & Destructor Documentation

## ◆ DataBuffer() [1/4]

util::DataBuffer::DataBuffer | ( |  | ) |

## ◆ DataBuffer() [2/4]

util::DataBuffer::DataBuffer | ( | bool | doPad | ) |

## ◆ DataBuffer() [3/4]

util::DataBuffer::DataBuffer | ( | string * | str | ) |

## ◆ DataBuffer() [4/4]

util::DataBuffer::DataBuffer | ( | const DataBuffer & | db | ) |

## ◆ ~DataBuffer()

virtual util::DataBuffer::~DataBuffer | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ align4Byte()

void util::DataBuffer::align4Byte | ( |  | ) |
| inline

Aligns the DataBuffer position pointer on a 4 byte boundary if it is not currently aligned as such.

Definition at line 437 of file DataBuffer.h.

## ◆ align8Byte()

void util::DataBuffer::align8Byte | ( |  | ) |
| inline

Aligns the DataBuffer position pointer on an 8 byte boundary if it is not currently aligned as such.

Definition at line 454 of file DataBuffer.h.

## ◆ byteOrderReverseOff()

void util::DataBuffer::byteOrderReverseOff | ( |  | ) |
| inline

Sets the byte order reverse flag to false.

Definition at line 1596 of file DataBuffer.h.

## ◆ byteOrderReverseOn()

void util::DataBuffer::byteOrderReverseOn | ( |  | ) |
| inline

Sets the byte order reverse flag to true.

Definition at line 1586 of file DataBuffer.h.

## ◆ checkBufferSize()

void util::DataBuffer::checkBufferSize | ( | int | sincr | ) |
| inline

Checks the current buffer storage size and increments to see if it can contain sincr more bytes. If not it increments the size so that sincr bytes can be added safely.

Definition at line 472 of file DataBuffer.h.

## ◆ class_name()

string util::DataBuffer::class_name | ( |  | ) |
| inline static

Static function that returns the class name.

Definition at line 406 of file DataBuffer.h.

## ◆ class_size()

int util::DataBuffer::class_size | ( |  | ) | const
| inline virtual

Returns the class size (in bytes).

Definition at line 426 of file DataBuffer.h.

## ◆ clear()

void util::DataBuffer::clear | ( |  | ) |
| inline

Clear the DataBuffer.

Definition at line 486 of file DataBuffer.h.

## ◆ decrementPos()

void util::DataBuffer::decrementPos | ( | int | decrement | ) |
| inline

Decrement the buffers iterator by decrement bytes. This is an unsafe operation. If dbDataPos - decrement < 0.

Definition at line 1472 of file DataBuffer.h.

## ◆ dumpBuffer()

void util::DataBuffer::dumpBuffer | ( |  | ) |

## ◆ generateDataBufMD5HashKey()

string util::DataBuffer::generateDataBufMD5HashKey | ( |  | ) |

## ◆ generateMD5HashKey()

string util::DataBuffer::generateMD5HashKey | ( |  | ) |

## ◆ get_class_name()

string util::DataBuffer::get_class_name | ( |  | ) | const
| inline virtual

Returns the class name.

Definition at line 416 of file DataBuffer.h.

## ◆ getAllocationReqSize()

int util::DataBuffer::getAllocationReqSize | ( |  | ) |
| static

## ◆ getCapacity()

int util::DataBuffer::getCapacity | ( |  | ) | const
| inline

Return allocated capacity of 'this' DataBuffer.

Definition at line 1492 of file DataBuffer.h.

## ◆ getData()

string util::DataBuffer::getData | ( |  | ) | const
| inline

Return a reference to the DataBuffer.

Definition at line 1482 of file DataBuffer.h.

## ◆ getPos()

int util::DataBuffer::getPos | ( |  | ) | const
| inline

Return the buffers iterator location.

Definition at line 1449 of file DataBuffer.h.

## ◆ getPosPointer() [1/2]

char * util::DataBuffer::getPosPointer | ( |  | ) |
| inline

Return a pointer to the current iterator location in the buffer.

Definition at line 1502 of file DataBuffer.h.

## ◆ getPosPointer() [2/2]

char * util::DataBuffer::getPosPointer | ( | int | pos | ) |
| inline

Return a Pointer to position pos in the buffer.

Definition at line 1513 of file DataBuffer.h.

## ◆ incrementPos()

void util::DataBuffer::incrementPos | ( | int | increment | ) |
| inline

Increment the buffers iterator by increment bytes. This is an unsafe operation. If dbDataPos + increment > dbSize. dbSize is NOT checked.

Definition at line 1461 of file DataBuffer.h.

## ◆ isByteOrderReversed()

bool util::DataBuffer::isByteOrderReversed | ( |  | ) | const
| inline

Returns true if the byte order in reads and writes is reversed for all 2, 4, or 8 byte intrinsincs (short, int, long, float, double, etc.).

Definition at line 1607 of file DataBuffer.h.

## ◆ operator=()

DataBuffer & util::DataBuffer::operator= | ( | const DataBuffer & | db | ) |

## ◆ readBool() [1/2]

bool util::DataBuffer::readBool | ( |  | ) |
| inline

Read a bool from the buffer and update the iterator.

Definition at line 590 of file DataBuffer.h.

## ◆ readBool() [2/2]

bool util::DataBuffer::readBool | ( | int | pos | ) |
| inline

Read a bool from the positions specified by pos ... doesn't update dbDataPos.

Definition at line 605 of file DataBuffer.h.

## ◆ readBoolArray()

void util::DataBuffer::readBoolArray | ( | bool * | array,
|  | int | num_bools )
| inline

Read num_bools booleans from 'this' DataBuffer into array.

Definition at line 618 of file DataBuffer.h.

## ◆ readByte() [1/2]

uByte util::DataBuffer::readByte | ( |  | ) |
| inline

Read a byte from the buffer and update the iterator.

Definition at line 549 of file DataBuffer.h.

## ◆ readByte() [2/2]

uByte util::DataBuffer::readByte | ( | int | pos | ) |
| inline

Read a byte from the positions specified by pos ... doesn't update dbDataPos.

Definition at line 564 of file DataBuffer.h.

## ◆ readByteArray()

void util::DataBuffer::readByteArray | ( | uByte * | array,
|  | int | num_bytes )
| inline

Read num_bytes characters from 'this' DataBuffer into array.

Definition at line 577 of file DataBuffer.h.

## ◆ readCharArray()

void util::DataBuffer::readCharArray | ( | char * | array,
|  | int | num_chars )
| inline

Read num_chars characters from 'this' DataBuffer into /em array.

Definition at line 536 of file DataBuffer.h.

## ◆ readDouble() [1/2]

double util::DataBuffer::readDouble | ( |  | ) |
| inline

Read a double from the buffer. Make sure the buffer is 8byte alligned before reading.

Definition at line 835 of file DataBuffer.h.

## ◆ readDouble() [2/2]

double util::DataBuffer::readDouble | ( | int | pos | ) |
| inline

Just read the double from the positions specified by pos ... doesn't update dbDataPos.

Definition at line 852 of file DataBuffer.h.

## ◆ readDoubleArray()

void util::DataBuffer::readDoubleArray | ( | double * | array,
|  | int | num_doubles )
| inline

Read num_doubles doubles from 'this' DataBuffer into array.

Definition at line 882 of file DataBuffer.h.

## ◆ readFloat() [1/2]

float util::DataBuffer::readFloat | ( |  | ) |
| inline

Read a float from the buffer. Make sure the buffer is 4byte alligned before reading.

Definition at line 767 of file DataBuffer.h.

## ◆ readFloat() [2/2]

float util::DataBuffer::readFloat | ( | int | pos | ) |
| inline

Read the float from the positions specified by pos ... doesn't update dbDataPos.

Definition at line 784 of file DataBuffer.h.

## ◆ readFloatArray()

void util::DataBuffer::readFloatArray | ( | float * | array,
|  | int | num_floats )
| inline

Read num_floats floats from 'this' DataBuffer into array.

Definition at line 814 of file DataBuffer.h.

## ◆ readFromFile() [1/4]

void util::DataBuffer::readFromFile | ( | fstream & | ifs,
|  | int | num_bytes )

## ◆ readFromFile() [2/4]

void util::DataBuffer::readFromFile | ( | fstream & | ifs,
|  | int64 | filePos,
|  | int | num_bytes )

## ◆ readFromFile() [3/4]

void util::DataBuffer::readFromFile | ( | ifstream & | ifs,
|  | int | num_bytes )

## ◆ readFromFile() [4/4]

void util::DataBuffer::readFromFile | ( | ifstream & | ifs,
|  | int64 | filePos,
|  | int | num_bytes )

## ◆ readInt32() [1/2]

int util::DataBuffer::readInt32 | ( |  | ) |
| inline

Read an int from the buffer. Make sure the buffer is 4byte alligned before reading.

Definition at line 632 of file DataBuffer.h.

## ◆ readInt32() [2/2]

int util::DataBuffer::readInt32 | ( | int | pos | ) |
| inline

Read the int from the positions specified by pos ... doesn't update dbDataPos.

Definition at line 649 of file DataBuffer.h.

## ◆ readInt64() [1/2]

int64 util::DataBuffer::readInt64 | ( |  | ) |
| inline

Read a long from the buffer. Make sure the buffer is 8byte alligned before reading.

Definition at line 699 of file DataBuffer.h.

## ◆ readInt64() [2/2]

int64 util::DataBuffer::readInt64 | ( | int | pos | ) |
| inline

Read the long from the positions specified by pos ... doesn't update dbDataPos.

Definition at line 716 of file DataBuffer.h.

## ◆ readIntArray()

void util::DataBuffer::readIntArray | ( | int * | array,
|  | int | num_ints )
| inline

Read num_ints integers from 'this' DataBuffer into array.

Definition at line 679 of file DataBuffer.h.

## ◆ readLongArray()

void util::DataBuffer::readLongArray | ( | int64 * | array,
|  | int | num_longs )
| inline

Read num_longs int64s from 'this' DataBuffer into array.

Definition at line 746 of file DataBuffer.h.

## ◆ readMD5HashKey()

const string & util::DataBuffer::readMD5HashKey | ( |  | ) |

## ◆ readRawDouble()

double util::DataBuffer::readRawDouble | ( |  | ) |
| inline

Read a double ... don't check for alignment ... fast but client is responsible for alignment.

Definition at line 867 of file DataBuffer.h.

## ◆ readRawFloat()

float util::DataBuffer::readRawFloat | ( |  | ) |
| inline

Read a float ... don't check for alignment ... fast but client is responsible for alignment.

Definition at line 799 of file DataBuffer.h.

## ◆ readRawInt32()

int util::DataBuffer::readRawInt32 | ( |  | ) |
| inline

Read an Int32 ... don't check for alignment ... fast but client is responsible for alignment.

Definition at line 664 of file DataBuffer.h.

## ◆ readRawInt64()

int64 util::DataBuffer::readRawInt64 | ( |  | ) |
| inline

Read a long ... don't check for alignment ... fast but client is responsible for alignment.

Definition at line 731 of file DataBuffer.h.

## ◆ readString() [1/2]

const string & util::DataBuffer::readString | ( |  | ) |
| inline

Read a string and return a reference to be assigned to another string in the client. This function assumes the length of the string occurs imediately before the actual string data.

Definition at line 504 of file DataBuffer.h.

## ◆ readString() [2/2]

void util::DataBuffer::readString | ( | string & | str,
|  | int | num_chars )
| inline

Read num_chars from 'this' databuffer into the input string, str.

Definition at line 523 of file DataBuffer.h.

## ◆ reserve()

void util::DataBuffer::reserve | ( | int | sze | ) |
| inline

brief Reserves space in the DataBuffer

Reserves space in the DataBuffer.

Definition at line 1619 of file DataBuffer.h.

## ◆ resetPos()

void util::DataBuffer::resetPos | ( |  | ) |
| inline

Reset the buffers iterator location to zero.

Definition at line 1421 of file DataBuffer.h.

## ◆ reverseBO2()

void util::DataBuffer::reverseBO2 | ( | char * | d | ) |
| inline static

Reverses byte order of d. d is assumed to point to an 2 byte element.

Definition at line 1524 of file DataBuffer.h.

## ◆ reverseBO2Array()

void util::DataBuffer::reverseBO2Array | ( | int | n,
|  | char * | a )
| static

## ◆ reverseBO4()

void util::DataBuffer::reverseBO4 | ( | char * | d | ) |
| inline static

Reverses byte order of d. d is assumed to point to an 4 byte element.

Definition at line 1536 of file DataBuffer.h.

## ◆ reverseBO4Array()

void util::DataBuffer::reverseBO4Array | ( | int | n,
|  | char * | a )
| static

## ◆ reverseBO8()

void util::DataBuffer::reverseBO8 | ( | char * | d | ) |
| inline static

Reverses byte order of d. d is assumed to point to an 8 byte element.

Definition at line 1552 of file DataBuffer.h.

## ◆ reverseBO8Array()

void util::DataBuffer::reverseBO8Array | ( | int | n,
|  | char * | a )
| static

## ◆ reverseBOArray()

void util::DataBuffer::reverseBOArray | ( | int | n,
|  | char * | a,
|  | int | s )
| static

## ◆ setByteOrderReverse()

void util::DataBuffer::setByteOrderReverse | ( | bool | bor | ) |
| inline

Sets the byte order reverse flag to bor.

Definition at line 1576 of file DataBuffer.h.

## ◆ setPosToEnd()

void util::DataBuffer::setPosToEnd | ( |  | ) |
| inline

Set the buffers iterator position to dbSize. If current iterator exceeds dbsize then dbsize is set and dbDataPos is unchanged.

Definition at line 1436 of file DataBuffer.h.

## ◆ setSize()

void util::DataBuffer::setSize | ( | int | num_bytes | ) |
| inline

Set the size of the data buffer to num_bytes.

Definition at line 1396 of file DataBuffer.h.

## ◆ size()

int util::DataBuffer::size | ( |  | ) |
| inline

Return the current DataBuffer size.

Definition at line 1406 of file DataBuffer.h.

## ◆ writeBool() [1/2]

void util::DataBuffer::writeBool | ( | bool | b | ) |
| inline

Write a bool (b) to the DataBuffer. Make sure the buffer is sized appropriately before writing.

Definition at line 1030 of file DataBuffer.h.

## ◆ writeBool() [2/2]

void util::DataBuffer::writeBool | ( | bool | b,
|  | int | pos )
| inline

Write a bool (b) at databuffer position pos. Does not update the iterator.

Definition at line 1047 of file DataBuffer.h.

## ◆ writeBoolArray()

void util::DataBuffer::writeBoolArray | ( | const bool * | array,
|  | int | num_bools )
| inline

Write num_bools bools from the input array into 'this' DataBuffer.

Definition at line 1074 of file DataBuffer.h.

## ◆ writeByte() [1/2]

void util::DataBuffer::writeByte | ( | uByte | b | ) |
| inline

Write a byte (b) to the DataBuffer. Make sure the buffer is sized appropriately before writing.

Definition at line 968 of file DataBuffer.h.

## ◆ writeByte() [2/2]

void util::DataBuffer::writeByte | ( | uByte | b,
|  | int | pos )
| inline

Write a uByte (b) at databuffer position pos. Does not update the iterator.

Definition at line 985 of file DataBuffer.h.

## ◆ writeByteArray()

void util::DataBuffer::writeByteArray | ( | const uByte * | array,
|  | int | num_bytes )
| inline

Write num_bytes uBytes from the input array into 'this' DataBuffer.

Definition at line 1012 of file DataBuffer.h.

## ◆ writeCharArray()

void util::DataBuffer::writeCharArray | ( | const char * | array,
|  | int | num_chars )
| inline

Write num_chars of the character array into 'this' DataBuffer.

Definition at line 950 of file DataBuffer.h.

## ◆ writeDouble() [1/2]

void util::DataBuffer::writeDouble | ( | double | d | ) |
| inline

Write a double (d) to the DataBuffer. Make sure the buffer is 8byte alligned and sized appropriatly before reading.

Definition at line 1317 of file DataBuffer.h.

## ◆ writeDouble() [2/2]

void util::DataBuffer::writeDouble | ( | double | d,
|  | int | pos )
| inline

Write a double (d) at databuffer position pos. Does not update the iterator.

Definition at line 1338 of file DataBuffer.h.

## ◆ writeDoubleArray()

void util::DataBuffer::writeDoubleArray | ( | const double * | array,
|  | int | num_doubles )
| inline

Write num_doubles doubles from the input array into 'this' DataBuffer.

Definition at line 1368 of file DataBuffer.h.

## ◆ writeFloat() [1/2]

void util::DataBuffer::writeFloat | ( | float | f | ) |
| inline

Write a float (f) to the DataBuffer. Make sure the buffer is 4byte alligned and sized appropriatly before reading.

Definition at line 1242 of file DataBuffer.h.

## ◆ writeFloat() [2/2]

void util::DataBuffer::writeFloat | ( | float | f,
|  | int | pos )
| inline

Write a float (f) at databuffer position pos. Does not update the iterator.

Definition at line 1263 of file DataBuffer.h.

## ◆ writeFloatArray()

void util::DataBuffer::writeFloatArray | ( | const float * | array,
|  | int | num_floats )
| inline

Write num_floats floats from the input array into 'this' DataBuffer.

Definition at line 1292 of file DataBuffer.h.

## ◆ writeInt32() [1/2]

void util::DataBuffer::writeInt32 | ( | int | i | ) |
| inline

Write an Int32 (i) to the DataBuffer. Make sure the buffer is 4byte alligned and sized appropriatly before reading.

Definition at line 1092 of file DataBuffer.h.

## ◆ writeInt32() [2/2]

void util::DataBuffer::writeInt32 | ( | int | i,
|  | int | pos )
| inline

Write an int (i) at databuffer position pos. Do not update the iterator.

Definition at line 1113 of file DataBuffer.h.

## ◆ writeInt64() [1/2]

void util::DataBuffer::writeInt64 | ( | int64 | i | ) |
| inline

Write an Int64 (i) to the DataBuffer. Make sure the buffer is 8byte alligned and sized appropriatly before reading.

Definition at line 1167 of file DataBuffer.h.

## ◆ writeInt64() [2/2]

void util::DataBuffer::writeInt64 | ( | int64 | i,
|  | int | pos )
| inline

Write a long (i) at databuffer position pos. Does not update the iterator.

Definition at line 1188 of file DataBuffer.h.

## ◆ writeIntArray()

void util::DataBuffer::writeIntArray | ( | const int * | array,
|  | int | num_ints )
| inline

Write num_ints ints from the input array into 'this' DataBuffer.

Definition at line 1142 of file DataBuffer.h.

## ◆ writeLongArray()

void util::DataBuffer::writeLongArray | ( | const int64 * | array,
|  | int | num_longs )
| inline

Write num_longs longs from the input array into 'this' DataBuffer.

Definition at line 1217 of file DataBuffer.h.

## ◆ writeRawBool()

void util::DataBuffer::writeRawBool | ( | bool | b | ) |
| inline

Write a bool (b) ... do not check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly.

Definition at line 1061 of file DataBuffer.h.

## ◆ writeRawByte()

void util::DataBuffer::writeRawByte | ( | uByte | b | ) |
| inline

Write a uByte (b) ... don't check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly.

Definition at line 999 of file DataBuffer.h.

## ◆ writeRawDouble()

void util::DataBuffer::writeRawDouble | ( | double | d | ) |
| inline

Write a double (d) ... do not check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly.

Definition at line 1353 of file DataBuffer.h.

## ◆ writeRawFloat()

void util::DataBuffer::writeRawFloat | ( | float | f | ) |
| inline

Write a float (f) ... do not check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly.

Definition at line 1278 of file DataBuffer.h.

## ◆ writeRawInt32()

void util::DataBuffer::writeRawInt32 | ( | int | i | ) |
| inline

Write an Int32 (i) ... do not check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly.

Definition at line 1128 of file DataBuffer.h.

## ◆ writeRawInt64()

void util::DataBuffer::writeRawInt64 | ( | int64 | i | ) |
| inline

Write an Int64 (i) ... don't check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly.

Definition at line 1203 of file DataBuffer.h.

## ◆ writeString() [1/2]

void util::DataBuffer::writeString | ( | char * | char_string | ) |
| inline

Write the string char_string into 'this' DataBuffer.

Definition at line 939 of file DataBuffer.h.

## ◆ writeString() [2/2]

void util::DataBuffer::writeString | ( | const string & | in_string | ) |
| inline

Write the string in_string into 'this' DataBuffer.

Definition at line 906 of file DataBuffer.h.

## ◆ writeToFile() [1/2]

void util::DataBuffer::writeToFile | ( | fstream & | ofs | ) |

## ◆ writeToFile() [2/2]

void util::DataBuffer::writeToFile | ( | ofstream & | ofs | ) |

## Member Data Documentation

## ◆ ALLOCATION_REQ_SIZE

const int util::DataBuffer::ALLOCATION_REQ_SIZE
| static

Default allocation requirement size for a data buffer.

Definition at line 359 of file DataBuffer.h.

## ◆ dbData

string* util::DataBuffer::dbData
| protected

A string object is used to contain the actual data.

Definition at line 373 of file DataBuffer.h.

## ◆ dbDataPos

int util::DataBuffer::dbDataPos
| protected

The current iterator position in the data container (dbData).

Definition at line 376 of file DataBuffer.h.

## ◆ dbOwnStr

bool util::DataBuffer::dbOwnStr
| protected

A boolean, that if true, indicates the storage string for this DataBuffer is owned and therefore deleted when the DataBuffer is deleted.

Definition at line 395 of file DataBuffer.h.

## ◆ dbPad

bool util::DataBuffer::dbPad
| protected

A boolean, that if true, maintains 4 and 8 byte alignment in support of double alignment compilation.

Definition at line 383 of file DataBuffer.h.

## ◆ dbReverse

bool util::DataBuffer::dbReverse
| protected

A boolean, that if true, reverses the byte order of all 2, 4, and 8 byte intrinsics (shorts, ints, long, floats, doubles, etc.). This flag is set by the FileDatabase object only and otherwise defaults to false. The flag is used to convert byte order between big- and little- endian formats.

Definition at line 390 of file DataBuffer.h.

## ◆ dbSize

int util::DataBuffer::dbSize
| protected

The current size of the data container.

Definition at line 379 of file DataBuffer.h.

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

- rstt_v3.2.1/SLBM/include/DataBuffer.h