|
Feel++ 0.91.0
|
Implements a generic object Factory. More...
#include <factory.hpp>
Public Types | |
Typedefs | |
| typedef IdentifierType | identifier_type |
| typedef AbstractProduct | product_type |
| typedef ProductCreator | creator_type |
|
typedef FactoryErrorPolicy < identifier_type, product_type > | super |
Public Member Functions | |
Methods | |
| bool | registerProduct (const identifier_type &id, creator_type creator) |
| bool | unregisterProduct (const identifier_type &id) |
| product_type * | createObject (const identifier_type &id) |
Implements a generic object Factory.
| product_type* Feel::Factory< AbstractProduct, IdentifierType, ProductCreator, FactoryErrorPolicy >::createObject | ( | const identifier_type & | id | ) | [inline] |
Create an object from a product registered in the Factory using identifier id
| id | identifier of the product to instantiate |
id | bool Feel::Factory< AbstractProduct, IdentifierType, ProductCreator, FactoryErrorPolicy >::registerProduct | ( | const identifier_type & | id, |
| creator_type | creator | ||
| ) | [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 |
| bool Feel::Factory< AbstractProduct, IdentifierType, ProductCreator, FactoryErrorPolicy >::unregisterProduct | ( | const identifier_type & | id | ) | [inline] |
Unregister a product
| id |
1.7.4