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

Instances of DtFomMapper are used to provide FOM agility in VR-Link by mapping VR-Link classes and functionality to FOM classes, attributes and parameters. More...

+ Inheritance diagram for DtFomMapper:
+ Collaboration diagram for DtFomMapper:

Public Types

typedef char *(* DtInteractionClassChooser )(DtExerciseConn *exConn, const DtInteraction &inter)
 A function that chooses an interaction class from the FOM based on the contents of a derived DtInteraction object.
typedef char *(* DtObjectClassChooser )(const char *vrlinkClassName, DtExerciseConn *conn, void *usr)
 A function that chooses an object class from the FOM based based on the name of a C++ class derived from DtObjectPublisher, and arbitrary user data (e.g.

Public Member Functions

 DtFomMapper ()
 Default constructor.
virtual ~DtFomMapper ()
 destructor
virtual DtStateDecoderFactorysetStateDecoderFactory (DtStateDecoderFactory *fact)
 Set/Get the current factory that can be used to create DtHlaStateDecoders.
virtual DtStateDecoderFactorystateDecoderFactory ()
virtual DtStateEncoderFactorysetStateEncoderFactory (DtStateEncoderFactory *fact)
 Set/Get the current factory that can be used to create DtHlaStateEncoders.
virtual DtStateEncoderFactorystateEncoderFactory ()
virtual
DtInteractionDecoderFactory
setInteractionDecoderFactory (DtInteractionDecoderFactory *fact)
 Set/Get the current factory that can be used to create DtInteractionDecoders.
virtual
DtInteractionDecoderFactory
interactionDecoderFactory ()
virtual
DtInteractionEncoderFactory
setInteractionEncoderFactory (DtInteractionEncoderFactory *fact)
 Set/Get the current factory that can be used to create DtInteractionEncoders.
virtual
DtInteractionEncoderFactory
interactionEncoderFactory ()
virtual DtHlaObjectFactorysetHlaObjectFactory (DtHlaObjectFactory *fact)
 Set/Get the current factory that can be used to create DtHlaObjects.
virtual DtHlaObjectFactoryhlaObjectFactory ()
virtual DtInteractionFactorysetInteractionFactory (DtInteractionFactory *fact)
 Set/Get the current factory that can be used to create DtInteractions.
virtual DtInteractionFactoryinteractionFactory ()
virtual void setObjectClassToChoose (const char *vrlinkClassName, const char *fomClassName)
 Tell the FOM Mapper how to choose a FOM object class to use for objects being published by a particular kind of object publisher.
virtual void setObjectClassChooser (const char *vrlinkClassName, DtObjectClassChooser chooser)
virtual char * chooseObjectClass (const char *vrlinkClassName, void *usr=NULL) const
 Chooses an object class to represent an object managed by the C++ class named vrlinkClassName (which should be a class derived from DtObjectPublisher).
virtual void setInteractionClassToChoose (const char *vrlinkClassName, const char *fomClassName)
 Tell the FOM Mapper how to choose a FOM interaction class to use for a particular kind of derived DtInteraction.
virtual void setInteractionClassChooser (const char *vrlinkClassName, DtInteractionClassChooser chooser)
virtual char * chooseInteractionClass (const DtInteraction &inter) const
 Chooses a FOM interaction class to be by a particular derived DtInteraction class named vrlinkClassName.
virtual void setInteractionClasses (const char *vrlinkClassName, const DtList &classes)
 Set/Get a list of names (char*) of FOM classes that can be decoded into the derived DtInteraction class whose name is name.
virtual DtListinteractionClasses (const char *vrlinkClassName)
virtual void setInteractionClass (const char *vrlinkClassName, const char *fomClassName)
 When there is only a single FOM class to be associated with a VR-Link interaction class, then there is no need to create a DtList.
virtual void setObjectClassNames (const char *vrlinkClassName, const DtList &classes)
 Set/Get a list of names (char*) of FOM object classes that should be subscribed to by a particular subclass of VR-Link's DtReflectedObjectList.
virtual DtListobjectClassNames (const char *vrlinkClassName)
virtual DtListobjectClassHandles (const char *vrlinkClassName)
 Similar to objectClassNames, but returns a DtList of ObjectClassHandles instead.
virtual void setObjectClass (const char *vrlinkClassName, const char *fomClassName)
 When there is only a single FOM class to be associated with a VR-Link DtReflectedObjectList class, then there is no need to create a DtList.
virtual void init (DtExerciseConn *conn)=0
 Initialize the instance, once an exercise connection is available.
virtual void setVersion (double vers)
 Returns the version number of the FOM, as passed to setVersion.
virtual double version () const
virtual void setRevision (int val)
 Sets the revision number of the FOM.
virtual int revision () const
 Returns the revision number of the FOM.
virtual DtObjectClassChooser objectClassChooser (const char *vrlinkClassName) const
 Return the FOM-class-chooser function, if any, that has been associated with the name of a C++ class derived from DtObjectPublisher using setObjectClassChooser.
virtual DtInteractionClassChooser interactionClassChooser (const char *vrlinkClassName) const
 Return the FOM-class-chooser function, if any, that has been associated with the name of a C++ class derived from DtInteraction using setInteractionClassChooser.

Protected Member Functions

 DtFomMapper (const DtFomMapper &orig)
 copy constructor - not implemented.
DtFomMapperoperator= (const DtFomMapper &orig)
 assignment operator - not implemented.

Protected Attributes

DtExerciseConnmyExConn
DtStateDecoderFactorymyDecFact
 Current factories and other objects.
DtStateEncoderFactorymyEncFact
DtInteractionDecoderFactorymyInterDecFact
DtInteractionEncoderFactorymyInterEncFact
DtHlaObjectFactorymyObjFact
DtInteractionFactorymyInterFact
DtHashlist myIntMapList
 Hash list that maps names of C++ classes derived from DtInteraction to lists of names of FOM classes.
DtHashlist myObjMapList
 Hash list that maps names of C++ classes derived from DtReflectedObjectList to lists of names of FOM classes.
DtHashlist myObjChooserList
 Hash list that maps names of C++ classes derived from DtObjectPublisher to DtObjectClassChoosers - functions that can choose an object class name from the FOM to use for the object.
DtHashlist mySimpleObjChooserList
 Hash list that maps names of C++ classes derived from DtObjectPublisher to single FOM object class names.
DtHashlist myInterChooserList
 Hash list that maps names of C++ classes derived from DtInteraction to DtInteractionClassChoosers - functions that can choose an interaction class name from the FOM to use for the interaction.
DtHashlist mySimpleInterChooserList
 Hash list that maps names of C++ classes derived from DtInteraction to single FOM object class names.
DtList myObjHandleList
 The object returned by objectClassHandles.
DtList myEmptyList
 Just an empty list to return when no class list has been registered for a particular VR-Link class.
double myVersion
int myRevision

Detailed Description

Instances of DtFomMapper are used to provide FOM agility in VR-Link by mapping VR-Link classes and functionality to FOM classes, attributes and parameters.

DtFomMapper is an abstract class. Most FOM Mappers (including DtRprFomMapper) are derived from DtEmptyFomMapper, and not directly from DtFomMapper.

Member Typedef Documentation

typedef char*(* DtFomMapper::DtInteractionClassChooser)(DtExerciseConn *exConn, const DtInteraction &inter)

A function that chooses an interaction class from the FOM based on the contents of a derived DtInteraction object.

typedef char*(* DtFomMapper::DtObjectClassChooser)(const char *vrlinkClassName, DtExerciseConn *conn, void *usr)

A function that chooses an object class from the FOM based based on the name of a C++ class derived from DtObjectPublisher, and arbitrary user data (e.g.

entity type).

Constructor & Destructor Documentation

DtFomMapper::DtFomMapper ( )

Default constructor.

Typically, most initialization takes place within init(), which is called by DtExerciseConn's constructor.

virtual DtFomMapper::~DtFomMapper ( )
virtual

destructor

DtFomMapper::DtFomMapper ( const DtFomMapper orig)
protected

copy constructor - not implemented.

Member Function Documentation

virtual char* DtFomMapper::chooseInteractionClass ( const DtInteraction inter) const
virtual

Chooses a FOM interaction class to be by a particular derived DtInteraction class named vrlinkClassName.

virtual char* DtFomMapper::chooseObjectClass ( const char *  vrlinkClassName,
void *  usr = NULL 
) const
virtual

Chooses an object class to represent an object managed by the C++ class named vrlinkClassName (which should be a class derived from DtObjectPublisher).

usr is additional user data that may be required to make the choice. It is passed as usr to a chooser function that has been registered with the FOM Mapper for this publisher type, if any.

virtual DtHlaObjectFactory* DtFomMapper::hlaObjectFactory ( )
virtual
virtual void DtFomMapper::init ( DtExerciseConn conn)
pure virtual

Initialize the instance, once an exercise connection is available.

Must be overridden in subclasses.

Implemented in DtRprFomMapper, MyFomMapper, and DtEmptyFomMapper.

virtual DtInteractionClassChooser DtFomMapper::interactionClassChooser ( const char *  vrlinkClassName) const
virtual

Return the FOM-class-chooser function, if any, that has been associated with the name of a C++ class derived from DtInteraction using setInteractionClassChooser.

virtual DtList* DtFomMapper::interactionClasses ( const char *  vrlinkClassName)
virtual
virtual DtInteractionDecoderFactory* DtFomMapper::interactionDecoderFactory ( )
virtual
virtual DtInteractionEncoderFactory* DtFomMapper::interactionEncoderFactory ( )
virtual
virtual DtInteractionFactory* DtFomMapper::interactionFactory ( )
virtual
virtual DtObjectClassChooser DtFomMapper::objectClassChooser ( const char *  vrlinkClassName) const
virtual

Return the FOM-class-chooser function, if any, that has been associated with the name of a C++ class derived from DtObjectPublisher using setObjectClassChooser.

virtual DtList* DtFomMapper::objectClassHandles ( const char *  vrlinkClassName)
virtual

Similar to objectClassNames, but returns a DtList of ObjectClassHandles instead.

The returned list is owned by the DtFomMapper, and should not be deleted. In addition, it is only valid until the next call to this function. If using HLA 1.3 the ObjectClassHandles are returned cast as void * in the list If using HLA 1516 the list contains pointers to a valid RTI::ObjectClassHandle

virtual DtList* DtFomMapper::objectClassNames ( const char *  vrlinkClassName)
virtual
DtFomMapper& DtFomMapper::operator= ( const DtFomMapper orig)
protected

assignment operator - not implemented.

virtual int DtFomMapper::revision ( ) const
virtual

Returns the revision number of the FOM.

virtual DtHlaObjectFactory* DtFomMapper::setHlaObjectFactory ( DtHlaObjectFactory fact)
virtual

Set/Get the current factory that can be used to create DtHlaObjects.

virtual void DtFomMapper::setInteractionClass ( const char *  vrlinkClassName,
const char *  fomClassName 
)
virtual

When there is only a single FOM class to be associated with a VR-Link interaction class, then there is no need to create a DtList.

Just use this:

virtual void DtFomMapper::setInteractionClassChooser ( const char *  vrlinkClassName,
DtInteractionClassChooser  chooser 
)
virtual
virtual void DtFomMapper::setInteractionClasses ( const char *  vrlinkClassName,
const DtList classes 
)
virtual

Set/Get a list of names (char*) of FOM classes that can be decoded into the derived DtInteraction class whose name is name.

These classes will be subscribed to, when you use a derived DtInteraction's addCallback function. The DtFomMapper copies the data in the list passed to setInteractionClasses, so the object can be deleted at the caller's leisure. The list returned by interactionClasses is owned by the DtFomMapper and shouldn't be deleted by the caller.

virtual void DtFomMapper::setInteractionClassToChoose ( const char *  vrlinkClassName,
const char *  fomClassName 
)
virtual

Tell the FOM Mapper how to choose a FOM interaction class to use for a particular kind of derived DtInteraction.

You can either associate a single FOM class name, or a FOM class choosing function with the name of a C++ class derived from DtInteraction.

virtual DtInteractionDecoderFactory* DtFomMapper::setInteractionDecoderFactory ( DtInteractionDecoderFactory fact)
virtual

Set/Get the current factory that can be used to create DtInteractionDecoders.

virtual DtInteractionEncoderFactory* DtFomMapper::setInteractionEncoderFactory ( DtInteractionEncoderFactory fact)
virtual

Set/Get the current factory that can be used to create DtInteractionEncoders.

virtual DtInteractionFactory* DtFomMapper::setInteractionFactory ( DtInteractionFactory fact)
virtual

Set/Get the current factory that can be used to create DtInteractions.

virtual void DtFomMapper::setObjectClass ( const char *  vrlinkClassName,
const char *  fomClassName 
)
virtual

When there is only a single FOM class to be associated with a VR-Link DtReflectedObjectList class, then there is no need to create a DtList.

Just use this:

virtual void DtFomMapper::setObjectClassChooser ( const char *  vrlinkClassName,
DtObjectClassChooser  chooser 
)
virtual
virtual void DtFomMapper::setObjectClassNames ( const char *  vrlinkClassName,
const DtList classes 
)
virtual

Set/Get a list of names (char*) of FOM object classes that should be subscribed to by a particular subclass of VR-Link's DtReflectedObjectList.

vrlinkClassName is the name of the DtReflectedObjectList subclass for which you are creating a mapping. The DtFomMapper copies the data in the list passed to setObjectClassNames, so the object can be deleted at the caller's leisure. The list returned by objectClassNames is owned by the DtFomMapper and shouldn't be deleted by the caller.

virtual void DtFomMapper::setObjectClassToChoose ( const char *  vrlinkClassName,
const char *  fomClassName 
)
virtual

Tell the FOM Mapper how to choose a FOM object class to use for objects being published by a particular kind of object publisher.

You can either associate a single FOM class name, or a FOM class choosing function with the name of a C++ class derived from DtObjectPublisher.

virtual void DtFomMapper::setRevision ( int  val)
virtual

Sets the revision number of the FOM.

virtual DtStateDecoderFactory* DtFomMapper::setStateDecoderFactory ( DtStateDecoderFactory fact)
virtual

Set/Get the current factory that can be used to create DtHlaStateDecoders.

virtual DtStateEncoderFactory* DtFomMapper::setStateEncoderFactory ( DtStateEncoderFactory fact)
virtual

Set/Get the current factory that can be used to create DtHlaStateEncoders.

virtual void DtFomMapper::setVersion ( double  vers)
virtual

Returns the version number of the FOM, as passed to setVersion.

virtual DtStateDecoderFactory* DtFomMapper::stateDecoderFactory ( )
virtual
virtual DtStateEncoderFactory* DtFomMapper::stateEncoderFactory ( )
virtual
virtual double DtFomMapper::version ( ) const
virtual

Member Data Documentation

DtStateDecoderFactory* DtFomMapper::myDecFact
protected

Current factories and other objects.

DtList DtFomMapper::myEmptyList
protected

Just an empty list to return when no class list has been registered for a particular VR-Link class.

DtStateEncoderFactory* DtFomMapper::myEncFact
protected
DtExerciseConn* DtFomMapper::myExConn
protected
DtHashlist DtFomMapper::myInterChooserList
protected

Hash list that maps names of C++ classes derived from DtInteraction to DtInteractionClassChoosers - functions that can choose an interaction class name from the FOM to use for the interaction.

DtInteractionDecoderFactory* DtFomMapper::myInterDecFact
protected
DtInteractionEncoderFactory* DtFomMapper::myInterEncFact
protected
DtInteractionFactory* DtFomMapper::myInterFact
protected
DtHashlist DtFomMapper::myIntMapList
protected

Hash list that maps names of C++ classes derived from DtInteraction to lists of names of FOM classes.

Hash keys are DtStringHashKeys. Data are DtLists of char*'s that indicate FOM class names.

DtHashlist DtFomMapper::myObjChooserList
protected

Hash list that maps names of C++ classes derived from DtObjectPublisher to DtObjectClassChoosers - functions that can choose an object class name from the FOM to use for the object.

DtHlaObjectFactory* DtFomMapper::myObjFact
protected
DtList DtFomMapper::myObjHandleList
protected

The object returned by objectClassHandles.

It is reused and overwritten each call.

DtHashlist DtFomMapper::myObjMapList
protected

Hash list that maps names of C++ classes derived from DtReflectedObjectList to lists of names of FOM classes.

Hash keys are DtStringHashKeys. Data are DtLists of char*s that indicate FOM class names.

int DtFomMapper::myRevision
protected
DtHashlist DtFomMapper::mySimpleInterChooserList
protected

Hash list that maps names of C++ classes derived from DtInteraction to single FOM object class names.

DtHashlist DtFomMapper::mySimpleObjChooserList
protected

Hash list that maps names of C++ classes derived from DtObjectPublisher to single FOM object class names.

double DtFomMapper::myVersion
protected

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

Document ID: Generated on Wed Jan 7 13:31:29 EST 2015 from SVN revision 149162
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)