Generic factory that registers and invokes named constructors for a given type.
More...
|
| static std::unique_ptr< T > | Construct (uint32_t aIdentifier, Types... args) |
| | Constructs an object by its numeric identifier.
|
| static std::unique_ptr< T > | Construct (const std::string &aIdentifier, Types... args) |
| | Constructs an object by its string identifier.
|
| static bool | RegisterConstructor (const StringId &aIdentifier, const std::function< std::unique_ptr< T >(Types... args) > &aConstructor) |
| | Registers a constructor function with the given identifier.
|
| static bool | UnregisterConstructor (const StringId &aIdentifier) |
| | Unregisters the constructor with the given identifier.
|
| static void | EnumerateConstructors (const std::function< bool(const StringId &) > &aEnumerator) |
| | Enumerates all registered constructors, calling the provided function for each.
|
| static std::vector< std::string > | GetConstructorNames () |
| | Returns the names of all registered constructors.
|
template<class T, typename... Types>
class AeonGames::Factory< T, Types >
Generic factory that registers and invokes named constructors for a given type.
- Template Parameters
-
| T | The base type produced by the factory. |
| Types | Additional argument types forwarded to the constructor. |
Definition at line 107 of file Factory.h.