r\Represents a unified interface for managing custom objects and factories
Definition at line 35 of file common_factory.hpp.
Public Member Functions | |
virtual | ~CommonFactory ()=default |
CommonFactory (const CommonFactory &)=delete | |
CommonFactory (CommonFactory &&)=delete | |
CommonFactory & | operator= (const CommonFactory &)=delete |
CommonFactory & | operator= (CommonFactory &&)=delete |
virtual std::unique_ptr< CustomObject > | createObject (const std::string &factory_key, const std::string &name)=0 |
Create a custom object from a custom factory. More... | |
virtual bool | addCustomFactory (CustomFactory *factory, const char *key)=0 |
Add a custom factory. More... | |
virtual CustomFactory * | getCustomFactory (const char *factory_name)=0 |
Find a custom factory that supports a certan object type. More... | |
Static Public Member Functions | |
static CommonFactory & | getInstance () |
Acquire the reference of the singleton. More... | |
Protected Member Functions | |
CommonFactory ()=default | |
Static Protected Member Functions | |
static bool | _load (const std::string &plugin_name) |
|
virtualdefault |
|
delete |
|
delete |
|
protecteddefault |
|
staticprotected |
|
pure virtual |
Add a custom factory.
Once a custom factory is added, the type of object defined within the factory can be created through common factory interface.
[in] | factory | pointer to the factory |
[in] | key | key used to identify the factory |
|
pure virtual |
Create a custom object from a custom factory.
[in] | factory_key | identifier of the factory where the custom object is supported |
[in] | name | name for the object to be created. |
|
pure virtual |
Find a custom factory that supports a certan object type.
[in] | factory_name | name of the factory |
|
static |
Acquire the reference of the singleton.
|
delete |
|
delete |