Claw
1.7.3
|
The design pattern of the factory allow to dynamically instanciate classes of various types given an identifier of this type. More...
#include <factory.hpp>
Public Member Functions | |
~factory () | |
Destructor. | |
template<typename T > | |
bool | register_type (const identifier_type &id) |
Register a type in the factory. | |
base_class * | create (const identifier_type &id) const |
Create a new instance. | |
bool | is_known_type (const identifier_type &id) const |
Tell in a type with a given id is known by the factory. |
The design pattern of the factory allow to dynamically instanciate classes of various types given an identifier of this type.
Template parameters:
Type requirements:
Definition at line 77 of file factory.hpp.
claw::pattern::factory< BaseClass, IdentifierType >::base_class * claw::pattern::factory< BaseClass, IdentifierType >::create | ( | const identifier_type & | id | ) | const |
Create a new instance.
id | The identifier of the type to instanciate. |
Definition at line 110 of file factory.tpp.
bool claw::pattern::factory< BaseClass, IdentifierType >::is_known_type | ( | const identifier_type & | id | ) | const |
Tell in a type with a given id is known by the factory.
id | The identifier of the type to check. |
Definition at line 127 of file factory.tpp.
bool claw::pattern::factory< BaseClass, IdentifierType >::register_type | ( | const identifier_type & | id | ) |
Register a type in the factory.
id | The identifier to which the type is associated. |
Template parameters:
Definition at line 88 of file factory.tpp.