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 | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
DtManagedInterface Class Reference

The DtManagedInterface Class is a singleton that is used to manage the message flow between C# and the rest of the system. More...

+ Collaboration diagram for DtManagedInterface:

Public Member Functions

void initializeManagedInterface (ManagedMessageDelegate del)
 initializes the DtManagedInterface class with a delegate from the C# application
void tick (double maxTime)
 ticks the DtManagedInterface class, and all child strategies as well as any of their resources
void shutdown ()
 Shutdown any simulation connections.
void receiveMessage (unsigned char *msg, int length)
 called when C# sends a message to ManagedInterface for processing
void sendMessage (DtMessage *msg)
 called to send C# a message generated from DtManagedInterface
bool handleMessage (DtMessage *msg)
 Message dispatch function.
virtual DtMessageFactorymessageFactory () const
 retuns the message factory
virtual bool hasResource (std::string name) const
 Resource handling functions.
virtual void * findResource (std::string name) const
 This will return a handle to a named resource or the Null handle if it does not exist.
virtual void setResource (std::string name, void *asset)
 This will set given object as a resource with the given name. If the resource already exists, this will replace it.
virtual bool removeResource (std::string name)
 This will remove a resource with the given name.
virtual void addHandler (std::string messageType, DtMessageDelegate *handler)
 Functions for adding or removing message handlers.
virtual void removeHandler (std::string messageType, DtMessageDelegate *handler)
virtual void addStrategy (DtLinkStrategy *strategy)
 Functions for adding, removing, and finding strategies.
virtual void removeStrategy (std::string name)
virtual DtLinkStrategyfindStrategy (std::string name)
virtual void addStrategyCreator (std::string name, StrategyCreator creator)
 add a strategy creator to the strategy factory.
virtual DtLinkStrategycreateStrategy (std::string name)
 this will create a strategy with the given name or NULL if the strategy does not exist
virtual double maxDrainInputTime ()
 get the maximum time to spend in drain input

Static Public Member Functions

static DtManagedInterfaceinstance ()
 static access class that will lazily create the one DtManagedInterface instance
static bool exists ()
 to check if the DtManagedInterface class is created
static void destroy ()
 destroys the DtManagedInterface class

Static Public Attributes

static std::string theDataPath

Protected Types

typedef std::map< std::string,
void * > 
ResourceMap
typedef ResourceMap::iterator ResourceIter
typedef std::multimap
< std::string,
DtMessageDelegate * > 
HandlerMap
typedef std::pair< std::string,
DtMessageDelegate * > 
HandlerPair
typedef std::map< std::string,
DtLinkStrategy * > 
StrategyMap
typedef std::pair< std::string,
DtLinkStrategy * > 
StrategyPair
typedef std::map< std::string,
StrategyCreator
StrategyCreatorMap

Protected Member Functions

virtual void handlePrintMessage (DtMessage *msg)
 Handle print messages at arrive from C#.
virtual void handleNotifyLevelMessage (DtMessage *msg)
 Handle notify level changes.
virtual void loadLibraries ()
 load any DLLs that are in the plugins directory

Protected Attributes

ManagedMessageDelegate myCSharpMessageDelegate
bool myIsInitalized
DtMessageFactorymyMessageFactory
ResourceMap myResources
HandlerMap myMessageHandlers
StrategyMap myLinkStrategies
StrategyCreatorMap myStrategyCreatorMap
DtMessageDelegatemyPrintHandler
DtMessageDelegatemyNotifyLevelHandler
DtFilePrintermyFilePrinter
double myMaxDrainInputTime

Static Protected Attributes

static DtManagedInterfacetheInstance

Private Member Functions

 DtManagedInterface ()
 private constructor since this is a singleton
virtual ~DtManagedInterface ()
 private destructor since this is a singleton

Detailed Description

The DtManagedInterface Class is a singleton that is used to manage the message flow between C# and the rest of the system.

Member Typedef Documentation

typedef std::multimap<std::string, DtMessageDelegate*> DtManagedInterface::HandlerMap
protected
typedef std::pair<std::string, DtMessageDelegate*> DtManagedInterface::HandlerPair
protected
typedef ResourceMap::iterator DtManagedInterface::ResourceIter
protected
typedef std::map<std::string, void*> DtManagedInterface::ResourceMap
protected
typedef std::map<std::string, StrategyCreator> DtManagedInterface::StrategyCreatorMap
protected
typedef std::map<std::string, DtLinkStrategy*> DtManagedInterface::StrategyMap
protected
typedef std::pair<std::string, DtLinkStrategy*> DtManagedInterface::StrategyPair
protected

Constructor & Destructor Documentation

DtManagedInterface::DtManagedInterface ( )
private

private constructor since this is a singleton

virtual DtManagedInterface::~DtManagedInterface ( )
privatevirtual

private destructor since this is a singleton

Member Function Documentation

virtual void DtManagedInterface::addHandler ( std::string  messageType,
DtMessageDelegate handler 
)
virtual

Functions for adding or removing message handlers.

virtual void DtManagedInterface::addStrategy ( DtLinkStrategy strategy)
virtual

Functions for adding, removing, and finding strategies.

virtual void DtManagedInterface::addStrategyCreator ( std::string  name,
StrategyCreator  creator 
)
virtual

add a strategy creator to the strategy factory.

This will replace an existing creator with the given one if used with the name of an existing strategy

virtual DtLinkStrategy* DtManagedInterface::createStrategy ( std::string  name)
virtual

this will create a strategy with the given name or NULL if the strategy does not exist

static void DtManagedInterface::destroy ( )
static

destroys the DtManagedInterface class

static bool DtManagedInterface::exists ( )
static

to check if the DtManagedInterface class is created

virtual void* DtManagedInterface::findResource ( std::string  name) const
virtual

This will return a handle to a named resource or the Null handle if it does not exist.

virtual DtLinkStrategy* DtManagedInterface::findStrategy ( std::string  name)
virtual
bool DtManagedInterface::handleMessage ( DtMessage msg)

Message dispatch function.

virtual void DtManagedInterface::handleNotifyLevelMessage ( DtMessage msg)
protectedvirtual

Handle notify level changes.

virtual void DtManagedInterface::handlePrintMessage ( DtMessage msg)
protectedvirtual

Handle print messages at arrive from C#.

virtual bool DtManagedInterface::hasResource ( std::string  name) const
virtual

Resource handling functions.

Resources are anything that can be saved and shared between different strategies this is used for managing VR-Link objects in an abstract way This will look up a resource by name and return if it exists or not

void DtManagedInterface::initializeManagedInterface ( ManagedMessageDelegate  del)

initializes the DtManagedInterface class with a delegate from the C# application

static DtManagedInterface& DtManagedInterface::instance ( )
static

static access class that will lazily create the one DtManagedInterface instance

virtual void DtManagedInterface::loadLibraries ( )
protectedvirtual

load any DLLs that are in the plugins directory

virtual double DtManagedInterface::maxDrainInputTime ( )
inlinevirtual

get the maximum time to spend in drain input

virtual DtMessageFactory& DtManagedInterface::messageFactory ( ) const
virtual

retuns the message factory

void DtManagedInterface::receiveMessage ( unsigned char *  msg,
int  length 
)

called when C# sends a message to ManagedInterface for processing

virtual void DtManagedInterface::removeHandler ( std::string  messageType,
DtMessageDelegate handler 
)
virtual
virtual bool DtManagedInterface::removeResource ( std::string  name)
virtual

This will remove a resource with the given name.

virtual void DtManagedInterface::removeStrategy ( std::string  name)
virtual
void DtManagedInterface::sendMessage ( DtMessage msg)

called to send C# a message generated from DtManagedInterface

virtual void DtManagedInterface::setResource ( std::string  name,
void *  asset 
)
virtual

This will set given object as a resource with the given name. If the resource already exists, this will replace it.

void DtManagedInterface::shutdown ( )

Shutdown any simulation connections.

void DtManagedInterface::tick ( double  maxTime)

ticks the DtManagedInterface class, and all child strategies as well as any of their resources

Member Data Documentation

ManagedMessageDelegate DtManagedInterface::myCSharpMessageDelegate
protected
DtFilePrinter* DtManagedInterface::myFilePrinter
protected
bool DtManagedInterface::myIsInitalized
protected
StrategyMap DtManagedInterface::myLinkStrategies
protected
double DtManagedInterface::myMaxDrainInputTime
protected
DtMessageFactory* DtManagedInterface::myMessageFactory
protected
HandlerMap DtManagedInterface::myMessageHandlers
protected
DtMessageDelegate* DtManagedInterface::myNotifyLevelHandler
protected
DtMessageDelegate* DtManagedInterface::myPrintHandler
protected
ResourceMap DtManagedInterface::myResources
protected
StrategyCreatorMap DtManagedInterface::myStrategyCreatorMap
protected
std::string DtManagedInterface::theDataPath
static
DtManagedInterface* DtManagedInterface::theInstance
staticprotected

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)