Mirror reflection library 0.5.13
|
Class template for generation of object factories. More...
#include <mirror/factory.hpp>
Inherits aux::base_factory< Manufacturer, Suppliers, Enumerator, SourceTraits, Product, constructors< meta_class< Product > >::type, mp::make_index_seq< mp::size< constructors< meta_class< Product > > >::type >::type, is_specialized_factory_src< Manufacturer< Product, SourceTraits > >::type >.
Public Member Functions | |
template<typename Param > | |
factory (Param param) | |
template<typename Param , class ConstructionInfo > | |
factory (Param param, ConstructionInfo) | |
template<typename Param , class... Items> | |
factory (Param param, mp::range< Items...> context) |
Class template for generation of object factories.
This template can be used to create a custom factory class that uses the registered meta-data about constructors and two user-specified templates to select which of the constructors to use to create an instance and to supply the necessary parameters if necessary.
Manufacturer | a class template which knows how to construct the parametes for the constructors. this template can for example use this factory template recursivelly for elaborated types and specify how to construct and initialize instances of the native C++ types. |
Suppliers | a class template which knows how to get existing instances to be supplied as parameters to the constructors. |
Enumerator | a class template which knows how to get enumerated values from external representations, like their names or values. |
SourceTraits | A parameter for the Manufacturer and Suppliers templates, which can be used for further configuration and fine-tuning of the generated factory. |
Product | the type instances of which are produced by this factory |