Toggle Menu Visibility











Plugin Modules

Plugins are loaded from .so modules - dynamically loadable shared libraries. Every such module should provide a single interface function - get_plugin_instance. Here is the prototype:

 

extern "C" {

   PluginInstance * get_plugin_instance();

}

 

The plugins are in fact classes implementing the PluginInstance interface. That's why the get_plugin_instance function returns a pointer to PluginInstance object, which is therefore interfaced through the PluginInstance methods and acting through polymorphism like the specific plugin object.

 

Here is what should a PluginInstance based class implement:

 

class PluginInstance {

virtual status_t Init(TestDispatcher * pDispather,

                      TestResultManager * pResultManager)=0;

virtual status_t Run()=0;

virtual status_t Stop()=0; 

}

 

Plugin Reentrancy

When writing plugins you should be aware of the fact, that different plugin instances may be run at the same time in multiple threads. That's why you should be careful when using some global to plugin data.

All TestDispatcher and TestResultManager methods are reentrant so, you should not concern putting them into critical sections.