![]() |
GemaCoreLib
The GeMA Core library
|
Factory class exported by every plugin object. More...
#include <gmPluginObjectFactory.h>
Public Member Functions | |
GmPluginObjectFactory (QString loggerId) | |
Constructor. More... | |
virtual | ~GmPluginObjectFactory () |
Destructor. | |
virtual GmPluginObject * | instance (QString category, QString objType, GmSimulationData *simulation, QString id, QString description)=0 |
Instances a new object of the specified object type, returning it as a GmPluginObject. Users of the factory should cast the returned pointer to the appropriate derived class. More... | |
virtual const QStringList & | versionInfo () const =0 |
Virtual function responsible for returning the set of version information strings for the current plugin. This function should call the auto generated version function for the plugin. More... | |
virtual const QStringList & | depVersionInfo () const =0 |
Virtual function responsible for returning a set of pairs containing the names of the libraries that this plugin depends on and their expected revision numbers. The list is formated as a library path (equivalent to the ones found on the global versionList.lua configuration file) followed by the revsion number, followed by the next library and so on. This function should call the auto generated dependency version function for the plugin. | |
Protected Member Functions | |
const GmLogCategory & | logger () |
Returns a reference to the internal logger that should be used by every object instanciated by this factory to emmit messages. | |
Private Attributes | |
GmLogCategory | _logger |
Private logger used by every object instanced by this plugin to emmit messages. | |
Factory class exported by every plugin object.
Every GeMA plugin should export one factory, inheriting from GmPluginObjectFactory, that has the responsibility to instanciate objects of the types hadled by the plugin shared library.
GmPluginObjectFactory::GmPluginObjectFactory | ( | QString | loggerId | ) |
Constructor.
This constructor is beeing defined here on the .cpp and not in the .h to force the object to be exported. As the library does not make other references to the factory, if the constructor is in the .h, the fcatory is not exported in the dll.
loggerId | Suffix used to form the name of the private logger used by the plugin. Logger name will be given by QString("plugin.%1").arg(loggerId) |
|
pure virtual |
Instances a new object of the specified object type, returning it as a GmPluginObject. Users of the factory should cast the returned pointer to the appropriate derived class.
When implementing this function in a plugin, the GmPluginObject() constructor requires a logger object. To use the default logger associated with this plugin shared library, pass a call to logger() as the requested parameter.
If objType is not a recognized name, the factory MUST return NULL.
\params category The category of the object to be created. Will be one of the categories supported by the plugin as advertised by its Lua file. \params objType String identifying the type of the object that should be instanced. This string correponds to the value returned by GmPluginObject::pluginType(). \params simulation, id, description Standard parameters needed to construct a GmPluginObject. See the class constructor description for further details.
|
pure virtual |
Virtual function responsible for returning the set of version information strings for the current plugin. This function should call the auto generated version function for the plugin.
The list is composed of the following strings, in that order: