VR-Link API Documentation for HLA Evolved
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
TestSimpleInteraction Class Reference

Define the TestSimpleInteraction class. More...

+ Inheritance diagram for TestSimpleInteraction:
+ Collaboration diagram for TestSimpleInteraction:

List of all members.

Public Member Functions

 TestSimpleInteraction ()
 Blank Constructor - constructs a blank TestSimpleInteraction ready to be filled out and sent by application code.
virtual ~TestSimpleInteraction ()
 Destructor Not required by VR-Link, but should clearly be written if this class has any dynamic data that needs to be cleaned up.
 TestSimpleInteraction (const TestSimpleInteraction &orig)
 Copy constructor.
TestSimpleInteractionoperator= (const TestSimpleInteraction &orig)
 Assignment operator.
virtual const
RTI::ParameterHandleValuePairSet & 
phvps () const
 Virtual function override.
virtual void setFromPhvps (const RTI::ParameterHandleValuePairSet &pvSet)
 Virtual function override.
virtual const char * name () const
 Virtual function override.
virtual void printData () const
 Virtual function override.
virtual void setNumber (int num)
 
Inspector and mutator functions for the interaction class' data.
virtual int number () const
virtual void setVector (const DtVector &vec)
 Set/Get the parameter named "Vector".
virtual const DtVectorvector () const

Static Public Member Functions

static DtInteractioncreate ()
 Create and return a new TestSimpleInteraction.
static void addCallback (DtExerciseConn *conn, TestSimpleInteractionCb cb, void *usr)
 Wrappers around DtExerciseConn's add/removeCallback functions.
static void removeCallback (DtExerciseConn *conn, TestSimpleInteractionCb cb, void *usr)

Protected Member Functions

virtual char * interactionClassToUse (DtExerciseConn *exConn) const
 Virtual function override.

Protected Attributes

int myNum
 Here, we store the actual data values, in native representation.
DtVector myVec

Detailed Description

Define the TestSimpleInteraction class.

It will be 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

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

Required.

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

Copy constructor.

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


Member Function Documentation

static void TestSimpleInteraction::addCallback ( DtExerciseConn conn,
TestSimpleInteractionCb  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 TestSimpleInteraction class with VR-Link, letting VR-Link know to create one of these to represent the right FOM class.

Create and return a new TestSimpleInteraction.

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 char* TestSimpleInteraction::interactionClassToUse ( DtExerciseConn exConn) const [protected, virtual]

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* TestSimpleInteraction::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 TestSimpleInteraction::number ( ) const [virtual]
TestSimpleInteraction& TestSimpleInteraction::operator= ( const TestSimpleInteraction orig)

Assignment operator.

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

virtual const RTI::ParameterHandleValuePairSet& TestSimpleInteraction::phvps ( ) const [virtual]

Virtual function override.

This is the function that does the bulk of the class' work on the sending side. It uses this class' inspectors to obtain current data values, converts them to the representation dictated by the FOM, and fills out a PHVPS - the RTI's representation of interaction data. This function is called by DtExerciseConn::send() in order to obtain the data to pass to the RTI's sendInteraction. Required, unless your interaction class is derived from DtInteractionWithEncDec, which provides a definition for you.

Implements DtInteraction.

virtual void TestSimpleInteraction::printData ( ) 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 TestSimpleInteraction::removeCallback ( DtExerciseConn conn,
TestSimpleInteractionCb  cb,
void *  usr 
) [static]
virtual void TestSimpleInteraction::setFromPhvps ( const RTI::ParameterHandleValuePairSet &  pvSet) [virtual]

Virtual function override.

This is the function that does the bulk of the class' work on the receiving side. It pulls the data out of the RTI's representation of an interaction, converts it to the representation expected by this class', and passes it to this class' mutator functions. It is called by VR-Link from within drainInput when an interaction of the right class is received. Required, unless your interaction class is derived from DtInteractionWithEncDec, which provides a definition for you.

Implements DtInteraction.

virtual void TestSimpleInteraction::setNumber ( int  num) [virtual]


Inspector and mutator functions for the interaction class' data.

These will look different for each DtInteraction subclass. None are required by VR-Link, but the class will not be particularly useful without a way to get data in and out in a typesafe manner.


Set/Get the parameter named "Number"

virtual void TestSimpleInteraction::setVector ( const DtVector vec) [virtual]

Set/Get the parameter named "Vector".

virtual const DtVector& TestSimpleInteraction::vector ( ) const [virtual]

Member Data Documentation

Here, we store the actual data values, in native representation.


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)