VR-Link API Documentation for HLA Evolved
 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 More...
 
void initializeManagedInterface (JavaManagedMessageDelegate del, void *data, unsigned char *reusableSendMsgBuffer)
 initializes the DtManagedInterface class with a delegate from the Java application More...
 
void tick (double maxTime)
 ticks the DtManagedInterface class, and all child strategies as well as any of their resources More...
 
void shutdown ()
 Shutdown any simulation connections. More...
 
void receiveMessage (unsigned char *msg, int length)
 called when C# sends a message to ManagedInterface for processing More...
 
void sendMessage (DtMessage *msg)
 called to send C# a message generated from DtManagedInterface More...
 
bool handleMessage (DtMessage *msg)
 Message dispatch function. More...
 
virtual DtMessageFactorymessageFactory () const
 returns the message factory More...
 
virtual bool hasResource (const std::string &name) const
 Resource handling functions. More...
 
virtual void * findResource (const std::string &name) const
 This will return a handle to a named resource or the Null handle if it does not exist. More...
 
virtual void setResource (const 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. More...
 
virtual bool removeResource (const std::string &name)
 This will remove a resource with the given name. More...
 
virtual void addHandler (const std::string &messageType, DtMessageDelegate *handler)
 Functions for adding or removing message handlers. More...
 
virtual void removeHandler (const std::string &messageType, DtMessageDelegate *handler)
 
virtual void addStrategy (DtLinkStrategy *strategy)
 Functions for adding, removing, and finding strategies. More...
 
virtual void removeStrategy (const std::string &name)
 
virtual DtLinkStrategyfindStrategy (const std::string &name)
 
virtual void addStrategyCreator (const std::string &name, StrategyCreator creator)
 add a strategy creator to the strategy factory. More...
 
virtual DtLinkStrategycreateStrategy (const std::string &name)
 this will create a strategy with the given name or NULL if the strategy does not exist More...
 
virtual double maxDrainInputTime ()
 get the maximum time to spend in drain input More...
 
virtual std::set< DtProtocolTypeavailableProtocols ()
 get available protocols More...
 
virtual DtProtocolType activeProtocol ()
 Get/Set the active protocol. More...
 
virtual void setActiveProtocol (DtProtocolType protocol)
 Get/Set the active protocol. More...
 

Static Public Member Functions

static DtManagedInterfaceinstance ()
 static access class that will lazily create the one DtManagedInterface instance More...
 
static bool exists ()
 to check if the DtManagedInterface class is created More...
 
static void destroy ()
 destroys the DtManagedInterface class More...
 
static bool checkVrlLicense ()
 Checks the VR-Link License Availability. More...
 

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#. More...
 
virtual void handleNotifyLevelMessage (DtMessage *msg)
 Handle notify level changes. More...
 
virtual void prefixPath (const std::string &prefixDir) const
 modify system environment PATH variable before loading libraries More...
 
virtual void restorePath () const
 return system environment PATH variable to original state More...
 
virtual std::set< std::string > getPathDirs () const
 return all directories in the PATH environment variable More...
 
virtual void loadLibsFromDir (const std::string &dirname, const std::set< std::string > &files, std::list< std::string > &filesLoaded)
 load library plugins by names from directory dirname More...
 
virtual std::set< std::string > findLibNames (const std::string &dirname, const std::string &filePrefix) const
 get library names in directory dirname More...
 
virtual bool loadLibrary (const std::string &filename, const DtString &acceptableVersionStr)
 load one DLL by name More...
 
virtual bool loadCoreLibraries (const std::string &dirname, std::list< std::string > &filesLoaded)
 load any DLLs with names beginning with managedInterface* from directory dirname. More...
 
virtual void findAndLoadCoreLibraries (std::list< std::string > &filesLoaded)
 Search algorithm to find core libraries, then load them. More...
 
virtual void loadLibraries ()
 load any DLLs that are in the plugins directory More...
 
virtual bool checkLibrariesLoaded (const std::list< std::string > &filesLoaded, std::set< DtProtocolType > &availableProtocol, bool shouldThrow=false)
 check that the minimum strategy libraries were loaded More...
 

Protected Attributes

DtProtocolType myActiveProtocol
 
ManagedMessageDelegate myCSharpMessageDelegate
 
JavaManagedMessageDelegate myJavaMessageDelegate
 
void * myData
 
unsigned char * myReusableSendBuffer
 
bool myIsInitalized
 
std::set< DtProtocolTypemyInitializedProtocols
 
DtMessageFactorymyMessageFactory
 
ResourceMap myResources
 
HandlerMap myMessageHandlers
 
StrategyMap myLinkStrategies
 
StrategyCreatorMap myStrategyCreatorMap
 
DtMessageDelegatemyPrintHandler
 
DtMessageDelegatemyNotifyLevelHandler
 
DtFilePrintermyFilePrinter
 
std::set< std::string > myFilesLoaded
 
std::set< std::string > myPluginsLoaded
 
double myMaxDrainInputTime
 

Static Protected Attributes

static DtManagedInterfacetheInstance
 
static std::string restorePathStr
 

Private Member Functions

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

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 DtProtocolType DtManagedInterface::activeProtocol ( )
virtual

Get/Set the active protocol.

virtual void DtManagedInterface::addHandler ( const 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 ( const 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 std::set<DtProtocolType> DtManagedInterface::availableProtocols ( )
virtual

get available protocols

virtual bool DtManagedInterface::checkLibrariesLoaded ( const std::list< std::string > &  filesLoaded,
std::set< DtProtocolType > &  availableProtocol,
bool  shouldThrow = false 
)
protectedvirtual

check that the minimum strategy libraries were loaded

static bool DtManagedInterface::checkVrlLicense ( )
static

Checks the VR-Link License Availability.

virtual DtLinkStrategy* DtManagedInterface::createStrategy ( const 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::findAndLoadCoreLibraries ( std::list< std::string > &  filesLoaded)
protectedvirtual

Search algorithm to find core libraries, then load them.

virtual std::set<std::string> DtManagedInterface::findLibNames ( const std::string &  dirname,
const std::string &  filePrefix 
) const
protectedvirtual

get library names in directory dirname

virtual void* DtManagedInterface::findResource ( const 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 ( const std::string &  name)
virtual
virtual std::set<std::string> DtManagedInterface::getPathDirs ( ) const
protectedvirtual

return all directories in the PATH environment variable

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 ( const 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

void DtManagedInterface::initializeManagedInterface ( JavaManagedMessageDelegate  del,
void *  data,
unsigned char *  reusableSendMsgBuffer 
)

initializes the DtManagedInterface class with a delegate from the Java application

static DtManagedInterface& DtManagedInterface::instance ( )
static

static access class that will lazily create the one DtManagedInterface instance

virtual bool DtManagedInterface::loadCoreLibraries ( const std::string &  dirname,
std::list< std::string > &  filesLoaded 
)
protectedvirtual

load any DLLs with names beginning with managedInterface* from directory dirname.

virtual void DtManagedInterface::loadLibraries ( )
protectedvirtual

load any DLLs that are in the plugins directory

virtual bool DtManagedInterface::loadLibrary ( const std::string &  filename,
const DtString acceptableVersionStr 
)
protectedvirtual

load one DLL by name

virtual void DtManagedInterface::loadLibsFromDir ( const std::string &  dirname,
const std::set< std::string > &  files,
std::list< std::string > &  filesLoaded 
)
protectedvirtual

load library plugins by names from directory dirname

virtual double DtManagedInterface::maxDrainInputTime ( )
inlinevirtual

get the maximum time to spend in drain input

virtual DtMessageFactory& DtManagedInterface::messageFactory ( ) const
virtual

returns the message factory

virtual void DtManagedInterface::prefixPath ( const std::string &  prefixDir) const
protectedvirtual

modify system environment PATH variable before loading libraries

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

called when C# sends a message to ManagedInterface for processing

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

This will remove a resource with the given name.

virtual void DtManagedInterface::removeStrategy ( const std::string &  name)
virtual
virtual void DtManagedInterface::restorePath ( ) const
protectedvirtual

return system environment PATH variable to original state

void DtManagedInterface::sendMessage ( DtMessage msg)

called to send C# a message generated from DtManagedInterface

virtual void DtManagedInterface::setActiveProtocol ( DtProtocolType  protocol)
virtual

Get/Set the active protocol.

virtual void DtManagedInterface::setResource ( const 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

DtProtocolType DtManagedInterface::myActiveProtocol
protected
ManagedMessageDelegate DtManagedInterface::myCSharpMessageDelegate
protected
void* DtManagedInterface::myData
protected
DtFilePrinter* DtManagedInterface::myFilePrinter
protected
std::set<std::string> DtManagedInterface::myFilesLoaded
protected
std::set<DtProtocolType> DtManagedInterface::myInitializedProtocols
protected
bool DtManagedInterface::myIsInitalized
protected
JavaManagedMessageDelegate DtManagedInterface::myJavaMessageDelegate
protected
StrategyMap DtManagedInterface::myLinkStrategies
protected
double DtManagedInterface::myMaxDrainInputTime
protected
DtMessageFactory* DtManagedInterface::myMessageFactory
protected
HandlerMap DtManagedInterface::myMessageHandlers
protected
DtMessageDelegate* DtManagedInterface::myNotifyLevelHandler
protected
std::set<std::string> DtManagedInterface::myPluginsLoaded
protected
DtMessageDelegate* DtManagedInterface::myPrintHandler
protected
ResourceMap DtManagedInterface::myResources
protected
unsigned char* DtManagedInterface::myReusableSendBuffer
protected
StrategyCreatorMap DtManagedInterface::myStrategyCreatorMap
protected
std::string DtManagedInterface::restorePathStr
staticprotected
std::string DtManagedInterface::theDataPath
static
DtManagedInterface* DtManagedInterface::theInstance
staticprotected

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)