All MAK RTI plug-in libraries must export one or more of the following three "C" style functions.
The LRC or the rtiexec looks for these functions when a plug-in is loaded, and executes them at the appropriate times.
-
SetPluginCreators() is called immediately when a plug-in is loaded, before the DtRtiAmbassadorImplementor or any of the managers are created. This is the place to inform the LRC or the rtiexec that it should instantiate derived versions of these classes instead of the default versions. For details, please see Creating Custom RTI Managers, and Subclassing DtRtiAmbassadorImplementor. If you are not subclassing any of these classes, you do not need to include SetPluginCreators() in your plug-in.
-
InitLRCPlugin() is called by the LRC after the DtRtiAmbassadorImplementor, DtFederateManager, and DtConnectionMgr are created. The DtRtiAmbassadorImplementor is passed to InitLRCPlugin(). Through the implementor, you can register RTI service call observers or get pointers to all of the other managers.
-
InitRtiexecPlugin() is called by the rtiexec after the DtRtiexec is instantiated. A pointer to the DtRtiexec is passed to InitRtiexecPlugin(). Through this object, you can register callbacks on creation and destruction of federation executions and federates, and inspect other aspects of the rtiexec's state. For details, please see rtiexec Plug-ins.
- Note
- For MAK RTI 1516, use SetPluginCreators1516(), InitLRCPlugin1516(), and InitRtiexecPlugin1516(). For HLA Evolved, use SetPluginCreators1516e(), InitLRCPlugin1516e(), and InitRtiexecPlugin1516e().
You can use a single plug-in library for both the LRCs and the rtiexec. Each ignores the Init*() function that does not apply to it. Alternatively, you could create separate plug-ins for the rtiexec and for the LRCs. In this case, there is no reason to include InitRtiexecPlugin() in the LRC's plug-in, or InitLRCPlugin() in the rtiexec's plug-in. The following example shows the expected function prototype for each of the three functions, and the mechanics of exporting your functions:
#if WIN32
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
extern "C"
{
void EXPORT SetPluginCreators()
{
}
void EXPORT InitLRCPlugin(DtRtiAmbassadorImplementor* imp)
{
}
void EXPORT InitRtiexecPlugin(
DtRtiExec* exec)
{
}
}
[<< The RTI Managers] [Home] [Top of Page] [Monitoring RTI Service Invocations >>]