ADTF
Loading...
Searching...
No Matches
map_trigger.h
Go to the documentation of this file.
1
13
14#ifndef HEADER_MAP_TRIGGER_H
15#define HEADER_MAP_TRIGGER_H
16
17#include <a_util/result.h>
18#include <a_util/xml.h>
19
20#include <string>
21#include <vector>
22
23namespace ddl {
24namespace mapping {
30public:
35
39 virtual ~MapTriggerBase();
40
44 bool isValid() const;
45
49 virtual std::string getSourceDependency() const;
50
54 virtual bool isEqual(const MapTriggerBase& other) const = 0;
55
61
68
69protected:
73 virtual MapTriggerBase* clone() const = 0;
74
75private:
84 static a_util::result::Result createFromDOM(MapConfiguration* config,
85 const a_util::xml::DOMElement& dom_element,
86 MapTriggerBase*& destination);
87
94 a_util::result::Result writeToDOM(a_util::xml::DOMElement& dom_element) const;
95
100 a_util::result::Result setSourceDependency(const std::string& new_name);
101
102protected:
104 friend class MapConfiguration;
105 friend class MapTarget;
106 MapConfiguration* _config;
107 bool _is_valid;
109};
110
113public:
119
123 double getPeriod() const;
124
130 a_util::result::Result setPeriod(const std::string& period, const std::string& unit);
131
137 bool isEqual(const MapTriggerBase& other) const;
138
139protected:
140 // implements MapTriggerBase
142
143private:
150 a_util::result::Result loadFromDom(const a_util::xml::DOMElement& dom_element);
151
158 a_util::result::Result writeToDOM(a_util::xml::DOMElement& dom_element) const;
159
160private:
162 friend class MapTriggerBase;
163 double _period;
165};
166
169public:
175
179 virtual std::string getSourceDependency() const;
180
184 const std::string& getVariable() const;
185
192 a_util::result::Result setVariable(const std::string& signal_name);
193
199 bool isEqual(const MapTriggerBase& other) const;
200
201protected:
202 // implements MapTriggerBase
204
205private:
212 a_util::result::Result loadFromDom(const a_util::xml::DOMElement& dom_element);
213
220 a_util::result::Result writeToDOM(a_util::xml::DOMElement& dom_element) const;
221
228 a_util::result::Result setVariableNoTypeCheck(const std::string& signal_name);
229
230private:
232 friend class MapConfiguration;
233 friend class MapTriggerBase;
234 std::string _variable;
235 bool _is_valid;
237};
238
241public:
247
252 virtual std::string getSourceDependency() const;
253
258 const std::string& getVariable() const;
259
263 const std::string& getSource() const;
264
268 const std::string& getOperator() const;
269
273 double getValue() const;
274
284 a_util::result::Result setComparison(const std::string& source_element_path,
285 const std::string& comp_operator,
286 const std::string& value);
287
293 bool isEqual(const MapTriggerBase& other) const;
294
295protected: // implements MapTriggerBase
297
298private:
305 a_util::result::Result loadFromDom(const a_util::xml::DOMElement& trigger_element);
306
313 a_util::result::Result writeToDOM(a_util::xml::DOMElement& dom_element) const;
314
323 a_util::result::Result setComparisonNoTypeCheck(const std::string& source_element_path,
324 const std::string& comp_operator,
325 const std::string& value);
326
332 a_util::result::Result setSourceNoTypeCheck(const std::string& source);
333
334private:
336 friend class MapConfiguration;
337 friend class MapTriggerBase;
338 std::string _variable;
339 std::string _source;
340 std::string _operator;
341 double _value;
343};
344
346typedef std::vector<MapTriggerBase*> MapTriggerList;
347
348} // namespace mapping
349} // namespace ddl
350
351#endif // HEADER_MAP_TRIGGER_H
Definition result_type_decl.h:34
Representation for an element in the DOM.
Definition dom.h:47
Definition map_configuration.h:36
a_util::result::Result setComparison(const std::string &source_element_path, const std::string &comp_operator, const std::string &value)
const std::string & getVariable() const
const std::string & getOperator() const
MapTriggerBase * clone() const
const std::string & getSource() const
bool isEqual(const MapTriggerBase &other) const
MapDataTrigger(MapConfiguration *config)
virtual std::string getSourceDependency() const
MapPeriodicTrigger(MapConfiguration *config)
a_util::result::Result setPeriod(const std::string &period, const std::string &unit)
MapTriggerBase * clone() const
bool isEqual(const MapTriggerBase &other) const
const std::string & getVariable() const
MapTriggerBase * clone() const
MapSignalTrigger(MapConfiguration *config)
a_util::result::Result setVariable(const std::string &signal_name)
virtual std::string getSourceDependency() const
bool isEqual(const MapTriggerBase &other) const
Definition map_target.h:31
a_util::result::Result checkTriggerReferences() const
virtual std::string getSourceDependency() const
virtual bool isEqual(const MapTriggerBase &other) const =0
MapTriggerBase(MapConfiguration *config)
virtual MapTriggerBase * clone() const =0
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
definiton of the unit namespace
Definition dd_predefined_units.h:55
definition of the ddl namespace
Definition codec.h:21