GemaCoreLib
The GeMA Core library
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
GmPluginObjectFactory Class Referenceabstract

Factory class exported by every plugin object. More...

#include <gmPluginObjectFactory.h>

Collaboration diagram for GmPluginObjectFactory:
Collaboration graph
[legend]

Public Member Functions

 GmPluginObjectFactory (QString loggerId)
 Constructor. More...
 
virtual ~GmPluginObjectFactory ()
 Destructor.
 
virtual GmPluginObjectinstance (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 QStringListversionInfo () 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 QStringListdepVersionInfo () 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 GmLogCategorylogger ()
 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GmPluginObjectFactory()

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.

Parameters
loggerIdSuffix used to form the name of the private logger used by the plugin. Logger name will be given by QString("plugin.%1").arg(loggerId)

Member Function Documentation

◆ instance()

virtual GmPluginObject* GmPluginObjectFactory::instance ( QString  category,
QString  objType,
GmSimulationData simulation,
QString  id,
QString  description 
)
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.

Returns
Returns the instanced object or NULL in case of failure.

◆ versionInfo()

virtual const QStringList& GmPluginObjectFactory::versionInfo ( ) const
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:

  • Plugin version
  • Plugin version date
  • Plugin revision number
  • Plugin revision date
  • Plugin global revision number
  • Plugin path id (the same used in depVersionInfo() to identify another plugin / library)

The documentation for this class was generated from the following files: