20#ifndef _MAPPER_BASE_HEADER
21#define _MAPPER_BASE_HEADER
44 : _name(std::move(name)), _properties(std::move(properties))
56 const std::string&
getName()
const override
77 const auto found = _properties.find(property_name);
78 if (found != _properties.end()) {
82 throw std::runtime_error(
"Property with name " + property_name +
" was not found");
95template <
typename SourceType>
100 return SourceType::getType();
104 return SourceType::getDefaultProperties();
108 return std::make_shared<SourceType>(std::move(name), std::move(properties));
116template <
typename TargetType>
121 return TargetType::getType();
125 return TargetType::getDefaultProperties();
127 std::shared_ptr<Target>
make(std::string name,
Properties properties)
const override
129 return std::make_shared<TargetType>(std::move(name), std::move(properties));
137template <
typename FunctionType>
142 return FunctionType::getType();
146 return FunctionType::getDefaultProperties();
148 std::shared_ptr<Function>
make(std::string name,
Properties properties)
const override
150 return std::make_shared<FunctionType>(std::move(name), std::move(properties));
170 static std::shared_ptr<const PlainSourceValue>
make(
const std::string& value);
static std::shared_ptr< const PlainSourceValue > make(const std::string &value)
Constant value factory to create a PlainSourceValue reference.
ConstantValueFactory()=delete
CTOR.
FunctionFactory implementation template.
Definition mapper_base_types.h:138
Properties getDefaultProperties() const override
Get the default properties to initialize the Source, Target or Function with.
Definition mapper_base_types.h:144
std::string getType() const override
Get the Type as string.
Definition mapper_base_types.h:140
std::shared_ptr< Function > make(std::string name, Properties properties) const override
Factory create function which creates a Source, Target or Function instance with a name and intialize...
Definition mapper_base_types.h:148
~MapperElementBase() override=default
DTOR.
const std::string & getName() const override
Get the Name.
Definition mapper_base_types.h:56
const Property & getProperty(const std::string &property_name) const
Get the Property.
Definition mapper_base_types.h:75
const Properties & getProperties() const override
Get the Properties.
Definition mapper_base_types.h:65
MapperElementBase(std::string name, Properties properties)
CTOR.
Definition mapper_base_types.h:43
Property class representing a pair of value and its type.
Definition mapper_interfaces.h:208
SourceFactory implementation template.
Definition mapper_base_types.h:96
std::shared_ptr< Source > make(std::string name, Properties properties) const
Factory create function which creates a Source, Target or Function instance with a name and intialize...
Definition mapper_base_types.h:106
Properties getDefaultProperties() const override
Get the default properties to initialize the Source, Target or Function with.
Definition mapper_base_types.h:102
std::string getType() const override
Get the Type as string.
Definition mapper_base_types.h:98
TargetFactory implementation template.
Definition mapper_base_types.h:117
std::shared_ptr< Target > make(std::string name, Properties properties) const override
Factory create function which creates a Source, Target or Function instance with a name and intialize...
Definition mapper_base_types.h:127
Properties getDefaultProperties() const override
Get the default properties to initialize the Source, Target or Function with.
Definition mapper_base_types.h:123
std::string getType() const override
Get the Type as string.
Definition mapper_base_types.h:119
definition of the mapping namespace
Definition ddl.h:50
SpecificMapperFactory< Source > SourceFactory
A Source factory to create a Source.
Definition mapper_interfaces.h:504
std::unordered_map< std::string, Property > Properties
Properties class as set of key - property value pairs This proerties are used to adjust the readers a...
Definition mapper_interfaces.h:331
SpecificMapperFactory< Target > TargetFactory
A Target factory to create a Target.
Definition mapper_interfaces.h:556
SpecificMapperFactory< Function > FunctionFactory
A Function factory to create a Function.
Definition mapper_interfaces.h:610
definition of the ddl namespace
Definition codec.h:21