Dev Essential  1.6.3
Loading...
Searching...
No Matches
element.h
Go to the documentation of this file.
1
13
14#ifndef ELEMENT_HEADER
15#define ELEMENT_HEADER
16
17#include <a_util/result.h>
18#include <ddl/dd/dd.h>
20
21#include <map>
22
23namespace ddl {
24namespace mapping {
25
26#if defined(__GNUC__) && (__GNUC__ == 5) && defined(__QNX__)
27#pragma GCC diagnostic ignored \
28 "-Wattributes" // standard type attributes are ignored when used in templates
29#endif
30
32typedef std::map<std::string, uint8_t> TypeMap;
33
34#if defined(__GNUC__) && (__GNUC__ == 5) && defined(__QNX__)
35#pragma GCC diagnostic warning \
36 "-Wattributes" // standard type attributes are ignored when used in templates
37#endif
38
41 e_uint8 = 1,
42 e_uint16,
43 e_uint32,
44 e_uint64,
45 e_int8,
46 e_int16,
47 e_int32,
48 e_int64,
49 e_float32,
50 e_float64,
51 e_bool,
52 e_char,
53};
54
55namespace rt {
56class Target;
57
60public:
66
71
80 a_util::result::Result create(void* element_ptr,
81 const ddl::dd::StructElementAccess& element_access,
82 const size_t array_size,
83 const std::string& element_name);
84
92
98 a_util::result::Result setDefaultValue(const std::string& default_value);
99
107 a_util::result::Result setValue(const void* data, uint32_t src_type, size_t mem_size);
108
114
115private:
117 Target* _target;
118 void* _element_ptr;
119 TypeMap _type_map;
120 uint32_t _type_int;
121 ddl::dd::StructElementAccess _element_access;
122 size_t _array_size;
123 const MapTransformationBase* _transformation;
124 // For Debug only
125 std::string _element_name;
127};
128
133typedef std::vector<TargetElement*> TargetElementList;
134
135} // namespace rt
136} // namespace mapping
137} // namespace ddl
138#endif // ELEMENT_HEADER
Definition result_type_decl.h:34
Class to access and obtain the byte position and other information of a instance of this element with...
Definition dd_struct_access.h:41
Definition map_transformation.h:30
a_util::result::Result setTransformation(const MapTransformationBase *transformation)
a_util::result::Result setValue(const void *data, uint32_t src_type, size_t mem_size)
a_util::result::Result setDefaultValue(const std::string &default_value)
a_util::result::Result create(void *element_ptr, const ddl::dd::StructElementAccess &element_access, const size_t array_size, const std::string &element_name)
Target represents a mapped target signal in the runtime api.
Definition target.h:34
std::vector< TargetElement * > TargetElementList
the targets element list
Definition element.h:133
definition of the mapping namespace
Definition ddl.h:50
DataTypes
Enum for all relevant data types.
Definition element.h:40
std::map< std::string, uint8_t > TypeMap
String -> Datatype Enum Map.
Definition element.h:32
definition of the ddl namespace
Definition codec.h:21