template<class T, typename ... Args>
ObjectFactory class
| Template parameters | |
|---|---|
| T | the type of base class |
| Args | the arguments to the constructor |
Contents
- Reference
Factory, creates object instances from object constructor names
Public functions
-
template<class C>void AddClass()
- auto MakeUnique(const String& name, Args && ... args) -> UniquePtr<T>
- auto MakeShared(const String& name, Args && ... args) -> SharedPtr<T>
Function documentation
template<class T, typename ... Args>
template<class C>
void bpf:: memory:: ObjectFactory<T, Args>:: AddClass()
| Template parameters | |
|---|---|
| C | the class type to register (must have a BP_DEFINE_TYPENAME linked) |
Registers a new class with this factory
template<class T, typename ... Args>
UniquePtr<T> bpf:: memory:: ObjectFactory<T, Args>:: MakeUnique(const String& name,
Args && ... args)
| Parameters | |
|---|---|
| name | the name of the class |
| args | the arguments to the constructor |
| Returns | new unique pointer, null if class cannot be found |
| Exceptions | |
| MemoryException | in case allocation is impossible |
Instantiates a new class from this factory
template<class T, typename ... Args>
SharedPtr<T> bpf:: memory:: ObjectFactory<T, Args>:: MakeShared(const String& name,
Args && ... args)
| Parameters | |
|---|---|
| name | the name of the class |
| args | the arguments to the constructor |
| Returns | new shared pointer, null if class cannot be found |
| Exceptions | |
| MemoryException | in case allocation is impossible |
Instantiates a new class from this factory