Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
ngraph::FactoryRegistry< BASE_TYPE > Class Template Reference

Registry of factories that can construct objects derived from BASE_TYPE. More...

#include <factory.hpp>

Public Types

using Factory = std::function< BASE_TYPE *()>
 
using FactoryMap = std::unordered_map< typename BASE_TYPE::type_info_t, Factory >
 

Public Member Functions

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.
 

Static Public Member Functions

template<typename DERIVED_TYPE >
static Factory get_default_factory ()
 

Protected Attributes

FactoryMap m_factory_map
 

Detailed Description

template<typename BASE_TYPE>
class ngraph::FactoryRegistry< BASE_TYPE >

Registry of factories that can construct objects derived from BASE_TYPE.


The documentation for this class was generated from the following file: