Registry of factories that can construct objects derived from BASE_TYPE.
More...
#include <factory.hpp>
|
|
using | Factory = std::function< BASE_TYPE *()> |
| |
|
using | FactoryMap = std::unordered_map< typename BASE_TYPE::type_info_t, Factory > |
| |
|
|
void | register_factory (const typename BASE_TYPE::type_info_t &type_info, Factory factory) |
| | Register a custom factory for type_info.
|
| |
|
template<typename DERIVED_TYPE > |
| void | register_factory (Factory factory) |
| | Register a custom factory for DERIVED_TYPE.
|
| |
|
template<typename DERIVED_TYPE > |
| void | register_factory () |
| | Register the defualt constructor factory for DERIVED_TYPE.
|
| |
|
bool | has_factory (const typename BASE_TYPE::type_info_t &info) |
| | Check to see if a factory is registered.
|
| |
|
template<typename DERIVED_TYPE > |
| bool | has_factory () |
| | Check to see if DERIVED_TYPE has a registered factory.
|
| |
|
BASE_TYPE * | create (const typename BASE_TYPE::type_info_t &type_info) const |
| | Create an instance for type_info.
|
| |
|
template<typename DERIVED_TYPE > |
| BASE_TYPE * | create () const |
| | Create an instance using factory for DERIVED_TYPE.
|
| |
|
|
template<typename DERIVED_TYPE > |
| static Factory | get_default_factory () |
| |