#include <rtti/factory.h>
Public Member Functions | |
Factory ()=default | |
Factory (const Factory &)=delete | |
virtual | ~Factory ()=default |
Factory & | operator= (const Factory &)=delete |
void | addObjectCreator (std::unique_ptr< IObjectCreator > objectCreator) |
Object * | create (rtti::TypeInfo typeInfo) |
bool | canCreate (rtti::TypeInfo typeInfo) const |
Protected Member Functions | |
virtual Object * | createDefaultObject (rtti::TypeInfo typeInfo) |
Manages all the custom defined object creators. This class is given to a service when the system collects all custom object creators
|
default |
|
virtualdefault |
void addObjectCreator | ( | std::unique_ptr< IObjectCreator > | objectCreator | ) |
Adds association between a type and it's object creator.
objectCreator | the object that can create instances of the type. |
bool canCreate | ( | rtti::TypeInfo | typeInfo | ) | const |
Object* create | ( | rtti::TypeInfo | typeInfo | ) |
Creates an object. If there is an existing type mapping, it will use the ObjectCreator for that type. If there isn't, the default constructor will be used.
typeInfo | the type to create an instance of. |
|
protectedvirtual |
Reimplemented in CoreFactory.