3 #ifndef VISR_PARAMETER_FACTORY_HPP_INCLUDED 4 #define VISR_PARAMETER_FACTORY_HPP_INCLUDED 19 class ParameterConfigBase;
30 static std::size_t numberOfParameterTypes() noexcept;
38 template<
class ConcreteParameterType >
39 static void registerParameterType(
ParameterType const & type );
45 template<
class TypedParameterType >
46 static void registerParameterType();
52 template<
class ConcreteParameterType >
58 creatorTable().insert( std::make_pair( type, TCreator<ConcreteParameterType>() ) );
65 using CreateFunction = std::function< ParameterBase* ( ParameterConfigBase const & config ) >;
67 VISR_CORE_LIBRARY_SYMBOL
explicit Creator( CreateFunction fcn );
69 VISR_CORE_LIBRARY_SYMBOL std::unique_ptr<ParameterBase> create(
ParameterConfigBase const & config )
const;
71 CreateFunction mCreateFunction;
74 template<
class ConcreteParameterType >
75 class TCreator:
public Creator
79 : Creator( &TCreator<ConcreteParameterType>::construct )
90 using CreatorTable = std::map<ParameterType, Creator >;
92 static CreatorTable & creatorTable();
95 template<
class ConcreteParameterType >
98 creatorTable().insert( std::make_pair( type, TCreator<ConcreteParameterType>() ) );
101 template<
class TypedParameterType >
104 registerParameterType<TypedParameterType>( TypedParameterType::staticType() );
115 #endif // #ifndef VISR_PARAMETER_FACTORY_HPP_INCLUDED static void registerParameterType()
Definition: parameter_factory.hpp:102
uint64_t ParameterType
Definition: parameter_type.hpp:13
Definition: parameter_factory.hpp:22
Definition: options.cpp:10
Definition: parameter_factory.hpp:20
Definition: parameter_config_base.hpp:22
Registrar(ParameterType type)
Definition: parameter_factory.hpp:56
Definition: parameter_base.hpp:18
Definition: parameter_factory.hpp:53