Class ngraph::FactoryRegistry

template<typename BASE_TYPE>
class FactoryRegistry

Registry of factories that can construct objects derived from BASE_TYPE.

Public Functions

inline 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>
inline void register_factory(Factory factory)

Register a custom factory for DERIVED_TYPE.

template<typename DERIVED_TYPE>
inline void register_factory()

Register the defualt constructor factory for DERIVED_TYPE.

inline bool has_factory(const typename BASE_TYPE::type_info_t &info)

Check to see if a factory is registered.

template<typename DERIVED_TYPE>
inline bool has_factory()

Check to see if DERIVED_TYPE has a registered factory.

inline BASE_TYPE *create(const typename BASE_TYPE::type_info_t &type_info) const

Create an instance for type_info.

template<typename DERIVED_TYPE>
inline BASE_TYPE *create() const

Create an instance using factory for DERIVED_TYPE.