![]() |
LifeV
|
#include <Factory.hpp>
Inheritance diagram for Factory< AbstractProduct, IdentifierType, ProductCreator, FactoryErrorPolicy >:
Collaboration diagram for Factory< AbstractProduct, IdentifierType, ProductCreator, FactoryErrorPolicy >:Private Attributes | |
| productId_Type | M_associations |
Public Typedefs | |
| typedef IdentifierType | identifier_Type |
| typedef AbstractProduct | product_Type |
| typedef ProductCreator | creator_Type |
| typedef FactoryErrorPolicy< product_Type > | super |
Constructor and destructor | |
| Factory () | |
| virtual | ~Factory () |
Methods | |
| bool | registerProduct (const identifier_Type &id, creator_Type creator) |
| Register a product. More... | |
| bool | unregisterProduct (const identifier_Type &id) |
| Unregister a product. More... | |
| product_Type * | createObject (const identifier_Type &id) |
Create an object from a product registered in the factory using identifier id. More... | |
| template<typename map_Type > | |
| product_Type * | createObject (const identifier_Type &id, const map_Type &map) |
Create an object from a product registered in the factory using identifier id (of type enum) and a map to catch the exception. More... | |
Private typedefs | |
| typedef std::map< identifier_Type, creator_Type > | productId_Type |
Definition at line 112 of file Factory.hpp.
| typedef IdentifierType identifier_Type |
Definition at line 118 of file Factory.hpp.
| typedef AbstractProduct product_Type |
Definition at line 119 of file Factory.hpp.
| typedef ProductCreator creator_Type |
Definition at line 120 of file Factory.hpp.
| typedef FactoryErrorPolicy<product_Type> super |
Definition at line 121 of file Factory.hpp.
|
private |
Definition at line 231 of file Factory.hpp.
|
inline |
Definition at line 129 of file Factory.hpp.
|
inlinevirtual |
Definition at line 131 of file Factory.hpp.
|
inline |
Register a product.
A product is composed of an identifier (typically a std::string) and a functor that will create the associated object.
| id | identifier for the object to be registered |
| creator | the functor that will create the registered object |
Definition at line 152 of file Factory.hpp.
|
inline |
Unregister a product.
| id |
Definition at line 167 of file Factory.hpp.
|
inline |
Create an object from a product registered in the factory using identifier id.
| id | identifier of the product to instantiate |
id Definition at line 183 of file Factory.hpp.
|
inline |
Create an object from a product registered in the factory using identifier id (of type enum) and a map to catch the exception.
| id | identifier of the product to instantiate |
id Definition at line 208 of file Factory.hpp.
|
private |
Definition at line 235 of file Factory.hpp.