VR-Link API Documentation for DIS
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes
DtDIGuyCustomPdu Class Reference

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.
DtDIGuyCustomPduoperator= (const DtDIGuyCustomPdu &other)
 Assignment operator.
virtual DtNetDIGuyCustomPdunetDIGuyCustomPdu ()
 Provides access to the network structure of the PDU.
virtual const DtNetDIGuyCustomPdunetDIGuyCustomPdu () 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.
- Public Member Functions inherited from DtStateMsg
 DtStateMsg ()
 default constructor
virtual ~DtStateMsg ()
 destructor
 DtStateMsg (const DtStateMsg &orig)
 copy constructor
DtStateMsgoperator= (const DtStateMsg &orig)
 assignment operator
- Public Member Functions inherited from DtPdu
virtual ~DtPdu ()
 Destructor.
 DtPdu (const DtPdu &pdu, DtBufferPtr buffer=DtUSE_INTERNAL_BUFFER)
 Copy constructor.
DtPduoperator= (const DtPdu &pdu)
 Assignment operator.
virtual void * packet () const
 Older function that returns a pointer to the network representation.
virtual int status () const
 Get PDU status.
virtual void setVersion (int vers)
 Set/Get protocol version from PDU header.
virtual int protocolVersion () const
virtual void setExerciseId (int id)
 Set/Get exerciseID in PDU header.
virtual int exerciseId () const
virtual DtPduKind kind () const
 Returns PDU kind from PDU header.
virtual DtProtocolFamily protocolFamily () const
 Returns protocol family from PDU header.
virtual void setTimeStamp (DtTime time, DtTimeStampType type=DtTimeStampRelative)
 Set the PDU header's time stamp to reflect time and type.
virtual DtTime timeStamp () const
 Return the time (in seconds past an hour) encoded in the PDU header's time stamp.
virtual DtTimeStampType timeStampType () const
 Return the type of the time stamp, as indicated in PDU header.
virtual DtTime guessTimeValid (DtTime referenceTime) const
 Since timestamp only represents number of seconds past the hour, guessTimeValid chooses the hour that would make the timestamp closest to reference time, and returns a time that is timestamp seconds past that hour.
virtual DtNetPduHeadernetHeader () const
 Returns a pointer to the PDU's header.
virtual void print () const
 Print the contents of the PDU by calling printToStream(DtInfo).
virtual void printToStream (std::ostream &stream) const
 Print the contents of the PDU by calling printHeaderToStream and printDataToStream.
virtual void printHeader () const
 Print the PDU's header. This calls printHeaderToStream(DtInfo).
virtual void printHeaderToStream (std::ostream &stream) const
 Print the PDU's header to a stream.
virtual void printDataToString (DtString &str) const
- Public Member Functions inherited from DtBaseMsg
virtual ~DtBaseMsg ()
 Destructor.
 DtBaseMsg (const DtBaseMsg &msg, DtBufferPtr buffer=DtUSE_INTERNAL_BUFFER)
 Copy constructor.
DtBaseMsgoperator= (const DtBaseMsg &msg)
 Assignment.
virtual const char * netRep () const
 Get network representation.
virtual int length () const
 Get size of message.

Static Public Member Functions

static DtPducreate (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

Additional Inherited Members

- Protected Attributes inherited from DtPdu
int myOKStatus

Detailed Description

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.

Member Enumeration Documentation

anonymous enum

The size of the static data within the PDU.

Enumerator:
PduStaticSize 

Constructor & Destructor Documentation

DtDIGuyCustomPdu::DtDIGuyCustomPdu ( DtBufferPtr  buffer = DtUSE_INTERNAL_BUFFER)

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.

Member Function Documentation

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
protectedvirtual

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.

Returns
false if byteoffset is invalid, true otherwise.
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.

Member Data Documentation

DtPduKind DtDIGuyCustomPdu::theCustomPduKind
staticprotected

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

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)