![]() |
VR-Forces Developer's Guide
|
The IGI Message. Is easily encoded and decoding using stream operators. It also provides validation during decoding of binary data for both type and size. It is also extensible allowing for additional types.
Public Types | |
| enum | DataType { Unknown = 0, Char = 1 | packSizeOf(char), UnsignedChar = 2 | packSizeOf(unsigned char), Short = 3 | packSizeOf(short), UnsignedShort = 4 | packSizeOf(unsigned short), Int = 5 | packSizeOf(int), UnsignedInt = 6 | packSizeOf(unsigned int), Float = 7 | packSizeOf(float), LongLong = 8 | packSizeOf(long long), UnsignedLongLong = 9 | packSizeOf(unsigned long long), Double = 10 | packSizeOf(double), Bool = 11 | packSizeOf(bool), Long = 12 | packSizeOf(long), UnsignedLong = 13 | packSizeOf(unsigned long), String = 128, FixedArray = 129, UnicodeString = 130, User_Start = 150, User_Last = 255 } |
| typedef unsigned char | Byte |
| typedef std::vector< Byte, tbb::tbb_allocator< Byte > > | ByteBuffer |
Static Public Attributes | |
| static const int | theHeaderSize = (sizeof(unsigned short) + sizeof(char)) * 2 |
| ByteBuffer | myBuffer |
| ByteBuffer::const_iterator | myReadIter |
| bool | mySerializeWriteOutFlag |
| void | addMultiple () |
| template<typename T1 > | |
| void | addMultiple (T1 t1) |
| template<typename T1 , typename T2 > | |
| void | addMultiple (T1 t1, T2 t2) |
| template<typename T1 , typename T2 , typename T3 > | |
| void | addMultiple (T1 t1, T2 t2, T3 t3) |
| template<typename T1 , typename T2 , typename T3 , typename T4 > | |
| void | addMultiple (T1 t1, T2 t2, T3 t3, T4 t4) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > | |
| void | addMultiple (T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 > | |
| void | addMultiple (T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 > | |
| void | addMultiple (T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 > | |
| void | addMultiple (T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8) |
| void | readMultiple () |
| template<typename T1 > | |
| void | readMultiple (T1 &t1) |
| template<typename T1 , typename T2 > | |
| void | readMultiple (T1 &t1, T2 &t2) |
| template<typename T1 , typename T2 , typename T3 > | |
| void | readMultiple (T1 &t1, T2 &t2, T3 &t3) |
| template<typename T1 , typename T2 , typename T3 , typename T4 > | |
| void | readMultiple (T1 &t1, T2 &t2, T3 &t3, T4 &t4) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > | |
| void | readMultiple (T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 > | |
| void | readMultiple (T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 > | |
| void | readMultiple (T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6, T7 &t7) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 > | |
| void | readMultiple (T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6, T7 &t7, T8 &t8) |
| template<typename T1 > | |
| void | serialize (T1 &t1) |
| template<typename T1 , typename T2 > | |
| void | serialize (T1 &t1, T2 &t2) |
| template<typename T1 , typename T2 , typename T3 > | |
| void | serialize (T1 &t1, T2 &t2, T3 &t3) |
| template<typename T1 , typename T2 , typename T3 , typename T4 > | |
| void | serialize (T1 &t1, T2 &t2, T3 &t3, T4 &t4) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > | |
| void | serialize (T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 > | |
| void | serialize (T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 > | |
| void | serialize (T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6, T7 &t7) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 > | |
| void | serialize (T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6, T7 &t7, T8 &t8) |
| template<typename T > | |
| void | serializeViaArchive (T &t) |
| void | setClassId (unsigned short classId) |
| void | setFunctionId (unsigned short functionId) |
| typedef unsigned char makVrv::DtMessage::Byte |
| typedef std::vector<Byte, tbb::tbb_allocator<Byte> > makVrv::DtMessage::ByteBuffer |
Byte 0: DataType Id.
If DataType is a simple type (value type, int,double etc). Byte 1-n: Where n is 1-8, depending on the datatype is If DataType is a complex type (binary chunk w/ size) Byte 1-4: Is a 32bit integer which is the size of the data (in bytes). Byte 5-(5 + size): The size bytes. Default CTOR By default this message will be initialized to do reading input and writing to the message during serialization.
| makVrv::DtMessage::DtMessage | ( | const Byte * | buffer, |
| size_t | size | ||
| ) |
Construct a message from a raw buffer, the raw buffer MUST have come from another IGI message, typically due to the fact it was transfered to a separate client process. By default this message will be initialized to do reading data from the message and writing to the input during serialization.
| makVrv::DtMessage::DtMessage | ( | const DtMessage & | orig | ) |
CTOR. Note that the internal read pointer is also copied, in addition to the data.
| makVrv::DtMessage::~DtMessage | ( | ) |
DTOR.
| void makVrv::DtMessage::printDebugMessageContents | ( | std::ostream & | ) |
Print the message contents for debugging.
Get the name of a data type in English.
| unsigned short makVrv::DtMessage::classId | ( | ) | const |
Get the class id.
| unsigned short makVrv::DtMessage::functionId | ( | ) | const |
Get the function id.
| const Byte* makVrv::DtMessage::data | ( | ) | const |
Get a pointer to the start of the data.
| size_t makVrv::DtMessage::size | ( | ) | const |
Get the current size of the message in bytes.
| void makVrv::DtMessage::emptyMessage | ( | ) |
Empty the message. This does NOT dealloc memory.
| void makVrv::DtMessage::resetRead | ( | ) |
Reset the internal reader to the beginning of data. This does not include the internal message header.
If the message is set to write out, this will verify that the input class id and the function id match those in the message, if the message is set to read in data, it will set the class id and function id.
| bool makVrv::DtMessage::serializeWriteOut | ( | ) | const |
Is this message set to write out data during serialization or read in data.
| void makVrv::DtMessage::setSerializeWriteOut | ( | bool | writeOut | ) |
Set whether the message will write out data during serialization or read in data.
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
| DtMessage& makVrv::DtMessage::operator>> | ( | short & | i | ) |
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
| DtMessage& makVrv::DtMessage::operator>> | ( | float & | f | ) |
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
| DtMessage& makVrv::DtMessage::operator>> | ( | std::string & | s | ) |
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
| DtMessage& makVrv::DtMessage::operator>> | ( | ByteBuffer & | rawData | ) |
Read data parameters. Each call moves the internal data pointers. throws exceptions on errors.
Note that this will allocate new memory (char*) and return it in the first member.
| DtMessage& makVrv::DtMessage::operator<< | ( | short | i | ) |
Add data parameters.
| DtMessage& makVrv::DtMessage::operator<< | ( | float | f | ) |
Add data parameters.
| DtMessage& makVrv::DtMessage::operator<< | ( | const std::string & | s | ) |
Add data parameters.
| DtMessage& makVrv::DtMessage::operator<< | ( | const ByteBuffer & | rawData | ) |
Add data parameters.
Add data parameters.
| void makVrv::DtMessage::addOnlyData | ( | DtMessage & | message | ) |
Adds only the data from the message (no header).
Low level add data call.
| bool makVrv::DtMessage::canReadData | ( | ) | const |
Get if there is more data that can be read.
Get the type of the next data in the message.
| DtCorruptedState | if there is no next data. |
Get the data size of the next parameter to be read. NOTE! the reader pointer must be pointing to the beginning of a parameter in the buffer.
| DtCorruptedState | if there is no next data. |
| const void* makVrv::DtMessage::nextDataPointer | ( | ) | const |
Get a pointer to the next chunk of data. Do not modify the data in this pointer.
| void makVrv::DtMessage::skipToNextData | ( | ) |
Move the read pointer to the next data element in the message.
| void makVrv::DtMessage::advanceRead | ( | size_t | bytes | ) |
Move the read pointer forward a number of bytes.
| void makVrv::DtMessage::getData | ( | int | dataType, |
| void * | output | ||
| ) |
Read the next parameter into the output. It is assumed that output has sufficient space, use getDataSize before calling to ensure this. This function also moves the current read pointer.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
inline |
Helper functions for doing multiple adds and reads.
|
protected |
Set the class id.
|
protected |
Set the function id.
|
protected |
Helper functions for doing multiple adds and reads.
|
protected |
Helper functions for doing multiple adds and reads.
|
protected |
Helper functions for doing multiple adds and reads.