This template class takes 3 parameters :
More...
#include <TemplateFactory.h>
List of all members.
Public Types
Public Member Functions
Public Attributes
Detailed Description
template<class ObjectFactory, class ObjectType, class Context>
class tlp::TemplateFactory< ObjectFactory, ObjectType, Context >
This template class takes 3 parameters :
* The type of factory that it will list,
* The type of object said factories build,
* The type of object to pass as parameter to the objects when building them.
When constructed it registers itself into the factories map automatically.
Member Typedef Documentation
template<class ObjectFactory, class ObjectType, class Context>
Constructor & Destructor Documentation
template<class ObjectFactory, class ObjectType, class Context>
Member Function Documentation
template<class ObjectFactory, class ObjectType, class Context>
template<class ObjectFactory, class ObjectType, class Context>
Gets the list of plug-ins that registered themselves in this factory.
- Returns:
- :Iterator< std::string >* An iterator over the names of the plug-ins registered in this factory.
Implements tlp::TemplateFactoryInterface.
template<class ObjectFactory, class ObjectType, class Context>
Gets the dependencies of a plug-in.
- Parameters:
-
name | The name of the plug-in to retrieve the dependencies of. |
- Returns:
- :list< tlp::Dependency, std::allocator< tlp::Dependency > > The list of dependencies of the plug-in.
Implements tlp::TemplateFactoryInterface.
template<class ObjectFactory, class ObjectType, class Context>
ObjectType* tlp::TemplateFactory< ObjectFactory, ObjectType, Context >::getPluginObject |
( |
const std::string & |
name, |
|
|
Context |
p |
|
) |
| |
Constructs a plug-in.
- Parameters:
-
name | The name of the plug-in to instantiate. |
p | The context to give to the plug-in. |
- Returns:
- ObjectType* The newly constructed plug-in.
template<class ObjectFactory, class ObjectType, class Context>
Gets the whole parameters for the given plug-in.
- Parameters:
-
name | The name of the plug-in to retrieve the parameters of. |
- Returns:
- :PluginParameters The whole parameters of the plug-in.
Implements tlp::TemplateFactoryInterface.
template<class ObjectFactory, class ObjectType, class Context>
const std::string& tlp::TemplateFactory< ObjectFactory, ObjectType, Context >::getPluginRelease |
( |
std::string |
name | ) |
[virtual] |
Gets the release number of the given plug-in.
- Parameters:
-
name | The name of the plug-in to retrieve the version number of. |
- Returns:
- :string The version number, ussually formatted as X[.Y], where X is the major, and Y the minor.
Implements tlp::TemplateFactoryInterface.
template<class ObjectFactory, class ObjectType, class Context>
std::string tlp::TemplateFactory< ObjectFactory, ObjectType, Context >::getPluginsClassName |
( |
| ) |
[virtual] |
Gets the class name for the plug-in's registered class. If the class is in the tlp namespace, the 'tlp::' prefix is removed.
- Returns:
- :string The class name of the plug-in.
Implements tlp::TemplateFactoryInterface.
template<class ObjectFactory, class ObjectType, class Context>
bool tlp::TemplateFactory< ObjectFactory, ObjectType, Context >::pluginExists |
( |
const std::string & |
pluginName | ) |
[virtual] |
Checks if a given name is registered in this factory.
- Parameters:
-
pluginName | The name of the plug-in to look for. |
- Returns:
- bool Whether there is a plug-in with the given name registered in this factory.
Implements tlp::TemplateFactoryInterface.
template<class ObjectFactory, class ObjectType, class Context>
void tlp::TemplateFactory< ObjectFactory, ObjectType, Context >::registerPlugin |
( |
ObjectFactory * |
objectFactory | ) |
|
template<class ObjectFactory, class ObjectType, class Context>
void tlp::TemplateFactory< ObjectFactory, ObjectType, Context >::removePlugin |
( |
const std::string & |
name | ) |
[virtual] |
Removes a plug-in from this factory. This is usefull when a plug-in has unmet dependencies, or appears more than once.
- Parameters:
-
name | The name of the plug-in to remove. |
- Returns:
- void
Implements tlp::TemplateFactoryInterface.
Member Data Documentation
template<class ObjectFactory, class ObjectType, class Context>
Stores the dependencies of the registered plug-ins.
template<class ObjectFactory, class ObjectType, class Context>
template<class ObjectFactory, class ObjectType, class Context>
Stores the list of registered plug-ins.
template<class ObjectFactory, class ObjectType, class Context>
Stores the parameters of each registered plug-in.
template<class ObjectFactory, class ObjectType, class Context>
Stores the release version of the registered plug-ins.
|