VR-Link JAVA API Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
10.6 - ManagedInterface Concepts

Table of Contents

10.6.1 - Strategies

Strategies are the modular components within ManagedInterface; they process object state updates and interactions from VR-Link and create the messages to send to the C# application, and vice versa. There are several strategies included with VR-Link C#:

There are copies of each of these strategies for each of the protocols supported by VR-Link (DIS, HLA 1.3, HLA 1516, HLA 1516-Evolved). The initialization strategy is responsible for creating the other strategies when a network connection is requested. You can add new types of strategies or replace existing ones with updated behaviors through the use of plug-ins.

Strategies are given some CPU time every frame during a tick() function. During this function, any internal work may be done and is typically used to update any entity publishers that the strategy owns.

10.6.2 - Resources

During execution, certain data structures and classes need to be shared between different strategies. Typically shared resources are reflected objects, the simulation clock, and the initialization strategy. Sharing objects between strategies is done with a resource manager that is accessible from the ManagedInterface class. Resources are generic pointers to objects wrapped in Handles, which are discussed below. The resource manager does not manage the memory of stored objects throughout their lifetime, but does proved a generic means to find and access stored objects and data structures.

There are several default names used for commonly used objects that are defined in ManagedInterface/utility.h:

MANAGEDINTERFACE_DLL extern const char* EXERCISE_CONNECTION_NAME;
MANAGEDINTERFACE_DLL extern const char* CLOCK_NAME;
MANAGEDINTERFACE_DLL extern const char* REFLECTED_ENTITY_LIST_NAME;
MANAGEDINTERFACE_DLL extern const char* ENTITY_PUBLISHER_LIST_NAME;
\endcoe
These defined names provide a uniform way to access commonly used objects, such as the VR-Link DtExerciseConnection or the DtClock.
There are also several utility functions to access commonly used objects:
\code
MANAGEDINTERFACE_DLL DtExerciseConn* findExConnResource();
MANAGEDINTERFACE_DLL void setExConnResource(DtExerciseConn* conn);
MANAGEDINTERFACE_DLL DtReflectedEntity* findReflectedEntityResource(std::string id);
MANAGEDINTERFACE_DLL void setReflectedEntityResource(std::string id, DtReflectedEntity* ent);
MANAGEDINTERFACE_DLL DtEntityPublisher* findEntityPublisherResource(std::string id);
MANAGEDINTERFACE_DLL void setEntityPublisherResource(std::string id, DtEntityPublisher* pub);
MANAGEDINTERFACE_DLL DtClock* findClockResource();
MANAGEDINTERFACE_DLL void setClockResource(DtClock* clock);
MANAGEDINTERFACE_DLL DtReflectedEntityList* findReflectedEntityListResource();
MANAGEDINTERFACE_DLL void setReflectedEntityListResource(DtReflectedEntityList* rel);

10.6.3 - Delegates

Delegates are C++ classes that wrap a function to callback at a later time. These are used for message handlers that are registered with ManagedInterface. When a strategy wants notification that a message arrives from the C# application, it will create a delegate with one of the strategy's member functions and register that with the ManagedInterface message handlers.

[<< Initializing Connections] [Home] [Top of Page] [Messages >>]


Document ID: Generated on Thu Feb 22 04:26:36 EST 2018 from SVN revision 186468
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)