![]() |
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 void | setPduLength (unsigned int length) |
| Set the PDU header's length. | |
| virtual unsigned int | pduLength () const |
| Return the length of the PDU, as indicated in the PDU header. | |
| virtual void | setPduStatus (int) |
| Set the PDU Status in the PDU header. | |
| virtual int | pduStatus () const |
| Returns the PDU Status from the PDU header. | |
| virtual void | setTransferredEntityIndicator (bool difference) |
| Set the Transferred Entity Indicator in the PDU header False is No Difference True is Difference. | |
| virtual bool | transferredEntityIndicator () const |
| Returns the Transferred Entity Indicator from the PDU header False is No Difference True is Difference. | |
| virtual void | setLvcIndicator (DtPduStatusLVCIndicator lvcIndicator) |
| Set the LVC Indicator in the PDU header. | |
| virtual DtPduStatusLVCIndicator | lvcIndicator () const |
| Returns the LVC Indicator from the PDU header. | |
| virtual void | setCoupledExtensionIndicator (bool coupled) |
| Set the Coupled Extension Indicator in the PDU Header False is Not Coupled True is Coupled. | |
| virtual bool | coupledExtensionIndicator () const |
| Returns the Coupled Extension Indicator from the PDU Header False is Not Coupled True is Coupled. | |
| virtual void | setFireTypeIndicator (DtPduStatusFireTypeIndicator fireTypeIndicator) |
| Set the Fire Type Indicator in the PDU header. | |
| virtual DtPduStatusFireTypeIndicator | fireTypeIndicator () const |
| Returns the Fire Type Indicator from the PDU header. | |
| virtual void | setDetonationTypeIndicator (DtPduStatusDetonationTypeIndicator detonationTypeIndicator) |
| Set the Detonation Type Indicator in the PDU header. | |
| virtual DtPduStatusDetonationTypeIndicator | detonationTypeIndicator () const |
| Returns the Detonation Type Indicator from the PDU header. | |
| virtual void | setRadioAttachedIndicator (DtPduStatusRadioAttachedIndicator radioAttachedIndicator) |
| Set the Radio Attached Indicator in the PDU header. | |
| virtual DtPduStatusRadioAttachedIndicator | radioAttachedIndicator () const |
| Returns the Radio Attached Indicator from the PDU header. | |
| virtual void | setIntercomAttachedIndicator (DtPduStatusIntercomAttachedIndicator intercomAttachedIndicator) |
| Set the Intercom Attached Indicator in the PDU header. | |
| virtual DtPduStatusIntercomAttachedIndicator | intercomAttachedIndicator () const |
| Returns the Intercom Attached Indicator from the PDU header. | |
| virtual void | setIffSimulationMode (bool interactive) |
| Set the IFF Simulation Mode in the PDU header. | |
| virtual bool | iffSimulationMode () const |
| Returns the IFF Simulation Mode from the PDU header. | |
| virtual void | setActiveInterrogationIndicator (bool active) |
| Set the Active Interrogation Indicator in the PDU header. | |
| virtual bool | activeInterrogationIndicator () const |
| Returns the Active Interrogation Indicator from the 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 |
| virtual void | printPduInHexToStream (std::ostream &stream, unsigned int numberOfColumns) const |
| Prints the entire PDU's internal buffer to the stream in Hex. | |
| virtual void | encode () |
| Encode method. | |
| virtual void | decode (DtPduFactory *pduFactory) |
| Decode method. | |
| virtual bool | isTransientPdu () const |
| This method returns true if transient, false if state. | |
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. | |
| 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, bool skipSizeChanged=false) |
| Changes the size of the message. | |
| virtual void | insertBytes (int offset, int numBytes, bool skipSizeChanged=false) |
| Inserts numBytes zeroed-out bytes at the indicated offset into the net rep. | |
| virtual void | insertBytes (void *address, int numBytes, bool skipSizeChanged=false) |
| Inserts numBytes zeroed-out bytes at the indicated address. | |
| virtual void | deleteBytes (int offset, int numBytes, bool skipSizeChanged=false) |
| Deletes numBytes bytes at the indicated offset in the net rep. | |
| virtual void | deleteBytes (void *address, int numBytes, bool skipSizeChanged=false) |
| 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 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, DtPduFactory *pduFactory) |
| 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. | |
| virtual bool | isTEIApplicable () const |
| Returns whether a PDU Status is applicable to this PDU (based on PDU Type) These methods are only relevant in DIS 7 and greater. | |
| virtual bool | isLVCApplicable () const |
| virtual bool | isCEIApplicable () const |
| virtual bool | isFTIApplicable () const |
| virtual bool | isDTIApplicable () const |
| virtual bool | isRAIApplicable () const |
| virtual bool | isIAIApplicable () const |
| virtual bool | isISMApplicable () const |
| virtual bool | isAIIApplicable () const |
Protected Attributes | |
| DtPduEncoder * | myEncoder |
| DtPduDecoder * | myDecoder |
| 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.
|
virtual |
Returns the Active Interrogation Indicator from the PDU header.
|
protectedvirtual |
zeros out all bytes after the PDU header.
|
virtual |
Returns the Coupled Extension Indicator from the PDU Header False is Not Coupled True is Coupled.
|
virtual |
Decode method.
Reimplemented in DtPduWithAttributeRecordSets.
|
virtual |
Returns the Detonation Type Indicator from the PDU header.
|
virtual |
Encode method.
Reimplemented in DtPduWithAttributeRecordSets.
|
inlinevirtual |
References DtNetPduHeader::DtExercise, and netHeader().
|
virtual |
Returns the Fire Type Indicator from the PDU header.
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 |
Returns the IFF Simulation Mode from the PDU header.
|
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.
|
virtual |
Returns the Intercom Attached Indicator from the PDU header.
|
protectedpure virtual |
Returns the PDU kind associated with the derived PDU class.
Implemented in DtMinefieldDataPdu, DtAggregateStatePdu, DtResupplyReceivedPdu, DtIffAtcNavaidsPdu, DtLeDetonationPdu, DtEntityStatePdu, DtDIGuyCustomPdu, DtElectromagneticEmissionPdu, DtGriddedDataPdu, DtIsGroupOfPdu, DtDirectedEnergyFirePdu, DtEnvironmentalProcessPdu, DtLeFirePdu, DtLeAppearancePdu, DtMinefieldQueryPdu, DtIntercomControlPdu, DtTransmitterPdu, DtUnderwaterAcousticPdu, DtSignalPdu, DtLeTspiPdu, DtRelativeLocationPdu, DtArealObjectStatePdu, DtDetonationPdu, DtPointObjectStatePdu, DtMinefieldStatePdu, DtActionResponsePdu, DtResupplyOfferPdu, TestPdu, DtDesignatorPdu, DtCollisionElasticPdu, DtEntityStateUpdatePdu, DtFirePdu, DtIntercomSignalPdu, DtRepairCompletePdu, DtLinearObjectStatePdu, DtLeArticulatedPartsPdu, DtSuppEmisEntStatePdu, DtRecordQueryPdu, DtIsPartOfPdu, DtReceiverPdu, DtTransferControlRequestPdu, DtRecordPdu, DtDataQueryRPdu, DtAttributePdu, DtMinefieldResponseNackPdu, DtSetRecordPdu, DtStopFreezeRPdu, DtServiceRequestPdu, DtDataQueryPdu, DtStartResumePdu, DtAcknowledgePdu, DtStartResumeRPdu, DtStopFreezePdu, DtAcknowledgeRPdu, DtCreateEntityRPdu, DtEntityDamageStatusPdu, DtActionRequestRPdu, DtRemoveEntityRPdu, DtCollisionPdu, DtDataRPdu, DtSetDataRPdu, DtActionRequestPdu, DtActionResponseRPdu, DtRemoveEntityPdu, DtCreateEntityPdu, DtCommentRPdu, DtCommentPdu, DtEventReportPdu, DtEventReptRPdu, DtDataPdu, DtResupplyCancelPdu, DtRepairResponsePdu, DtSetDataPdu, and DtUnknownPdu.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Returns whether a PDU Status is applicable to this PDU (based on PDU Type) These methods are only relevant in DIS 7 and greater.
|
virtual |
This method returns true if transient, false if state.
This is based off the PDU kind parsed from the header
|
inlinevirtual |
Returns PDU kind from PDU header.
References netHeader().
|
protectedvirtual |
Maps PDU kind to ProtocolFamily.
|
virtual |
Returns the LVC Indicator from the PDU header.
|
inlinevirtual |
Returns a pointer to the PDU's header.
References DtBaseMsg::netRep().
Referenced by exerciseId(), kind(), pduLength(), pduStatus(), protocolFamily(), protocolVersion(), setExerciseId(), setPduLength(), setPduStatus(), 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().
|
inlinevirtual |
Return the length of the PDU, as indicated in the PDU header.
References DtNetPduHeader::DtLength, and netHeader().
|
inlinevirtual |
Returns the PDU Status from the PDU header.
References netHeader(), and DtNetPduHeader::pduStatus.
Referenced by setPduStatus().
|
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, DtIffAtcNavaidsPdu, DtElectromagneticEmissionPdu, DtEntityStatePdu, DtGriddedDataPdu, DtAggregateStatePdu, DtLeDetonationPdu, DtTransmitterPdu, DtDIGuyCustomPdu, DtDirectedEnergyFirePdu, DtIsGroupOfPdu, DtSignalPdu, DtMinefieldQueryPdu, DtIntercomControlPdu, DtLeFirePdu, DtArealObjectStatePdu, DtLeAppearancePdu, DtDetonationPdu, DtUnderwaterAcousticPdu, DtActionResponsePdu, DtDesignatorPdu, DtPointObjectStatePdu, DtResupplyOfferPdu, DtCollisionElasticPdu, DtLeTspiPdu, DtMinefieldStatePdu, DtEntityStateUpdatePdu, DtRepairCompletePdu, DtFirePdu, DtLinearObjectStatePdu, DtEnvironmentalProcessPdu, DtIntercomSignalPdu, DtSuppEmisEntStatePdu, DtLeArticulatedPartsPdu, DtRecordQueryPdu, DtIsPartOfPdu, DtReceiverPdu, TestPdu, DtServiceRequestPdu, DtTransferControlRequestPdu, DtDataQueryRPdu, DtRecordPdu, DtMinefieldResponseNackPdu, DtStopFreezeRPdu, DtCollisionPdu, DtEntityDamageStatusPdu, DtSetRecordPdu, DtStartResumePdu, DtDataQueryPdu, DtActionRequestPdu, DtAttributePdu, DtStartResumeRPdu, DtAcknowledgePdu, DtStopFreezePdu, DtCreateEntityPdu, DtAcknowledgeRPdu, DtActionRequestRPdu, DtCreateEntityRPdu, DtSetDataPdu, DtRelativeLocationPdu, DtRemoveEntityRPdu, DtDataRPdu, DtSetDataRPdu, DtActionResponseRPdu, DtRemoveEntityPdu, DtDataPdu, DtRepairResponsePdu, DtResupplyCancelPdu, DtSimanPdu, DtEventReportPdu, DtEventReptRPdu, and DtRecordSetPdu.
|
virtual |
Reimplemented in DtMinefieldDataPdu, DtPduWithData, DtResupplyReceivedPdu, DtIffAtcNavaidsPdu, DtElectromagneticEmissionPdu, DtEntityStatePdu, DtGriddedDataPdu, DtAggregateStatePdu, DtLeDetonationPdu, DtDIGuyCustomPdu, DtTransmitterPdu, DtDirectedEnergyFirePdu, DtIsGroupOfPdu, DtSignalPdu, DtMinefieldQueryPdu, DtIntercomControlPdu, DtLeFirePdu, DtArealObjectStatePdu, DtLeAppearancePdu, DtDetonationPdu, DtUnderwaterAcousticPdu, DtActionResponsePdu, DtDesignatorPdu, DtPointObjectStatePdu, DtCollisionElasticPdu, DtLeTspiPdu, DtResupplyOfferPdu, DtMinefieldStatePdu, DtEntityStateUpdatePdu, DtRepairCompletePdu, DtLinearObjectStatePdu, DtFirePdu, DtIntercomSignalPdu, DtEnvironmentalProcessPdu, DtSuppEmisEntStatePdu, DtLeArticulatedPartsPdu, DtRecordQueryPdu, DtIsPartOfPdu, DtReceiverPdu, DtDataQueryRPdu, DtServiceRequestPdu, DtTransferControlRequestPdu, DtRecordPdu, DtMinefieldResponseNackPdu, DtStopFreezeRPdu, DtStartResumePdu, DtCollisionPdu, DtDataQueryPdu, DtEntityDamageStatusPdu, DtSetRecordPdu, DtActionRequestPdu, DtStartResumeRPdu, DtAcknowledgePdu, DtAttributePdu, DtStopFreezePdu, DtCreateEntityPdu, DtAcknowledgeRPdu, DtActionRequestRPdu, DtCreateEntityRPdu, DtSetDataPdu, DtRelativeLocationPdu, DtRemoveEntityRPdu, DtDataRPdu, DtSetDataRPdu, DtActionResponseRPdu, DtRemoveEntityPdu, DtDataPdu, DtSimanPdu, DtEventReportPdu, DtRepairResponsePdu, DtResupplyCancelPdu, DtEventReptRPdu, DtRecordSetPdu, and DtUnknownPdu.
|
virtual |
Reimplemented in DtDirectedEnergyFirePdu, DtDetonationPdu, DtFirePdu, DtEntityDamageStatusPdu, and DtAttributePdu.
|
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 |
Prints the entire PDU's internal buffer to the stream in Hex.
|
virtual |
Print the contents of the PDU by calling printHeaderToStream and printDataToStream.
Reimplemented in DtPduWithAttributeRecordSets.
|
inlinevirtual |
Returns protocol family from PDU header.
References netHeader().
|
inlinevirtual |
References netHeader(), and DtNetPduHeader::version.
|
virtual |
Returns the Radio Attached Indicator from the PDU header.
|
virtual |
Set the Active Interrogation Indicator in the PDU header.
|
virtual |
Set the Coupled Extension Indicator in the PDU Header False is Not Coupled True is Coupled.
|
virtual |
Set the Detonation Type Indicator in the PDU header.
|
inlinevirtual |
Set/Get exerciseID in PDU header.
References DtNetPduHeader::DtExercise, and netHeader().
|
virtual |
Set the Fire Type Indicator in the PDU header.
|
virtual |
Set the IFF Simulation Mode in the PDU header.
|
virtual |
Set the Intercom Attached Indicator in the PDU header.
|
virtual |
Set the LVC Indicator in the PDU header.
|
inlinevirtual |
Set the PDU header's length.
This is in bytes Note this will differ from the value in length() when the the CouplingIndicator is true in DIS7
References DtNetPduHeader::DtLength, DtBaseMsg::length(), and netHeader().
|
inlinevirtual |
Set the PDU Status in the PDU header.
References netHeader(), DtNetPduHeader::pduStatus, and pduStatus().
|
virtual |
Set the Radio Attached Indicator in the PDU header.
|
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().
|
virtual |
Set the Transferred Entity Indicator in the PDU header False is No Difference True is Difference.
|
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().
|
virtual |
Returns the Transferred Entity Indicator from the PDU header False is No Difference True is Difference.
|
protected |
|
protected |
|
protected |
Referenced by setStatus(), and status().