VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
TestInteraction Class Reference

The TestInteraction class is used to represent interactions of the FOM class "Test". More...

+ Inheritance diagram for TestInteraction:
+ Collaboration diagram for TestInteraction:

Public Member Functions

 TestInteraction ()
 Blank Constructor - constructs a blank TestInteraction ready to be filled out and sent by application code. More...
 
virtual ~TestInteraction ()
 Destructor Not required by VR-Link, but should clearly be written if this class has any dynamic data that needs to be cleaned up. More...
 
 TestInteraction (const TestInteraction &orig)
 Copy constructor. More...
 
TestInteractionoperator= (const TestInteraction &orig)
 Assignment operator. More...
 
virtual const char * name () const
 Virtual function override. More...
 
virtual void printDataToStream (std::ostream &stream) const
 Virtual function override. More...
 
virtual void setNumber (int num)
 Set/Get the parameter named "Number". More...
 
virtual int number () const
 
virtual void setVector (const DtVector &vec)
 Set/Get the parameter named "Vector". More...
 
virtual const DtVectorvector () const
 
- Public Member Functions inherited from DtInteractionWithEncDec
 DtInteractionWithEncDec ()
 default constructor More...
 
virtual ~DtInteractionWithEncDec ()
 destructor More...
 
 DtInteractionWithEncDec (const DtInteractionWithEncDec &orig)
 copy constructor More...
 
DtInteractionWithEncDecoperator= (const DtInteractionWithEncDec &orig)
 assignment operator More...
 
virtual void setExConn (DtExerciseConn *exConn, DtInterClassDesc *classDesc=NULL)
 Sets the interaction's ExerciseConn and class descriptor. More...
 
virtual const
RTI::ParameterHandleValuePairSet & 
phvps () const
 Get the parameter handle value pair set for the interaction. More...
 
virtual void setFromPhvps (const RTI::ParameterHandleValuePairSet &pvList)
 Set contents from a parameter handle value pair set. More...
 
virtual void useThese (DtInteractionEncoder *enc, DtInteractionDecoder *dec, DtInteractionRep *data)
 Specify an encoder, decoder, and interaction data repository to use in encoding and decoding. More...
 
virtual DtInteractionEncoderencoder () const
 Return the encoder we are using. More...
 
virtual DtInteractionDecoderdecoder () const
 Return the decoder we are using. More...
 
virtual void setParameterByHandle (const RTI::ParameterHandle &attrHdl, const char *attrValue, unsigned size)
 Set the Parameter with the given handle. More...
 
virtual const char * getParameterByHandle (const RTI::ParameterHandle &attrHdl, unsigned &size) const
 Get a pointer to Parameter value for the Parameter with the given handle. More...
 
virtual void setParameterByName (const DtString &name, const char *attrValue, unsigned size)
 Set the Parameter with the given name. More...
 
virtual const char * getParameterByName (const DtString &name, unsigned &size) const
 Get a pointer to Parameter value for the Parameter with the given name. More...
 
- Public Member Functions inherited from DtInteraction
 DtInteraction ()
 default constructor More...
 
virtual ~DtInteraction ()
 destructor More...
 
 DtInteraction (const DtInteraction &orig)
 copy constructor More...
 
DtInteractionoperator= (const DtInteraction &orig)
 assignment operator More...
 
virtual RTI::InteractionClassHandle interactionClassHandle () const
 Get the interaction class handle. Returns 0 if no classDesc. More...
 
virtual char * interactionClassName () const
 Get the interaction class name. Returns NULL if no classDesc. More...
 
virtual int numParameters () const
 Get the number of parameters. Returns 0 if no classDesc. More...
 
virtual bool neededByFederation () const
 Returns true if the interaction class is needed by the federation false otherwise. More...
 
virtual void print () const
 Print the interaction's host rep data, including header. More...
 
virtual void printToStream (std::ostream &stream) const
 Print the interaction to a stream. More...
 
virtual void printHeader () const
 Print the header info. More...
 
virtual void printHeaderToStream (std::ostream &stream) const
 Print the header info to a stream. More...
 
virtual void printData () const
 Print the interaction's data to DtInfo. More...
 
virtual void printDataToString (DtString &buff) const
 Print the interaction's data to the string provided. More...
 
virtual void printParams (bool withHex) const
 Print the header followed by the interaction's parameters. More...
 
virtual void printParamsToStream (std::ostream &stream, bool withHex) const
 Print the header followed by the interaction's parameters to a stream. More...
 
virtual DtExerciseConnexerciseConn () const
 Get the current exercise connection. More...
 
virtual DtInterClassDescclassDesc () const
 Get the current class descriptor we're using for this interaction. More...
 
virtual bool customTagSet () const
 Get whether a custom tag has been set on the interaction or not. More...
 
virtual void setCustomTag (const DtString &a_tag)
 Set the user-defined tag. More...
 
virtual void setTag (const DtString &tag)
 Set the user-defined tag. More...
 
virtual const DtStringtag () const
 Get the user-defined tag. More...
 
virtual const RTI::Region * conveyedRegion () const
 Get & Set the conveyed region of the reflected state message. More...
 
virtual void setConveyedRegion (const RTI::Region *region)
 
virtual void setTimeStamp (DtTime time, DtTimeStampType type=DtTimeStampRelative)
 Set the time of validity of the message, and whether this represents relative or absolute time. More...
 
virtual DtTime timeStamp () const
 Return the time of validity of the message (in seconds past an hour) as set by setTimeStamp. More...
 
virtual DtTimeStampType timeStampType () const
 Return the type of the time stamp. More...
 
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. More...
 
virtual void setFedTime (const RTI::FedTime &ft)
 This is used for TSO interactions. More...
 
virtual const RTI::FedTime * fedTime () const
 When the interaction is received, if the federate sending the interaction had TSO set then the fedTime will be set. More...
 
virtual void setEventRetractionHandle (const RTI::EventRetractionHandle &handle)
 Get/Set the EventRetractionHandle. More...
 
virtual RTI::EventRetractionHandle eventRetractionHandle () const
 Get the event retraction handle. For more info see setEventRetractionHandle. More...
 

Static Public Member Functions

static DtInteractioncreate ()
 Create and return a new TestInteraction. More...
 
static void addCallback (DtExerciseConn *conn, TestInteractionCb cb, void *usr)
 Wrappers around DtExerciseConn's add/removeCallback functions. More...
 
static void removeCallback (DtExerciseConn *conn, TestInteractionCb cb, void *usr)
 
- Static Public Member Functions inherited from DtInteraction
static void setTagIsAsciiTime (bool val)
 Set/Get flag that tells us whether we're using the RPR FOM convention that the UserDefinedTag in updates and interactions represents a DIS-style timestamp. More...
 
static bool tagIsAsciiTime ()
 
static void addCallback (DtExerciseConn *conn, const std::vector< DtString > *classes, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
 Register/Deregister callback function cb with conn, on all interaction class name (char*) contained in classes. More...
 
static void removeCallback (DtExerciseConn *conn, const std::vector< DtString > *classes, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
 
static void addCallback (DtExerciseConn *conn, const char *className, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
 Can be used instead of above for a single class. More...
 
static void removeCallback (DtExerciseConn *conn, const char *className, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
 

Protected Member Functions

virtual const char * interactionClassToUse (DtExerciseConn *exConn) const
 Virtual function override. More...
 
virtual DtInteractionDecodercreateDecoder (DtExerciseConn *exConn) const
 Virtual function override. More...
 
virtual DtInteractionEncodercreateEncoder (DtExerciseConn *exConn) const
 Virtual function override. More...
 
- Protected Member Functions inherited from DtInteractionWithEncDec
virtual DtInteractionDecoderdecoderToUse (DtExerciseConn *exConn) const
 Returns a decoder to use for decoding the interaction. More...
 
virtual DtInteractionEncoderencoderToUse (DtExerciseConn *exConn) const
 Returns an encoder to use for encoding the interaction. More...
 
- Protected Member Functions inherited from DtInteraction
virtual
RTI::ParameterHandleValuePairSet * 
privPvList () const
 Returns a pointer to a private pvList that can be used as a return value by phvps. More...
 
DtInteractionself () const
 Get rid of const-ness on the "this" pointer in order to access non-const functions from const member functions (such as simple accessors). More...
 

Protected Attributes

int myNum
 
DtVector myVec
 
- Protected Attributes inherited from DtInteractionWithEncDec
DtInteractionDecodermyDecoder
 
DtInteractionEncodermyEncoder
 
DtInteractionRep * myData
 
std::map< RTI::ParameterHandle,
DtGenericParameterInfo * > 
myParametersByHandle
 parameters by handle. More...
 
- Protected Attributes inherited from DtInteraction
DtInterClassDescmyClassDesc
 
DtExerciseConnmyExConn
 
DtTime myTime
 
DtTimeStampType myTimeType
 
DtString myTag
 
RTI::ParameterHandleValuePairSet * myPvList
 
int myPvListMaxSize
 
RTI::FedTime * myFedTime
 
RTI::EventRetractionHandle myRetractionHandle
 
const RTI::Region * myConveyedRegion
 
bool myCustomTagSet
 

Additional Inherited Members

- Static Protected Attributes inherited from DtInteraction
static bool theTagIsAsciiTime
 

Detailed Description

The TestInteraction class is used to represent interactions of the FOM class "Test".

It has two parameters: "Number", which is represented by a 32-bit integer, and "Vector", which is represented by an array of three 64-bit floating point numbers (doubles).

Constructor & Destructor Documentation

TestInteraction::TestInteraction ( )

Blank Constructor - constructs a blank TestInteraction ready to be filled out and sent by application code.

Required.

virtual TestInteraction::~TestInteraction ( )
virtual

Destructor Not required by VR-Link, but should clearly be written if this class has any dynamic data that needs to be cleaned up.

TestInteraction::TestInteraction ( const TestInteraction orig)

Copy constructor.

Not required by VR-Link, but needed if you will ever want to copy TestInteractions.

Member Function Documentation

static void TestInteraction::addCallback ( DtExerciseConn conn,
TestInteractionCb  cb,
void *  usr 
)
static

Wrappers around DtExerciseConn's add/removeCallback functions.

Not required since the DtExerciseConn functions may be used instead, but strongly encouraged, so that the non-typesafe cast can be limited to this one place. In addition, within add-callback, we choose to register the TestInteraction class with VR-Link, letting VR-Link know to create one of these to represent the right FOM class.

static DtInteraction* TestInteraction::create ( )
static

Create and return a new TestInteraction.

Basically a wrapper around the constructor. It is necessary because pointers to static functions like this can be registered with a DtInteractionFactory, but constructors can not. Required.

virtual DtInteractionDecoder* TestInteraction::createDecoder ( DtExerciseConn exConn) const
protectedvirtual

Virtual function override.

Creates and returns a decoder to be used by setFromPhvps to decode a ParameterHandleValuePairSet into this interaction. Implementing this function is required, unless you would like to rely on the default behavior - which is to obtain a new instance of the right decoder from the FOM Mapper. If you choose this option, you must configure the FOM Mapper so that it can correctly provide this object.

Reimplemented from DtInteractionWithEncDec.

virtual DtInteractionEncoder* TestInteraction::createEncoder ( DtExerciseConn exConn) const
protectedvirtual

Virtual function override.

Creates and returns an encoder to be used by phvps to encode the data in this interaction into a ParameterHandleValuePairSet. Implementing this function is required, unless you would like to rely on the default behavior - which is to obtain a new instance of the right encoder from the FOM Mapper. If you choose this option, you must configure the FOM Mapper so that it can correctly provide this object.

Reimplemented from DtInteractionWithEncDec.

virtual const char* TestInteraction::interactionClassToUse ( DtExerciseConn exConn) const
protectedvirtual

Virtual function override.

Returns the name of the FOM class to use to represent this interaction when sending. It is called from within setExConn, when that function is called by DtExerciseConn::send. Implementing this function is required unless you would like to rely on the default behavior - which is to obtain the class to use from the FOM Mapper. If you choose this option, you must configure the FomMapper so that it can correctly provide this information.

Reimplemented from DtInteraction.

virtual const char* TestInteraction::name ( ) const
virtual

Virtual function override.

Should return the name of this C++ class, which is not necessarily the Interaction Class name from the FOM. Required.

Implements DtInteraction.

virtual int TestInteraction::number ( ) const
virtual
TestInteraction& TestInteraction::operator= ( const TestInteraction orig)

Assignment operator.

Not required by VR-Link, but needed if you will ever want to copy TestInteractions.

virtual void TestInteraction::printDataToStream ( std::ostream &  stream) const
virtual

Virtual function override.

Prints the data values in the interaction. Not strictly required, but encouraged, since otherwise calling print() on an instance of this class with merely print raw hex data.

Reimplemented from DtInteraction.

static void TestInteraction::removeCallback ( DtExerciseConn conn,
TestInteractionCb  cb,
void *  usr 
)
static
virtual void TestInteraction::setNumber ( int  num)
virtual

Set/Get the parameter named "Number".

virtual void TestInteraction::setVector ( const DtVector vec)
virtual

Set/Get the parameter named "Vector".

virtual const DtVector& TestInteraction::vector ( ) const
virtual

Member Data Documentation

int TestInteraction::myNum
protected
DtVector TestInteraction::myVec
protected

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

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)