![]() |
VR-Link API Documentation for DIS
|
DtPdu is the base class for all PDU's in VR-Link. More...
Inheritance diagram for DtPdu:
Collaboration diagram for DtPdu:Public Member Functions | |
| virtual | ~DtPdu () |
| Destructor. | |
| DtPdu (const DtPdu &pdu, DtBufferPtr buffer=DtUSE_INTERNAL_BUFFER) | |
| Copy constructor. | |
| DtPdu & | operator= (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 DtNetPduHeader * | netHeader () 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 | printData () const |
| Print the PDU's data (not including header). | |
| virtual void | printDataToStream (std::ostream &stream) const |
| 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. | |
| DtBaseMsg & | operator= (const DtBaseMsg &msg) |
| Assignment. | |
| virtual const char * | netRep () const |
| Get network representation. | |
| virtual int | length () const |
| Get size of message. | |
Protected Member Functions | |
| DtPdu () | |
| Constructor. | |
| virtual void | setStatus (int okStatus) |
| Sets the PDU's status to okStatus. | |
| virtual void | initPdu (int size, DtBufferPtr buffer) |
| Must be called after default ctor before PDU is completely constructed. | |
| virtual void | initPdu (const void *initial, DtBufferPtr buffer) |
| Called by from-net-rep ctor. Initializes DtBaseMsg. | |
| virtual DtPduKind | internalGetPduKind () const =0 |
| Returns the PDU kind associated with the derived PDU class. | |
| virtual DtProtocolFamily | kindToFamily (DtPduKind kind) const |
| Maps PDU kind to ProtocolFamily. | |
| virtual void | sizeChanged (int size) |
| Called by changeSize. Sets the size in the header to size. | |
| virtual void | clearData () |
| zeros out all bytes after the PDU header. | |
| virtual void | initHeader (DtPduKind kind, int size) |
| Initializes PDU header. Called by initPdu. | |
Protected Member Functions inherited from DtBaseMsg | |
| DtBaseMsg () | |
| Constructor Object is not fully constructed until initMsg is called. | |
| void | initMsg (int size, DtBufferPtr bufferPtr) |
| void | initMsg (const void *initial, int size, DtBufferPtr bufferPtr) |
| virtual void | changeSize (int size) |
| Changes the size of the message. | |
| virtual void | insertBytes (int offset, int numBytes) |
| Inserts numBytes zeroed-out bytes at the indicated offset into the net rep. | |
| virtual void | insertBytes (void *address, int numBytes) |
| Inserts numBytes zeroed-out bytes at the indicated address. | |
| virtual void | deleteBytes (int offset, int numBytes) |
| Deletes numBytes bytes at the indicated offset in the net rep. | |
| virtual void | deleteBytes (void *address, int numBytes) |
| Deletes numBytes bytes starting at the indicated address. | |
| virtual void | clearAll () |
| Zeros out all bytes in the network representation. | |
| virtual void * | newInternalBuffer (int size) |
| Sets myInternalBuff to point to a malloc'ed buffer of size bytes. | |
Protected Attributes | |
| int | myOKStatus |
Protected Attributes inherited from DtBaseMsg | |
| void * | myNetMsg |
| void * | myInternalBuff |
| int | myIntBuffSize |
| int | myMsgSize |
DtPdu is the base class for all PDU's in VR-Link.
|
virtual |
Destructor.
| DtPdu::DtPdu | ( | const DtPdu & | pdu, |
| DtBufferPtr | buffer = DtUSE_INTERNAL_BUFFER |
||
| ) |
Copy constructor.
|
protected |
Constructor.
PDU is not fully constructed until initPdu is called.
|
protectedvirtual |
zeros out all bytes after the PDU header.
|
inlinevirtual |
References DtNetPduHeader::DtExercise, and netHeader().
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.
|
protectedvirtual |
Initializes PDU header. Called by initPdu.
|
protectedvirtual |
Must be called after default ctor before PDU is completely constructed.
Fills in PDU header, and initializes DtBaseMsg.
|
protectedvirtual |
Called by from-net-rep ctor. Initializes DtBaseMsg.
|
protectedpure virtual |
Returns the PDU kind associated with the derived PDU class.
Implemented in DtMinefieldDataPdu, DtAggregateStatePdu, DtResupplyReceivedPdu, DtLeDetonationPdu, DtDIGuyCustomPdu, DtEntityStatePdu, DtGriddedDataPdu, DtElectromagneticEmissionPdu, DtIsGroupOfPdu, DtLeFirePdu, DtEnvironmentalProcessPdu, DtLeAppearancePdu, DtMinefieldQueryPdu, DtIntercomControlPdu, DtUnderwaterAcousticPdu, DtSignalPdu, DtLeTspiPdu, DtTransmitterPdu, DtRelativeLocationPdu, DtArealObjectStatePdu, DtPointObjectStatePdu, DtMinefieldStatePdu, DtIffAtcNavaidsPdu, DtResupplyOfferPdu, TestPdu, DtActionResponsePdu, DtDesignatorPdu, DtDetonationPdu, DtCollisionElasticPdu, DtEntityStateUpdatePdu, DtLinearObjectStatePdu, DtFirePdu, DtIntercomSignalPdu, DtRepairCompletePdu, DtLeArticulatedPartsPdu, DtSuppEmisEntStatePdu, DtRecordQueryPdu, DtIsPartOfPdu, DtReceiverPdu, DtTransferControlRequestPdu, DtRecordPdu, DtDataQueryRPdu, DtMinefieldResponseNackPdu, DtSetRecordPdu, DtStopFreezeRPdu, DtServiceRequestPdu, DtDataQueryPdu, DtStartResumePdu, DtStartResumeRPdu, DtAcknowledgePdu, DtStopFreezePdu, DtAcknowledgeRPdu, DtCreateEntityRPdu, DtActionRequestRPdu, DtRemoveEntityRPdu, DtCollisionPdu, DtDataRPdu, DtSetDataRPdu, DtRemoveEntityPdu, DtCreateEntityPdu, DtActionRequestPdu, DtActionResponseRPdu, DtCommentRPdu, DtEventReportPdu, DtEventReptRPdu, DtCommentPdu, DtDataPdu, DtResupplyCancelPdu, DtRepairResponsePdu, DtSetDataPdu, and DtUnknownPdu.
|
inlinevirtual |
Returns PDU kind from PDU header.
References netHeader().
|
protectedvirtual |
Maps PDU kind to ProtocolFamily.
|
inlinevirtual |
Returns a pointer to the PDU's header.
References DtBaseMsg::netRep().
Referenced by exerciseId(), kind(), protocolFamily(), protocolVersion(), setExerciseId(), setTimeStamp(), setVersion(), timeStamp(), and timeStampType().
Assignment operator.
Referenced by DtSimanPdu::operator=(), and DtPduWithData::operator=().
|
inlinevirtual |
Older function that returns a pointer to the network representation.
The newer DtBaseMsg::netRep should generally be used instead.
References DtBaseMsg::netRep().
|
virtual |
Print the contents of the PDU by calling printToStream(DtInfo).
|
virtual |
Print the PDU's data (not including header).
Base DtPdu version just prints hex. Use the printDataToString to put the data into a DtString instead of simply sending the output to stdout. printData() calls printDataToStream(DtInfo).
Reimplemented in DtMinefieldDataPdu, DtPduWithData, DtResupplyReceivedPdu, DtGriddedDataPdu, DtElectromagneticEmissionPdu, DtAggregateStatePdu, DtLeDetonationPdu, DtEntityStatePdu, DtDIGuyCustomPdu, DtIsGroupOfPdu, DtSignalPdu, DtTransmitterPdu, DtMinefieldQueryPdu, DtIntercomControlPdu, DtLeFirePdu, DtLeAppearancePdu, DtArealObjectStatePdu, DtUnderwaterAcousticPdu, DtIffAtcNavaidsPdu, DtActionResponsePdu, DtDesignatorPdu, DtDetonationPdu, DtResupplyOfferPdu, DtCollisionElasticPdu, DtLeTspiPdu, DtPointObjectStatePdu, DtMinefieldStatePdu, DtEntityStateUpdatePdu, DtRepairCompletePdu, DtFirePdu, DtLinearObjectStatePdu, DtIntercomSignalPdu, DtSuppEmisEntStatePdu, DtEnvironmentalProcessPdu, DtLeArticulatedPartsPdu, DtRecordQueryPdu, DtIsPartOfPdu, DtReceiverPdu, TestPdu, DtServiceRequestPdu, DtTransferControlRequestPdu, DtDataQueryRPdu, DtRecordPdu, DtMinefieldResponseNackPdu, DtStopFreezeRPdu, DtCollisionPdu, DtSetRecordPdu, DtStartResumePdu, DtDataQueryPdu, DtStartResumeRPdu, DtAcknowledgePdu, DtActionRequestPdu, DtCreateEntityPdu, DtStopFreezePdu, DtAcknowledgeRPdu, DtActionRequestRPdu, DtCreateEntityRPdu, DtSetDataPdu, DtRelativeLocationPdu, DtRemoveEntityRPdu, DtDataRPdu, DtSetDataRPdu, DtRemoveEntityPdu, DtActionResponseRPdu, DtDataPdu, DtRepairResponsePdu, DtResupplyCancelPdu, DtSimanPdu, DtEventReportPdu, DtEventReptRPdu, and DtRecordSetPdu.
|
virtual |
Reimplemented in DtMinefieldDataPdu, DtPduWithData, DtResupplyReceivedPdu, DtGriddedDataPdu, DtElectromagneticEmissionPdu, DtAggregateStatePdu, DtLeDetonationPdu, DtEntityStatePdu, DtDIGuyCustomPdu, DtIsGroupOfPdu, DtSignalPdu, DtMinefieldQueryPdu, DtTransmitterPdu, DtIntercomControlPdu, DtLeFirePdu, DtLeAppearancePdu, DtArealObjectStatePdu, DtUnderwaterAcousticPdu, DtIffAtcNavaidsPdu, DtActionResponsePdu, DtDesignatorPdu, DtDetonationPdu, DtCollisionElasticPdu, DtLeTspiPdu, DtPointObjectStatePdu, DtResupplyOfferPdu, DtMinefieldStatePdu, DtEntityStateUpdatePdu, DtRepairCompletePdu, DtFirePdu, DtLinearObjectStatePdu, DtIntercomSignalPdu, DtSuppEmisEntStatePdu, DtEnvironmentalProcessPdu, DtLeArticulatedPartsPdu, DtRecordQueryPdu, DtIsPartOfPdu, DtReceiverPdu, DtDataQueryRPdu, DtServiceRequestPdu, DtTransferControlRequestPdu, DtRecordPdu, DtMinefieldResponseNackPdu, DtStopFreezeRPdu, DtStartResumePdu, DtCollisionPdu, DtDataQueryPdu, DtSetRecordPdu, DtStartResumeRPdu, DtAcknowledgePdu, DtActionRequestPdu, DtCreateEntityPdu, DtStopFreezePdu, DtAcknowledgeRPdu, DtActionRequestRPdu, DtCreateEntityRPdu, DtSetDataPdu, DtRelativeLocationPdu, DtRemoveEntityRPdu, DtDataRPdu, DtSetDataRPdu, DtRemoveEntityPdu, DtActionResponseRPdu, DtDataPdu, DtSimanPdu, DtEventReportPdu, DtRepairResponsePdu, DtResupplyCancelPdu, DtEventReptRPdu, DtRecordSetPdu, and DtUnknownPdu.
|
virtual |
Reimplemented in DtDetonationPdu, and DtFirePdu.
|
virtual |
Print the PDU's header. This calls printHeaderToStream(DtInfo).
Reimplemented in DtLeDetonationPdu, DtLeFirePdu, DtLeAppearancePdu, DtLeTspiPdu, and DtLeArticulatedPartsPdu.
|
virtual |
Print the PDU's header to a stream.
Reimplemented in DtLeDetonationPdu, DtLeFirePdu, DtLeAppearancePdu, DtLeTspiPdu, and DtLeArticulatedPartsPdu.
|
virtual |
Print the contents of the PDU by calling printHeaderToStream and printDataToStream.
|
inlinevirtual |
Returns protocol family from PDU header.
References netHeader().
|
inlinevirtual |
References netHeader(), and DtNetPduHeader::version.
|
inlinevirtual |
Set/Get exerciseID in PDU header.
References DtNetPduHeader::DtExercise, and netHeader().
|
inlineprotectedvirtual |
Sets the PDU's status to okStatus.
References myOKStatus.
|
inlinevirtual |
Set the PDU header's time stamp to reflect time and type.
Time is in seconds, but only the time modulo an hour actually gets into the time stamp.
References DtNetPduHeader::DtTime, and netHeader().
|
inlinevirtual |
Set/Get protocol version from PDU header.
References netHeader(), and DtNetPduHeader::version.
|
protectedvirtual |
Called by changeSize. Sets the size in the header to size.
Implements DtBaseMsg.
|
inlinevirtual |
Get PDU status.
DtSTATUS_OK means it's good. Other values indicate a bad PDU. Return codes are derived PDU-dependent.
References myOKStatus.
|
inlinevirtual |
Return the time (in seconds past an hour) encoded in the PDU header's time stamp.
References DtNetPduHeader::DtTime, netHeader(), and DtNetTimeStamp::time().
|
inlinevirtual |
Return the type of the time stamp, as indicated in PDU header.
References DtNetPduHeader::DtTime, netHeader(), and DtNetTimeStamp::type().
|
protected |
Referenced by setStatus(), and status().