![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
Generic factory for a class and its subclasses. More...
#include <ObjectFactory.h>
Public Member Functions | |
template<typename Type > | |
void | AddEntry (const KeyType &key) |
Register a new entry. More... | |
BaseType * | Create (const KeyType &key) const |
Creates an instance of some registered class. More... | |
Private Types | |
typedef BaseType *(* | CreateFunc) () |
Function pointer to the object creation function. More... | |
typedef std::map< KeyType, CreateFunc > | RegistryMap |
Type used to store registered entries. More... | |
Private Attributes | |
RegistryMap | registry_ |
Map from an identifier to a creation function. More... | |
Generic factory for a class and its subclasses.
|
private |
Function pointer to the object creation function.
|
private |
Type used to store registered entries.
|
inline |
Register a new entry.
[in] | key | The key to register the class under. |
|
inline |
Creates an instance of some registered class.
[in] | key | The key associated with the desired class. |
|
private |
Map from an identifier to a creation function.