ADTF  3.18.2
ddlinspector.h
Go to the documentation of this file.
1 
8 #ifndef _DDL_INSPECTOR_H_INCLUDED_
9 #define _DDL_INSPECTOR_H_INCLUDED_
10 
12 
13 namespace adtf_ddl
14 {
16  #define DDL_MAX_DESC_HIERARCHY 100
17 
21  class cDDLInspector : public IDDLVisitor
22  {
23  public:
28  PKG_ADTF_DDL_DEPRECATED("Use ddl::dd::DataDefinition::validate instead.")
29  cDDLInspector(bool bAutoCorrect = false);
30 
34  virtual ~cDDLInspector();
35 
36  virtual tResult VisitDDL(cDDLDescription* poDescription);
37  virtual tResult Visit(cDDLHeader* poHeader);
38  virtual tResult Visit(cDDLDataType* poDataType);
39  virtual tResult Visit(cDDLComplex* poComplex);
40  virtual tResult Visit(cDDLStream* poStream);
41  virtual tResult Visit(cDDLUnit* poUnit);
42  virtual tResult Visit(cDDLBaseunit* poBaseunit);
43  virtual tResult Visit(cDDLExtDeclaration* poExtDeclaration);
44  virtual tResult Visit(cDDLElement* poElement);
45  virtual tResult Visit(cDDLPrefix* poPrefix);
46  virtual tResult Visit(cDDLRefUnit* poRefUnit);
47  virtual tResult Visit(cDDLStreamStruct* poStreamStruct);
48  virtual tResult Visit(cDDLEnum* poEnum);
49  virtual tResult Visit(cDDLStreamMetaType* poStreamMetaType);
50  virtual tResult Visit(cDDLProperty* poProperty);
51 
57  void SetAutoCorrect(bool bAutoCorrect);
58 
63  bool GetAutoCorrect() const;
64 
70 
77 
81  void InitNewCheck();
82 
89  unsigned int GetLastBytePosOfAStructCorrected(const A_UTILS_NS::cString& strStructName);
90 
96  unsigned int GetLastBytePosOfAStructReal(const A_UTILS_NS::cString& strStructName);
97 
104 
105  protected:
115  tImporterMsgSeverity const eSeverity);
116 
124  virtual bool IsAlignable(size_t const posBytePos,
125  size_t const szElementSize);
126 
139  static bool LessDDL (const A_UTILS_NS::cString& strLHS,
140  const A_UTILS_NS::cString& strRHS,
141  const cDDLDataType* poType);
142 
143  private: // methods
154  static bool CheckValidyOfNestedStructs(const cDDLDescription* poDescription,
155  const A_UTILS_NS::cString& strStructTypeName,
156  const A_UTILS_NS::cString& strNestedStructTypeName,
157  A_UTILS_NS::cString& strLog,
158  int nStructDepth = 1);
159 
160  private: // members
161  cDDLDescription* m_poDDL;
162  bool m_bAutoCorrect;
167 
174 
181 
188 
195 
202 
209 
216 
223 
224  double m_fVersion;
225 
226  bool m_bHasDynamicArrays;
227 
228  struct tStructInfo
229  {
230  unsigned int nSize;
231  unsigned int nLastBytePosReal;
232  unsigned int nLastBytePos;
233  bool bValid;
234  };
235 
236  std::map<cDDLComplex*, tStructInfo> m_mapStructInfos;
237  };
238 }
239 #endif // _DDL_INSPECTOR_H_INCLUDED_
240 
Abstract base class/interface for Visitor design-pattern.
Representation of a base unit inside a DDL description.
Definition: ddlbaseunit.h:16
Representation for a complex datatype inside a DDL specification.
Definition: ddlcomplex.h:35
Representation for a (simple) data type inside a DDL description.
Definition: ddldatatype.h:19
Main class representing a whole DDL description.
Representation of an element inside a struct in DDL a description.
Definition: ddlelement.h:19
Representation for an enum inside a DDL description.
Definition: ddlenum.h:20
Representation of an external declaration inside the header of a DDL description.
Representation of the header of a DDL description.
Definition: ddlheader.h:28
Validation and correction class for ADTF DDL for use with the.
Definition: ddlinspector.h:22
A_UTILS_NS::cStringList m_strLstEnumsValues
The list contains all names of the enum values.
Definition: ddlinspector.h:194
A_UTILS_NS::cStringList m_strLstBaseunitName
The list contains all names of the base unit names.
Definition: ddlinspector.h:201
A_UTILS_NS::cStringList m_strLstStreamsName
The list contains all names of the streams.
Definition: ddlinspector.h:208
unsigned int GetLastBytePosOfAStructReal(const A_UTILS_NS::cString &strStructName)
Returns the actual last Bytepos inclusive the last Element size.
A_UTILS_NS::cStringList m_strLstPrefixName
The list contains all names of the prefixes.
Definition: ddlinspector.h:215
A_UTILS_NS::cStringList m_strLstUnitName
The list contains all names of the unit names.
Definition: ddlinspector.h:222
unsigned int GetLastBytePosOfAStructCorrected(const A_UTILS_NS::cString &strStructName)
Returns the last corrected Bytepos position inclusive the last Element size.
virtual tResult VisitDDL(cDDLDescription *poDescription)
Visitor for a whole DDL description.
A_UTILS_NS::cString GetLastErrorDesc() const
Getter for the most recent error description.
void SetAutoCorrect(bool bAutoCorrect)
Setter for the auto-correction flag.
bool GetAutoCorrect() const
Getter for the auto-correction flag.
static bool LessDDL(const A_UTILS_NS::cString &strLHS, const A_UTILS_NS::cString &strRHS, const cDDLDataType *poType)
Helper method which returns whether the left-hand-side argument compares less than the right-hand-sid...
tImporterMsgList GetSuggestions() const
Getter for the list of suggestions.
A_UTILS_NS::cStringList m_strLstEnumsName
The list contains all names of the enum.
Definition: ddlinspector.h:187
tResult AddSuggestion(A_UTILS_NS::cString const &strDesc, tImporterMsgSeverity const eSeverity)
Method for derived classes to add an own suggestion.
tImporterMsgList m_lstSuggestions
The list contains all warnings and errors.
Definition: ddlinspector.h:166
A_UTILS_NS::cStringList m_strLstComplexName
The list contains all names of the structs.
Definition: ddlinspector.h:173
virtual bool IsAlignable(size_t const posBytePos, size_t const szElementSize)
Helper method to check if the element is alignable.
void InitNewCheck()
Init a new Check, clear all list and init all variables.
static tImporterMsgList CheckValidyOfNestedStructs(const cDDLDescription *poDescription)
Check the validy of nested structs.
virtual tResult Visit(cDDLHeader *poHeader)
Visitor for DDL header objects.
A_UTILS_NS::cStringList m_strLstDataTypesName
The list contains all names of the data types.
Definition: ddlinspector.h:180
Representation of a prefix in a DDL description.
Definition: ddlprefix.h:17
Representation of a stream inside a DDL description.
Definition: ddlproperty.h:16
Decorator class for IDDLUnit objects to be used inside other cDDLUnit objects.
Definition: ddlrefunit.h:18
Representation of a stream inside a DDL description.
Definition: ddlstream.h:28
Representation of a stream inside a DDL description.
Decorator class for cDDLComplex to be used inside cDDLStream objects.
Representation object of a unit.
Definition: ddlunit.h:28
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
Definition: d_ptr.h:11
string_base< cStackString > cString
cString implementation for a stack string which works on stack if string is lower than A_UTILS_DEFAUL...
Definition: string.h:2778
Namespace for the mainpage_pkg_ddl.
std::list< tImporterMsg > tImporterMsgList
Container for error descriptions.
Definition: ddlimporter.h:38
tImporterMsgSeverity
enumeration type for message severity
Definition: ddlimporter.h:19
Copyright © Audi Electronics Venture GmbH.
#define PKG_ADTF_DDL_DEPRECATED(_depr_message_)
Mark a function or variable as deprecated.