MaterialX 1.39.1
|
Factory class for creating instances of classes given their type name. More...
#include <Factory.h>
Public Types | |
using | Ptr = shared_ptr< T > |
using | CreatorFunction = Ptr(*)() |
using | CreatorMap = std::unordered_map< string, CreatorFunction > |
Public Member Functions | |
void | registerClass (const string &typeName, CreatorFunction f) |
Register a new class given a unique type name and a creator function for the class. | |
bool | classRegistered (const string &typeName) const |
Determine if a class has been registered for a type name. | |
void | unregisterClass (const string &typeName) |
Unregister a registered class. | |
Ptr | create (const string &typeName) const |
Create a new instance of the class with given type name. More... | |
Factory class for creating instances of classes given their type name.
|
inline |
Create a new instance of the class with given type name.
Returns nullptr if no class with given name is registered.