ADTF  3.18.2
builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/extern/pkg_ddl/include/adtfddl/codec/struct_element.h
Go to the documentation of this file.
1 
7 #ifndef _DDL_STRUCT_ELEMENT_CLASS_HEADER_
8 #define _DDL_STRUCT_ELEMENT_CLASS_HEADER_
9 
10 
11 #ifndef DDL_DATA_REPRESENTATION_DEFINED
12 #define DDL_DATA_REPRESENTATION_DEFINED
13 namespace ddl
14 {
19 {
24 };
26 }
27 #endif
28 
29 namespace adtf_ddl
30 {
35 
36 } // namespace adtf_ddl
37 
38 namespace adtf_ddl
39 {
43 typedef std::map<A_UTILS_NS::cString, A_UTILS_NS::cVariant> tEnum;
44 
49 {
52  const tEnum* pEnum;
53 };
54 
55 // The following classes are for internal use only
56 
61 struct tPosition
62 {
63  size_t nBitOffset;
64  size_t nBitSize;
65 };
66 
67 struct tStructLayoutElement : public tStructElement
68 {
69  tPosition sDeserialized;
70  tPosition sSerialized;
71  int nByteOrder;
72  const A_UTILS_NS::cVariant* pConstant;
73 };
74 
75 class tDynamicStructLayoutElement
76 {
77 public:
78  A_UTILS_NS::cString strName;
79  size_t nAlignment;
80  A_UTILS_NS::cString strSizeElementName;
81  std::vector<tStructLayoutElement> oStaticElements;
82  std::vector<tDynamicStructLayoutElement> oDynamicElements;
83 
84 public:
85  tDynamicStructLayoutElement() = default;
86  tDynamicStructLayoutElement(size_t nAlignment):
87  nAlignment(nAlignment)
88  {
89  }
90 
91  bool IsAlignmentElement() const
92  {
93  return strName.IsEmpty();
94  }
95 
96  bool IsDynamicArray() const
97  {
98  return strSizeElementName.IsNotEmpty();
99  }
100 };
101 
102 struct tOffsets
103 {
104  size_t nDeserialized;
105  size_t nSerialized;
106 };
107 
112 } // namespace adtf_ddl
113 
114 #endif
tBool IsNotEmpty() const
This function checks if the string object is not empty.
Definition: string.h:454
tBool IsEmpty() const
This function checks if the string object is empty.
Definition: string.h:441
Namespace for the mainpage_pkg_ddl.
std::map< A_UTILS_NS::cString, A_UTILS_NS::cVariant > tEnum
Typedef for enumerations name -> value.