VR-Link API Documentation for DIS
Public Member Functions | Protected Member Functions | Protected Attributes
DtRecordSetPdu Class Reference

DtRecordSetPdu is an abstract base class used by PDUs which require the record set functionality. More...

+ Inheritance diagram for DtRecordSetPdu:
+ Collaboration diagram for DtRecordSetPdu:

List of all members.

Public Member Functions

virtual ~DtRecordSetPdu ()
 destructor
DtRecordSetPduoperator= (const DtRecordSetPdu &orig)
 Assignment operator.
virtual bool setNumRecordSets (DtU32 numSets)
 Set/Get the number of record sets.
virtual DtU32 numRecordSets () const
virtual bool setRecordSet (int index, const DtRecordSet &recSet)
 Set/Get a record set.
virtual bool getRecordSet (int index, DtRecordSet &recSet) const
virtual void printData () const
 Print the data contained by this PDU.
virtual void printDataToStream (std::ostream &stream) const
 Print the data to a stream.

Protected Member Functions

 DtRecordSetPdu ()
 Constructors (protected because this is an abstract base class).
 DtRecordSetPdu (const DtRecordSetPdu &orig)
bool validateRecordSets (DtNetRecordSetPdu &netStruct)
 This function checks the data records for consistency between the actual size of the PDU and the size suggested by the PDU.
virtual DtNetRecordSetPdunetRecordSetPduStruct () const =0
 Returns a pointer to the beginning of the record set data struct.
virtual char * var () const
 Returns a pointer to the first byte of variable length data.
virtual int netRecordSetLength () const
 Returns the length of data used by the record sets beginning at the location specified by netRecordSetPduStruct().
virtual int recordSetOffset (int recordSetIndex) const
 Returns a buffer offset to the given record set.
DtRecordSetPduself () const
 Casts the 'this' pointer for changing elements in a const function.

Protected Attributes

int mySaveRecCount
 These are used by recordSetOffset() to save the value and index of the last offset which was computed in case it can be used again.
int mySaveBuffCount

Detailed Description

DtRecordSetPdu is an abstract base class used by PDUs which require the record set functionality.


Constructor & Destructor Documentation

virtual DtRecordSetPdu::~DtRecordSetPdu ( ) [virtual]

destructor

Constructors (protected because this is an abstract base class).

DtRecordSetPdu::DtRecordSetPdu ( const DtRecordSetPdu orig) [protected]

Member Function Documentation

virtual bool DtRecordSetPdu::getRecordSet ( int  index,
DtRecordSet recSet 
) const [virtual]
virtual int DtRecordSetPdu::netRecordSetLength ( ) const [protected, virtual]

Returns the length of data used by the record sets beginning at the location specified by netRecordSetPduStruct().

This can be used by the derived class if any data follows the record set data.

virtual DtNetRecordSetPdu* DtRecordSetPdu::netRecordSetPduStruct ( ) const [protected, pure virtual]

Returns a pointer to the beginning of the record set data struct.

This must be implemented by the derived class because the location of the record sets within the PDU can vary.

Implemented in DtTransferControlRequestPdu, DtRecordPdu, and DtSetRecordPdu.

virtual DtU32 DtRecordSetPdu::numRecordSets ( ) const [virtual]
DtRecordSetPdu& DtRecordSetPdu::operator= ( const DtRecordSetPdu orig)

Assignment operator.

virtual void DtRecordSetPdu::printData ( ) const [virtual]

Print the data contained by this PDU.

Reimplemented from DtPdu.

Reimplemented in DtTransferControlRequestPdu, DtRecordPdu, and DtSetRecordPdu.

virtual void DtRecordSetPdu::printDataToStream ( std::ostream &  stream) const [virtual]

Print the data to a stream.

Reimplemented from DtPdu.

Reimplemented in DtTransferControlRequestPdu, DtRecordPdu, and DtSetRecordPdu.

virtual int DtRecordSetPdu::recordSetOffset ( int  recordSetIndex) const [protected, virtual]

Returns a buffer offset to the given record set.

DtRecordSetPdu* DtRecordSetPdu::self ( ) const [protected]

Casts the 'this' pointer for changing elements in a const function.

Non virtual, since you can't override based on return type.

Reimplemented in DtTransferControlRequestPdu, DtRecordPdu, and DtSetRecordPdu.

virtual bool DtRecordSetPdu::setNumRecordSets ( DtU32  numSets) [virtual]

Set/Get the number of record sets.

virtual bool DtRecordSetPdu::setRecordSet ( int  index,
const DtRecordSet recSet 
) [virtual]

Set/Get a record set.

If the index is out of bounds, then false is returned. If the space would exceed the maximum space permitted for a PDU (for a set) then false may be returned.

bool DtRecordSetPdu::validateRecordSets ( DtNetRecordSetPdu netStruct) [protected]

This function checks the data records for consistency between the actual size of the PDU and the size suggested by the PDU.

It also tries to fix any problems that are detected. This function is intended to be called in the PDU constructor that accepts network data immediately following initpdu. Non-virtual, since meant to be called from ctor.

virtual char* DtRecordSetPdu::var ( ) const [protected, virtual]

Returns a pointer to the first byte of variable length data.


Member Data Documentation

These are used by recordSetOffset() to save the value and index of the last offset which was computed in case it can be used again.


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

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)