Dev Essential  1.6.3
Loading...
Searching...
No Matches
mapper.h
Go to the documentation of this file.
1
19
20#ifndef _MAPPING_MAPPER_HEADER
21#define _MAPPING_MAPPER_HEADER
22
24
25#include <memory>
26#include <stdexcept>
27#include <unordered_map>
28#include <vector>
29
30namespace ddl {
31namespace mapping {
32
36class Mapper final {
37public:
42
47
51 std::shared_ptr<Updateable> addSource(std::shared_ptr<Source> source);
55 void addTarget(std::shared_ptr<Target> target);
59 void addFunction(std::shared_ptr<Function> function);
60
82
87 static constexpr auto internal_value_update_counter = "update_counter";
88
93 std::string name;
101 std::string value_owner;
107 std::string value;
108 };
109
116 void addAssignment(const std::string& target_name,
117 const std::string& target_value_name,
118 const std::string& function_name,
119 const std::vector<ParameterValueDescription>& parameter_values);
127 void addAssignment(const std::string& target_name,
128 const std::string& target_value_name,
129 const std::string& source_name,
130 const std::string& source_value_name);
131
138 void addAssignment(const std::string& target_name,
139 const std::string& target_value_name,
140 const std::string& const_value);
146 std::shared_ptr<Source> getSource(const std::string_view& source_name) const;
152 std::shared_ptr<Target> getTarget(const std::string_view& target_name) const;
158 std::shared_ptr<AssignmentTrigger> getTargetTrigger(const std::string_view& target_name) const;
159
168
169private:
170 struct MapperImpl;
171 std::unique_ptr<MapperImpl> _impl;
172};
173
174} // namespace mapping
175} // namespace ddl
176#endif // _MAPPING_MAPPER_HEADER
std::shared_ptr< AssignmentTrigger > getTargetTrigger(const std::string_view &target_name) const
Get the Target Trigger.
void initialize()
initializes the mapper
void addFunction(std::shared_ptr< Function > function)
adds a module instance
std::shared_ptr< Source > getSource(const std::string_view &source_name) const
Get the source.
void addAssignment(const std::string &target_name, const std::string &target_value_name, const std::string &const_value)
adds a simple const value to target value assignment
std::shared_ptr< Target > getTarget(const std::string_view &target_name) const
Get the target.
std::shared_ptr< Updateable > addSource(std::shared_ptr< Source > source)
add a source instance
void addAssignment(const std::string &target_name, const std::string &target_value_name, const std::string &function_name, const std::vector< ParameterValueDescription > &parameter_values)
adds a assignment call assignment
void addTarget(std::shared_ptr< Target > target)
adds a target instance
void addAssignment(const std::string &target_name, const std::string &target_value_name, const std::string &source_name, const std::string &source_value_name)
adds a simple source value to target value assignment
void deinitialize()
deintitialzes the mapper
definition of the mapping namespace
Definition ddl.h:50
definition of the ddl namespace
Definition codec.h:21
Assignement Paramter Value Description.
Definition mapper.h:64
std::string value_owner
the source or target to retrieve the value from
Definition mapper.h:101
static constexpr auto internal_value_update_counter
possible value for internal_value to retrieve the update counter for a target or a source
Definition mapper.h:87
std::string value
the value name from value_owner or the constant value in case of type == Type::const_value or the int...
Definition mapper.h:107
Type
Possible type for type.
Definition mapper.h:68
std::string name
the name of the parameter value (should be a valid parameter name of the function to call)
Definition mapper.h:93
Type type
the type (ParameterValueDescription::Type)
Definition mapper.h:97