ADTF  3.18.2
map_source.h
Go to the documentation of this file.
1 
14 #ifndef HEADER_MAP_SOURCE_H
15 #define HEADER_MAP_SOURCE_H
16 
17 #include <a_util/result.h>
18 #include <a_util/xml.h>
19 
20 #include <set>
21 #include <vector>
22 
23 namespace ddl {
24 namespace mapping {
25 
26 class MapConfiguration;
27 
31 class MapSource {
32 public:
43  MapSource(MapConfiguration* config, std::string name, std::string type);
44 
48  const std::string& getName() const;
49 
57  a_util::result::Result setName(const std::string& new_name);
58 
62  const std::string& getType() const;
63 
72  a_util::result::Result setType(const std::string& type_name);
73 
77  bool isValid() const;
78 
79 private:
87 
95 
96 private:
98  friend class MapConfiguration;
99  friend class MapTarget;
100  MapConfiguration* _config;
101  std::string _name;
102  std::string _type_name;
103  bool _is_valid;
105 };
106 
115 inline bool operator==(const MapSource& a, const MapSource& b)
116 {
117  return a.getName() == b.getName() && a.getType() == b.getType();
118 }
119 
128 inline bool operator!=(const MapSource& a, const MapSource& b)
129 {
130  return !(a == b);
131 }
132 
134 typedef std::vector<MapSource> MapSourceList;
139 typedef std::set<std::string> MapSourceNameList;
140 
141 } // namespace mapping
142 } // namespace ddl
143 
144 #endif // HEADER_MAP_SOURCE_H
A common result class usable as return value throughout.
MapConfiguration is the central class of the mapping::dd namespace.
MapSource represents a mapping source from the configuration file.
Definition: map_source.h:31
const std::string & getType() const
Returns the DataDefinition typename of the mapping source.
bool isValid() const
Returns the validity for the current description.
const std::string & getName() const
Returns the name of the mapping source.
a_util::result::Result setName(const std::string &new_name)
Set name.
MapSource(MapConfiguration *config)
CTOR.
MapSource(MapConfiguration *config, std::string name, std::string type)
CTOR.
a_util::result::Result setType(const std::string &type_name)
Set type.
a_util::result::Result loadFromDOM(const a_util::xml::DOMElement &source)
Initializes the source from a source-dom element.
a_util::result::Result writeToDOM(a_util::xml::DOMElement &dom_element) const
Export source to a XML dom element.
MapTarget represents a mapped target from the mapping configuration.
Definition: map_target.h:31
bool operator==(const MapAssignment &a, const MapAssignment &b)
compares the Assignments
std::vector< MapSource > MapSourceList
Public composite types used in the mapping::dd namespace.
Definition: map_source.h:134
bool operator!=(const MapAssignment &a, const MapAssignment &b)
compares the Assignments
std::set< std::string > MapSourceNameList
defintion of MapSource name list
Definition: map_source.h:139
Common include for component a_util::result.
Common include for component a_util::xml.