Alsvinn
0.5.3
The fast FVM simulator with UQ support
|
#include <alsutils/base/impl/FactoryRegistry.hpp>
Public Types | |
typedef std::shared_ptr< T > | PointerType |
typedef std::function< PointerType(Args...)> | CreatorType |
Public Member Functions | |
bool | registerClass (const std::string &name, CreatorType creator) |
template<class C > | |
bool | registerClassWithOnlyConstructor (const std::string &name) |
PointerType | createInstance (const std::string &name, Args... args) |
Creates a new instance of the class with the given name and arguments. More... | |
Static Public Member Functions | |
static FactoryRegistry & | getInstance () |
Gets the singleton instance of this class. More... | |
T is any class that has the method
typedef std::function<PointerType(Args...)> alsutils::base::impl::FactoryRegistry< T, Args >::CreatorType |
typedef std::shared_ptr<T> alsutils::base::impl::FactoryRegistry< T, Args >::PointerType |
|
inline |
Creates a new instance of the class with the given name and arguments.
|
inlinestatic |
Gets the singleton instance of this class.
|
inline |
Registers a new class to the registry.
name | the name of the class |
creator | the creator/constructor |
|
inline |
Registers a new class to the registry, in this case, we assume the class has a constructor that takes all the default arguments
name | the name of the class |