![]() |
VR-Link API Documentation for HLA 1516
|
Define the TestSimpleInteraction class. More...
Inheritance diagram for TestSimpleInteraction:
Collaboration diagram for TestSimpleInteraction: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. | |
| TestSimpleInteraction & | operator= (const TestSimpleInteraction &orig) |
| Assignment operator. | |
| virtual const RTI::ParameterHandleValueMap & | phvm () const |
| Virtual function override. | |
| virtual void | setFromPhvm (const RTI::ParameterHandleValueMap &pvMap) |
| 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 DtVector & | vector () const |
Public Member Functions inherited from DtInteraction | |
| DtInteraction () | |
| default constructor | |
| virtual | ~DtInteraction () |
| destructor | |
| DtInteraction (const DtInteraction &orig) | |
| copy constructor | |
| DtInteraction & | operator= (const DtInteraction &orig) |
| assignment operator | |
| virtual void | setExConn (DtExerciseConn *exConn, DtInterClassDesc *classDesc=0) |
| Sets the interaction's ExerciseConn and class descriptor. | |
| virtual RTI::InteractionClassHandle | interactionClassHandle () const |
| Get the interaction class handle. Returns 0 if no classDesc. | |
| virtual char * | interactionClassName () const |
| Get the interaction class name. Returns NULL if no classDesc. | |
| virtual int | numParameters () const |
| Get the number of parameters. Returns 0 if no classDesc. | |
| virtual bool | neededByFederation () const |
| Returns true if the interaction class is needed by the federation false otherwise. | |
| virtual void | print () const |
| Print the interaction's host rep data, including header. | |
| virtual void | printToStream (std::ostream &stream) const |
| Print the interaction to a stream. | |
| virtual void | printHeader () const |
| Print the header info. | |
| virtual void | printHeaderToStream (std::ostream &stream) const |
| Print the header info to a stream. | |
| virtual void | printDataToString (DtString &buff) const |
| Print the interaction's data to the string provided. | |
| virtual void | printDataToStream (std::ostream &stream) const |
| Print the interaction's data to the stream. | |
| virtual void | printParams (bool withHex) const |
| Print the header followed by the interaction's parameters. | |
| virtual void | printParamsToStream (std::ostream &stream, bool withHex) const |
| Print the header followed by the interaction's parameters to a stream. | |
| virtual DtExerciseConn * | exerciseConn () const |
| Get the current exercise connection. | |
| virtual DtInterClassDesc * | classDesc () const |
| Get the current class descriptor we're using for this interaction. | |
| virtual bool | customTagSet () const |
| Get whether a custom tag has been set on the interaction or not. | |
| virtual void | setCustomTag (const RTI::VariableLengthData &a_tag) |
| Set the user-defined tag. | |
| virtual void | setTag (const RTI::VariableLengthData &tag) |
| Set the user-defined tag. | |
| virtual const RTI::VariableLengthData & | tag () const |
| Get the user-defined tag. | |
| virtual const RTI::RegionHandleSet * | conveyedRegion () const |
| Get & Set the conveyed region of the reflected state message. | |
| virtual void | setConveyedRegion (const RTI::RegionHandleSet *sentRegionHandleSet) |
| virtual void | setTimeStamp (DtTime time, DtTimeStampType type=DtTimeStampRelative) |
| Set the time of validity of the message, and whether this represents relative or absolute time. | |
| virtual DtTime | timeStamp () const |
| Return the time of validity of the message (in seconds past an hour) as set by setTimeStamp. | |
| virtual DtTimeStampType | timeStampType () const |
| Return the type of the time stamp. | |
| 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 void | setFedTime (const RTI::LogicalTime &ft) |
| This is used for TSO interactions. | |
| virtual const RTI::LogicalTime * | fedTime () const |
| When the interaction is received, if the federate sending the interaction had TSO set then the fedTime will be set. | |
| virtual void | setMessageRetractionHandle (const RTI::MessageRetractionHandle &handle) |
| Get/Set the MessageRetractionHandle. | |
| virtual RTI::MessageRetractionHandle | messageRetractionHandle () const |
| Get the message retraction handle. For more info see setMessageRetractionHandle. | |
Static Public Member Functions | |
| static DtInteraction * | create () |
| 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) |
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. | |
| static bool | tagIsAsciiTime () |
| static void | addCallback (DtExerciseConn *conn, const DtList *classes, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP()) |
| Register/Deregister callback function cb with conn, on all interaction class name (char*) contained in classes. | |
| static void | removeCallback (DtExerciseConn *conn, const DtList *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. | |
| static void | removeCallback (DtExerciseConn *conn, const char *className, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP()) |
Protected Member Functions | |
| virtual char * | interactionClassToUse (DtExerciseConn *exConn) const |
| Virtual function override. | |
Protected Member Functions inherited from DtInteraction | |
| virtual RTI::ParameterHandleValueMap & | privPvList () const |
| Returns a pointer to a private pvList that can be used as a return value by phvps. | |
| DtInteraction * | self () 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). | |
Protected Attributes | |
| int | myNum |
| Here, we store the actual data values, in native representation. | |
| DtVector | myVec |
Protected Attributes inherited from DtInteraction | |
| DtInterClassDesc * | myClassDesc |
| DtExerciseConn * | myExConn |
| DtTime | myTime |
| DtTimeStampType | myTimeType |
| RTI::LogicalTime * | myFedTime |
| RTI::ParameterHandleValueMap | myPvList |
| RTI::MessageRetractionHandle | myRetractionHandle |
| RTI::VariableLengthData | myTag |
| const RTI::RegionHandleSet * | myConveyedRegion |
| bool | myCustomTagSet |
Additional Inherited Members | |
Static Protected Attributes inherited from DtInteraction | |
| static bool | theTagIsAsciiTime |
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).
| TestSimpleInteraction::TestSimpleInteraction | ( | ) |
Blank Constructor - constructs a blank TestSimpleInteraction ready to be filled out and sent by application code.
Required.
|
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.
| TestSimpleInteraction::TestSimpleInteraction | ( | const TestSimpleInteraction & | orig | ) |
Copy constructor.
Not required by VR-Link, but needed if you will ever want to copy TestInteractions.
|
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.
|
static |
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.
|
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 |
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 |
| TestSimpleInteraction& TestSimpleInteraction::operator= | ( | const TestSimpleInteraction & | orig | ) |
Assignment operator.
Not required by VR-Link, but needed if you will ever want to copy TestInteractions.
|
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 |
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 |
|
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 |
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.
|
virtual |
Set/Get the parameter named "Vector".
|
virtual |
|
protected |
Here, we store the actual data values, in native representation.
|
protected |