Factory template class. More...
#include <Factory.h>
Classes | |
class | FactoryEntry |
FactoryEntry class. More... | |
Public Types | |
typedef std::map< Identifier, FactoryEntry > | FactoryMap |
typedef FactoryMap::iterator | FactoryMapIt |
enum | ReturnCode { FACTORY_OK, FACTORY_ERROR, ALREADY_EXISTS, NOT_FOUND, INVALID_ARG, UNKNOWN_ERROR } |
Public Member Functions | |
ReturnCode | addFactory (const Identifier &id, Creator creator, Destructor destructor) |
Add factory. More... | |
AbstractClass * | createObject (const Identifier &id) |
Create factory object. More... | |
void | deleteObject (const Identifier &id, AbstractClass *&obj) |
Delete factory object. More... | |
void | deleteObject (AbstractClass *&obj) |
Delete factory object. More... | |
std::vector< Identifier > | getIdentifiers () |
Get factory ID list. More... | |
bool | hasFactory (const Identifier &id) |
Factory presence check. More... | |
ReturnCode | removeFactory (const Identifier &id) |
Remove factory. More... | |
Private Attributes | |
FactoryMap | m_creators |
Factory template class.
Definition at line 104 of file coil/common/Factory.h.
typedef std::map<Identifier, FactoryEntry> coil::Factory< AbstractClass, Identifier, Compare, Creator, Destructor >::FactoryMap |
Definition at line 106 of file coil/common/Factory.h.
typedef FactoryMap::iterator coil::Factory< AbstractClass, Identifier, Compare, Creator, Destructor >::FactoryMapIt |
Definition at line 110 of file coil/common/Factory.h.
enum coil::Factory::ReturnCode |
Enumerator | |
---|---|
FACTORY_OK | |
FACTORY_ERROR | |
ALREADY_EXISTS | |
NOT_FOUND | |
INVALID_ARG | |
UNKNOWN_ERROR |
Definition at line 112 of file coil/common/Factory.h.
|
inline |
Add factory.
Add a factory.
id | Factory ID. |
creator | Functor for creator. |
destructor | Functor for destructor. |
Definition at line 217 of file coil/common/Factory.h.
|
inline |
Create factory object.
Create a factory object.
id | Factory ID. |
Definition at line 284 of file coil/common/Factory.h.
|
inline |
Delete factory object.
Delete a factory object.
Definition at line 311 of file coil/common/Factory.h.
|
inline |
Delete factory object.
Delete a factory object.
obj | Factory object. |
Definition at line 336 of file coil/common/Factory.h.
|
inline |
Get factory ID list.
Return a list of factory ID.
Definition at line 170 of file coil/common/Factory.h.
|
inline |
Factory presence check.
Return a factory having ID or not.
id | Factory ID. |
Definition at line 145 of file coil/common/Factory.h.
|
inline |
Remove factory.
Remove a factory.
id | Factory ID. |
Definition at line 253 of file coil/common/Factory.h.
|
private |
Definition at line 398 of file coil/common/Factory.h.