cisst-saw
|
Macro for generating plugin wrappers (factory methods). More...
Go to the source code of this file.
Macros | |
#define | _cmnPlugin_h |
#define | CMN_PLUGIN_WRAPPERS(base, derived) |
Macro for generating plugin wrappers (factory methods).
This macro should be used if the base class is NOT derived from cmnGenericObject. In this case, the macro creates the factory methods and associated data to ensure safe creation of instances of the derived class. If this macro is used, the shared library should be loaded using the osaDynamicLoaderAndFactory class. Note that this factory verifies the base class type and its version (to ensure that the shared library was compiled with the same version of the base class as the executable).
If the base class is (or is derived from) cmnGenericObject, then this macro should not be used. Instead, it is better to use osaDynamicLoader to load the shared library and to use the class services (cmnClassRegister) to create instances of the derived class.
#define _cmnPlugin_h |
#define CMN_PLUGIN_WRAPPERS | ( | base, | |
derived | |||
) |
This macro creates the functions and data necessary to allow the derived class to be dynamically loaded (as a "plugin") into a running application, using the osaDynamicLoaderAndFactory class. The only requirement on the base class is that it define a public VERSION enum that specifies its "interface version."
base | Base class that defines the interface (usually abstract) |
derived | Derived class implemented in the plugin module |