Dev Essential
Loading...
Searching...
No Matches
map_target.h
Go to the documentation of this file.
1
13
14#ifndef HEADER_MAP_TARGET_H
15#define HEADER_MAP_TARGET_H
16
17#include <a_util/result.h>
18#include <a_util/xml.h>
22
23namespace ddl {
24namespace mapping {
25
27
31class MapTarget {
32public:
37
44 MapTarget(MapConfiguration* config, std::string name, std::string type);
45
50
54 MapTarget(const MapTarget& other);
55
62
67 const std::string& getName() const;
68
76 a_util::result::Result setName(const std::string& name);
77
82 const std::string& getType() const;
83
92 a_util::result::Result setType(const std::string& type);
93
98 bool isValid() const;
99
110
117 a_util::result::Result removeAssignment(const std::string& element_name);
118
123
134
142
147
152
153private:
160 a_util::result::Result loadFromDOM(const a_util::xml::DOMElement& target);
161
168 a_util::result::Result writeToDOM(a_util::xml::DOMElement& dom_element) const;
169
175 a_util::result::Result checkDoubleAssignments();
176
183 a_util::result::Result addAssignmentNoTypeCheck(const MapAssignment& assignment);
184
191 a_util::result::Result removeAssignmentWithoutClear(const std::string& element_name);
192
198 a_util::result::Result addTriggerNoTypeCheck(MapTriggerBase* trigger);
199
206 a_util::result::Result modifySourceName(const std::string& name, const std::string& new_name);
207
211 void swap(MapTarget& other);
212
213private:
215 friend class MapConfiguration;
216 friend class MapSource;
217 MapConfiguration* _config;
218 std::string _name;
219 std::string _type_name;
220 MapSourceNameList _sources;
221 MapAssignmentList _assignments;
222 MapTriggerList _triggers;
223 bool _is_valid;
225};
226
235bool operator==(const MapTarget& a, const MapTarget& b);
236
245inline bool operator!=(const MapTarget& a, const MapTarget& b)
246{
247 return !(a == b);
248}
249
251typedef std::vector<MapTarget> MapTargetList;
252
253} // namespace mapping
254} // namespace ddl
255
256#endif // HEADER_MAP_TARGET_H
Definition result_type_decl.h:34
Representation for an element in the DOM.
Definition dom.h:47
Definition map_assignment.h:33
Definition map_configuration.h:36
Definition map_source.h:31
Definition map_target.h:31
MapTarget(const MapTarget &other)
a_util::result::Result removeAssignment(const std::string &element_name)
a_util::result::Result setType(const std::string &type)
a_util::result::Result addAssignment(const MapAssignment &assignment)
const std::string & getType() const
MapTarget(MapConfiguration *config, std::string name, std::string type)
const MapTriggerList & getTriggerList() const
MapTarget(MapConfiguration *config)
const MapSourceNameList & getReferencedSources() const
const std::string & getName() const
MapTarget & operator=(const MapTarget &other)
a_util::result::Result addTrigger(MapTriggerBase *trigger)
a_util::result::Result removeTrigger(MapTriggerBase *trigger)
const MapAssignmentList & getAssignmentList() const
a_util::result::Result setName(const std::string &name)
Definition map_trigger.h:29
definition of the mapping namespace
Definition ddl.h:50
std::vector< MapTriggerBase * > MapTriggerList
Public composite types used in the mapping::dd namespace.
Definition map_trigger.h:346
std::set< std::string > MapSourceNameList
defintion of MapSource name list
Definition map_source.h:139
std::vector< MapTarget > MapTargetList
Public composite types used in the mapping::dd namespace.
Definition map_target.h:251
bool operator==(const MapAssignment &a, const MapAssignment &b)
compares the Assignments
Definition map_assignment.h:184
bool operator!=(const MapAssignment &a, const MapAssignment &b)
compares the Assignments
Definition map_assignment.h:199
std::vector< MapAssignment > MapAssignmentList
Public composite types used in the mapping::dd namespace.
Definition map_assignment.h:205
definition of the ddl namespace
Definition codec.h:21