![]() |
VR-Link API Documentation for DIS
|
Implements the storage, sending, and receipt of DI Guy custom PDU's. More...
Inheritance diagram for DtDIGuyCustomPdu:
Collaboration diagram for DtDIGuyCustomPdu:Public Types | |
| enum | { PduStaticSize = 23 } |
| The size of the static data within the PDU. More... | |
Public Member Functions | |
| DtDIGuyCustomPdu (DtBufferPtr buffer=DtUSE_INTERNAL_BUFFER) | |
| Default constructor. | |
| DtDIGuyCustomPdu (const DtNetDIGuyCustomPdu *initial, DtBufferPtr buffer=DtUSE_INTERNAL_BUFFER) | |
| Contructor that creates a DtDIGuyCustomPdu from the network representation. | |
| virtual | ~DtDIGuyCustomPdu () |
| Destructor. | |
| DtDIGuyCustomPdu (const DtDIGuyCustomPdu &other) | |
| Copy constructor. | |
| DtDIGuyCustomPdu & | operator= (const DtDIGuyCustomPdu &other) |
| Assignment operator. | |
| virtual DtNetDIGuyCustomPdu * | netDIGuyCustomPdu () |
| Provides access to the network structure of the PDU. | |
| virtual const DtNetDIGuyCustomPdu * | netDIGuyCustomPdu () const |
| virtual void | setMessageVersion (int version) |
| Get/Set the message version. | |
| virtual int | messageVersion () const |
| virtual void | setMessageId (DtDIGuyCustomPduMsgId msgId) |
| Get/Set the message ID. | |
| virtual DtDIGuyCustomPduMsgId | messageId () const |
| virtual void | setEntityId (const DtEntityIdentifier &entId) |
| Get/Set the Entity ID of the PDU. | |
| virtual DtEntityIdentifier | entityId () const |
| virtual void | setDataSize (unsigned int size) |
| Get/Set the data size. | |
| virtual unsigned int | dataSize () const |
| virtual void | addShort (short value) |
| Adds the short value to the data section of the PDU. | |
| virtual void | addLong (long value) |
| Adds the long value to the data section of the PDU. | |
| virtual void | addFloat (float value) |
| Adds the float value to the data section of the PDU. | |
| virtual void | addString (const DtString &str) |
| Adds the string to the data section of the PDU. | |
| virtual bool | pullShort (short &value, unsigned int &byteoffset) const |
| These methods retrieve the particular type of value from the specified byteoffset. | |
| virtual bool | pullLong (long &value, unsigned int &byteoffset) const |
| virtual bool | pullFloat (float &value, unsigned int &byteoffset) const |
| virtual bool | pullString (DtString &value, unsigned int &byteoffset) const |
| virtual void | getData (unsigned char *buff) const |
| Raw methods of getting/setting data. | |
| virtual void * | data () |
| void | setData (unsigned char *data, int numBytes) |
| virtual void | printData () const |
| Print the data contained in this PDU. | |
| virtual void | printDataToStream (std::ostream &stream) const |
| Print the data to a stream. | |
Static Public Member Functions | |
| static DtPdu * | create (const DtNetPacket *initial, DtBufferPtr buffer=DtUSE_INTERNAL_BUFFER) |
| Static creator function for the DI Guy custom PDU. | |
| static void | addCallback (DtExerciseConn *conn, DtDIGuyCustomPduCb cb, void *usr) |
| Registers a callback for receipt of a DI Guy custom PDU. | |
| static void | removeCallback (DtExerciseConn *conn, DtDIGuyCustomPduCb cb, void *usr) |
| Deregisters a callback for receipt of a DI Guy custom PDU. | |
| static void | setCustomPduKind (DtPduKind pduKind) |
| The BDI Custom PDU's have a PDU kind that can change from run to run. | |
| static DtPduKind | customPduKind () |
Protected Member Functions | |
| virtual DtPduKind | internalGetPduKind () const |
| Returns the PDU kind associated with the derived PDU class. | |
Static Protected Attributes | |
| static DtPduKind | theCustomPduKind |
Implements the storage, sending, and receipt of DI Guy custom PDU's.
These PDU's are used to send messages to DI Guys, according to the DI Guy SDK.
Default constructor.
Constructs a blank DtDIGuyCustomPdu.
| DtDIGuyCustomPdu::DtDIGuyCustomPdu | ( | const DtNetDIGuyCustomPdu * | initial, |
| DtBufferPtr | buffer = DtUSE_INTERNAL_BUFFER |
||
| ) |
Contructor that creates a DtDIGuyCustomPdu from the network representation.
| virtual DtDIGuyCustomPdu::~DtDIGuyCustomPdu | ( | ) | [virtual] |
Destructor.
| DtDIGuyCustomPdu::DtDIGuyCustomPdu | ( | const DtDIGuyCustomPdu & | other | ) |
Copy constructor.
| static void DtDIGuyCustomPdu::addCallback | ( | DtExerciseConn * | conn, |
| DtDIGuyCustomPduCb | cb, | ||
| void * | usr | ||
| ) | [static] |
Registers a callback for receipt of a DI Guy custom PDU.
| virtual void DtDIGuyCustomPdu::addFloat | ( | float | value | ) | [virtual] |
Adds the float value to the data section of the PDU.
The data size will be changed accordingly, and the value will be added to the end of the data section.
| virtual void DtDIGuyCustomPdu::addLong | ( | long | value | ) | [virtual] |
Adds the long value to the data section of the PDU.
The data size will be changed accordingly, and the value will be added to the end of the data section.
| virtual void DtDIGuyCustomPdu::addShort | ( | short | value | ) | [virtual] |
Adds the short value to the data section of the PDU.
The data size will be changed accordingly, and the value will be added to the end of the data section.
| virtual void DtDIGuyCustomPdu::addString | ( | const DtString & | str | ) | [virtual] |
Adds the string to the data section of the PDU.
The data size will be changed accordingly, and the value will be added to the end of the data section. The null-terminating character of the string is copied, as well.
| static DtPdu* DtDIGuyCustomPdu::create | ( | const DtNetPacket * | initial, |
| DtBufferPtr | buffer = DtUSE_INTERNAL_BUFFER |
||
| ) | [static] |
Static creator function for the DI Guy custom PDU.
| static DtPduKind DtDIGuyCustomPdu::customPduKind | ( | ) | [static] |
| virtual void* DtDIGuyCustomPdu::data | ( | ) | [virtual] |
| virtual unsigned int DtDIGuyCustomPdu::dataSize | ( | ) | const [virtual] |
| virtual DtEntityIdentifier DtDIGuyCustomPdu::entityId | ( | ) | const [virtual] |
| virtual void DtDIGuyCustomPdu::getData | ( | unsigned char * | buff | ) | const [virtual] |
Raw methods of getting/setting data.
| virtual DtPduKind DtDIGuyCustomPdu::internalGetPduKind | ( | ) | const [protected, virtual] |
Returns the PDU kind associated with the derived PDU class.
Implements DtPdu.
| virtual DtDIGuyCustomPduMsgId DtDIGuyCustomPdu::messageId | ( | ) | const [virtual] |
| virtual int DtDIGuyCustomPdu::messageVersion | ( | ) | const [virtual] |
| virtual DtNetDIGuyCustomPdu* DtDIGuyCustomPdu::netDIGuyCustomPdu | ( | ) | [virtual] |
Provides access to the network structure of the PDU.
| virtual const DtNetDIGuyCustomPdu* DtDIGuyCustomPdu::netDIGuyCustomPdu | ( | ) | const [virtual] |
| DtDIGuyCustomPdu& DtDIGuyCustomPdu::operator= | ( | const DtDIGuyCustomPdu & | other | ) |
Assignment operator.
| virtual void DtDIGuyCustomPdu::printData | ( | ) | const [virtual] |
Print the data contained in this PDU.
Reimplemented from DtPdu.
| virtual void DtDIGuyCustomPdu::printDataToStream | ( | std::ostream & | stream | ) | const [virtual] |
Print the data to a stream.
Reimplemented from DtPdu.
| virtual bool DtDIGuyCustomPdu::pullFloat | ( | float & | value, |
| unsigned int & | byteoffset | ||
| ) | const [virtual] |
| virtual bool DtDIGuyCustomPdu::pullLong | ( | long & | value, |
| unsigned int & | byteoffset | ||
| ) | const [virtual] |
| virtual bool DtDIGuyCustomPdu::pullShort | ( | short & | value, |
| unsigned int & | byteoffset | ||
| ) | const [virtual] |
These methods retrieve the particular type of value from the specified byteoffset.
The value is stored in the value reference passed in, and byteoffset is modified to the next byte. This way, values can be retrieved in the following manner. DtString str1; DtString str2; int offset = 0; pullString(str1, offset); pullString(str2, offset); This will retrieve two null-terminated strings, and offset will refer to the next available byte in the data section.
| virtual bool DtDIGuyCustomPdu::pullString | ( | DtString & | value, |
| unsigned int & | byteoffset | ||
| ) | const [virtual] |
| static void DtDIGuyCustomPdu::removeCallback | ( | DtExerciseConn * | conn, |
| DtDIGuyCustomPduCb | cb, | ||
| void * | usr | ||
| ) | [static] |
Deregisters a callback for receipt of a DI Guy custom PDU.
| static void DtDIGuyCustomPdu::setCustomPduKind | ( | DtPduKind | pduKind | ) | [static] |
The BDI Custom PDU's have a PDU kind that can change from run to run.
This can be set/retrieved through the below static methods and should be done before any callbacks are registered. The default value is 220.
| void DtDIGuyCustomPdu::setData | ( | unsigned char * | data, |
| int | numBytes | ||
| ) |
| virtual void DtDIGuyCustomPdu::setDataSize | ( | unsigned int | size | ) | [virtual] |
Get/Set the data size.
| virtual void DtDIGuyCustomPdu::setEntityId | ( | const DtEntityIdentifier & | entId | ) | [virtual] |
Get/Set the Entity ID of the PDU.
| virtual void DtDIGuyCustomPdu::setMessageId | ( | DtDIGuyCustomPduMsgId | msgId | ) | [virtual] |
Get/Set the message ID.
| virtual void DtDIGuyCustomPdu::setMessageVersion | ( | int | version | ) | [virtual] |
Get/Set the message version.
Defaults to 7, and should not be changed.
DtPduKind DtDIGuyCustomPdu::theCustomPduKind [static, protected] |