ADTF  3.18.2
cDDLInspector

Validation and correction class for ADTF DDL for use with the. More...

Inheritance diagram for cDDLInspector:
[legend]

Classes

struct  tStructInfo
 

Public Member Functions

 cDDLInspector (bool bAutoCorrect=false)
 CTOR. More...
 
virtual ~cDDLInspector ()
 DTOR.
 
virtual tResult VisitDDL (cDDLDescription *poDescription)
 Visitor for a whole DDL description. More...
 
virtual tResult Visit (cDDLHeader *poHeader)
 Visitor for DDL header objects. More...
 
virtual tResult Visit (cDDLDataType *poDataType)
 Visitor for DDL datatype objects. More...
 
virtual tResult Visit (cDDLComplex *poComplex)
 Visitor for DDL struct objects. More...
 
virtual tResult Visit (cDDLStream *poStream)
 Visitor for DDL stream objects. More...
 
virtual tResult Visit (cDDLUnit *poUnit)
 Visitor for DDL unit objects. More...
 
virtual tResult Visit (cDDLBaseunit *poBaseunit)
 Visitor for DDL baseunit objects. More...
 
virtual tResult Visit (cDDLExtDeclaration *poExtDeclaration)
 Visitor for external DDL declaration objects. More...
 
virtual tResult Visit (cDDLElement *poElement)
 Visitor for DDL element objects. More...
 
virtual tResult Visit (cDDLPrefix *poPrefix)
 Visitor for DDL prefix objects. More...
 
virtual tResult Visit (cDDLRefUnit *poRefUnit)
 Visitor for DDL reference unit objects. More...
 
virtual tResult Visit (cDDLStreamStruct *poStreamStruct)
 Visitor for DDL streamstruct objects. More...
 
virtual tResult Visit (cDDLEnum *poEnum)
 Visitor for DDL enum objects. More...
 
virtual tResult Visit (cDDLStreamMetaType *poStreamMetaType)
 Visitor for DDL stream meta type objects. More...
 
virtual tResult Visit (cDDLProperty *poProperty)
 Visitor for DDL property objects. More...
 
void SetAutoCorrect (bool bAutoCorrect)
 Setter for the auto-correction flag. More...
 
bool GetAutoCorrect () const
 Getter for the auto-correction flag. More...
 
tImporterMsgList GetSuggestions () const
 Getter for the list of suggestions. More...
 
A_UTILS_NS::cString GetLastErrorDesc () const
 Getter for the most recent error description. More...
 
void InitNewCheck ()
 Init a new Check, clear all list and init all variables.
 
unsigned int GetLastBytePosOfAStructCorrected (const A_UTILS_NS::cString &strStructName)
 Returns the last corrected Bytepos position inclusive the last Element size. More...
 
unsigned int GetLastBytePosOfAStructReal (const A_UTILS_NS::cString &strStructName)
 Returns the actual last Bytepos inclusive the last Element size. More...
 
- Public Member Functions inherited from IDDLVisitor
virtual ~IDDLVisitor ()
 DTOR.
 

Static Public Member Functions

static tImporterMsgList CheckValidyOfNestedStructs (const cDDLDescription *poDescription)
 Check the validy of nested structs. More...
 

Protected Member Functions

tResult AddSuggestion (A_UTILS_NS::cString const &strDesc, tImporterMsgSeverity const eSeverity)
 Method for derived classes to add an own suggestion. More...
 
virtual bool IsAlignable (size_t const posBytePos, size_t const szElementSize)
 Helper method to check if the element is alignable. More...
 

Static Protected Member Functions

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-side one (as returned by operator <) based on given DDL type information. More...
 

Static Private Member Functions

static bool CheckValidyOfNestedStructs (const cDDLDescription *poDescription, const A_UTILS_NS::cString &strStructTypeName, const A_UTILS_NS::cString &strNestedStructTypeName, A_UTILS_NS::cString &strLog, int nStructDepth=1)
 Recursive helper function for check of the validy of nested structs within a struct. More...
 

Private Attributes

cDDLDescriptionm_poDDL
 
bool m_bAutoCorrect
 
tImporterMsgList m_lstSuggestions
 The list contains all warnings and errors.
 
A_UTILS_NS::cStringList m_strLstComplexName
 The list contains all names of the structs. More...
 
A_UTILS_NS::cStringList m_strLstDataTypesName
 The list contains all names of the data types. More...
 
A_UTILS_NS::cStringList m_strLstEnumsName
 The list contains all names of the enum. More...
 
A_UTILS_NS::cStringList m_strLstEnumsValues
 The list contains all names of the enum values. More...
 
A_UTILS_NS::cStringList m_strLstBaseunitName
 The list contains all names of the base unit names. More...
 
A_UTILS_NS::cStringList m_strLstStreamsName
 The list contains all names of the streams. More...
 
A_UTILS_NS::cStringList m_strLstPrefixName
 The list contains all names of the prefixes. More...
 
A_UTILS_NS::cStringList m_strLstUnitName
 The list contains all names of the unit names. More...
 
double m_fVersion
 
bool m_bHasDynamicArrays
 
std::map< cDDLComplex *, tStructInfom_mapStructInfos
 

Detailed Description

Validation and correction class for ADTF DDL for use with the.

Definition at line 21 of file ddlinspector.h.

Constructor & Destructor Documentation

◆ cDDLInspector()

cDDLInspector ( bool  bAutoCorrect = false)

CTOR.

Parameters
[in]bAutoCorrect- Flag for implicit auto-correction (optional)

Member Function Documentation

◆ AddSuggestion()

tResult AddSuggestion ( A_UTILS_NS::cString const &  strDesc,
tImporterMsgSeverity const  eSeverity 
)
protected

Method for derived classes to add an own suggestion.

Parameters
[in]strDescSuggestion message
[in]eSeverityMessage severity
Return values
ERR_EMPTYThe suggestion message must not be empty.
ERR_INVALID_ARGThe message severity must have a valid value of type adtf::tImporterMsgSeverity.

◆ CheckValidyOfNestedStructs() [1/2]

static tImporterMsgList CheckValidyOfNestedStructs ( const cDDLDescription poDescription)
static

Check the validy of nested structs.

Parameters
[in]poDescription- pointer of the Description within you want to check a vality of nested structs
Return values
Errormessage list

◆ CheckValidyOfNestedStructs() [2/2]

static bool CheckValidyOfNestedStructs ( const cDDLDescription poDescription,
const A_UTILS_NS::cString strStructTypeName,
const A_UTILS_NS::cString strNestedStructTypeName,
A_UTILS_NS::cString strLog,
int  nStructDepth = 1 
)
staticprivate

Recursive helper function for check of the validy of nested structs within a struct.

Parameters
[in]poDescription- pointer of the Description within you want to check a vality of a struct
[in]strStructTypeName- name of the Struct where you want to check for invalid nested structs
[in]strNestedStructTypeName- name of the nested Struct
[out]strLog- Log of error message, if validy is failed
[in]nStructDepth- Depth of the nested stuct
Return values
trueif valid
falseotherwise

◆ GetAutoCorrect()

bool GetAutoCorrect ( ) const

Getter for the auto-correction flag.

Returns
the flag

◆ GetLastBytePosOfAStructCorrected()

unsigned int GetLastBytePosOfAStructCorrected ( const A_UTILS_NS::cString strStructName)

Returns the last corrected Bytepos position inclusive the last Element size.

Parameters
[in]strStructName- name of the Struct where you want the last element
Returns
Last corrected Bytepos position inclusive the last Element size.

◆ GetLastBytePosOfAStructReal()

unsigned int GetLastBytePosOfAStructReal ( const A_UTILS_NS::cString strStructName)

Returns the actual last Bytepos inclusive the last Element size.

Parameters
[in]strStructName- name of the Struct where you want the last element
Returns
Actual last Bytepos inclusive the last Element size.

◆ GetLastErrorDesc()

A_UTILS_NS::cString GetLastErrorDesc ( ) const

Getter for the most recent error description.

Returns
The error description or A_UTILS_NS::cString::Empty if there was none.
Remarks
This method indeed returns the last error message (message with severity eImporterError).

◆ GetSuggestions()

tImporterMsgList GetSuggestions ( ) const

Getter for the list of suggestions.

Returns
the list of suggestions

◆ IsAlignable()

virtual bool IsAlignable ( size_t const  posBytePos,
size_t const  szElementSize 
)
protectedvirtual

Helper method to check if the element is alignable.

Parameters
[in]posBytePos- Current byte position inside the structure
[in]szElementSize- Size of the element
Return values
trueElement is alignable
falseElement is not alignable

◆ LessDDL()

static bool LessDDL ( const A_UTILS_NS::cString strLHS,
const A_UTILS_NS::cString strRHS,
const cDDLDataType poType 
)
staticprotected

Helper method which returns whether the left-hand-side argument compares less than the right-hand-side one (as returned by operator <) based on given DDL type information.

Parameters
[in]strLHSString of the left-hand-side
[in]strRHSString of the right-hand-side
[in]poTypePointer to common type information
Return values
trueLHS is lower than RHS
falseLHS is not lower than RHS or type is not interpretable

◆ SetAutoCorrect()

void SetAutoCorrect ( bool  bAutoCorrect)

Setter for the auto-correction flag.

Parameters
[in]bAutoCorrect- New value of the flag
Returns
void

◆ Visit() [1/14]

virtual tResult Visit ( cDDLBaseunit poBaseunit)
virtual

Visitor for DDL baseunit objects.

Parameters
[in]poBaseunit- Pointer to the baseunit object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ Visit() [2/14]

virtual tResult Visit ( cDDLComplex poStruct)
virtual

Visitor for DDL struct objects.

Parameters
[in]poStruct- Pointer to the struct object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ Visit() [3/14]

virtual tResult Visit ( cDDLDataType poDataType)
virtual

Visitor for DDL datatype objects.

Parameters
[in]poDataType- Pointer to the datatype object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.
ERR_NOT_SUPPORTEDData type detected which is not supported.

Implements IDDLVisitor.

◆ Visit() [4/14]

virtual tResult Visit ( cDDLElement poElement)
virtual

Visitor for DDL element objects.

Parameters
[in]poElement- Pointer to the element object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ Visit() [5/14]

virtual tResult Visit ( cDDLEnum poEnum)
virtual

Visitor for DDL enum objects.

Parameters
[in]poEnum- Pointer to the enum object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ Visit() [6/14]

virtual tResult Visit ( cDDLExtDeclaration poExtDeclaration)
virtual

Visitor for external DDL declaration objects.

Parameters
[in]poExtDeclaration- Pointer to the extdeclaration object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ Visit() [7/14]

virtual tResult Visit ( cDDLHeader poHeader)
virtual

Visitor for DDL header objects.

Parameters
[in]poHeader- Pointer to the header object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ Visit() [8/14]

virtual tResult Visit ( cDDLPrefix poPrefix)
virtual

Visitor for DDL prefix objects.

Parameters
[in]poPrefix- Pointer to the prefix object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ Visit() [9/14]

virtual tResult Visit ( cDDLProperty poProperty)
virtual

Visitor for DDL property objects.

Parameters
[in]poProperty- Pointer to the object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ Visit() [10/14]

virtual tResult Visit ( cDDLRefUnit poRefUnit)
virtual

Visitor for DDL reference unit objects.

Parameters
[in]poRefUnit- Pointer to the refunit object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ Visit() [11/14]

virtual tResult Visit ( cDDLStream poStream)
virtual

Visitor for DDL stream objects.

Parameters
[in]poStream- Pointer to the stream object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ Visit() [12/14]

virtual tResult Visit ( cDDLStreamMetaType poStreamMetaType)
virtual

Visitor for DDL stream meta type objects.

Parameters
[in]poStreamMetaType- Pointer to the object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ Visit() [13/14]

virtual tResult Visit ( cDDLStreamStruct poStreamStruct)
virtual

Visitor for DDL streamstruct objects.

Parameters
[in]poStreamStruct- Pointer to the streamstruct object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ Visit() [14/14]

virtual tResult Visit ( cDDLUnit poUnit)
virtual

Visitor for DDL unit objects.

Parameters
[in]poUnit- Pointer to the unit object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.

Implements IDDLVisitor.

◆ VisitDDL()

virtual tResult VisitDDL ( cDDLDescription poDescription)
virtual

Visitor for a whole DDL description.

Parameters
[in]poDescription- Pointer to the description object
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.
ERR_NOT_INITIALIZEDNot yet initialized

Implements IDDLVisitor.

Member Data Documentation

◆ m_strLstBaseunitName

A_UTILS_NS::cStringList m_strLstBaseunitName
private

The list contains all names of the base unit names.

If the list contains two equal names, it will be set an error in the tImporterMsgList.

Definition at line 201 of file ddlinspector.h.

◆ m_strLstComplexName

A_UTILS_NS::cStringList m_strLstComplexName
private

The list contains all names of the structs.

If the list contains two equal names, it will be set an error in the tImporterMsgList.

Definition at line 173 of file ddlinspector.h.

◆ m_strLstDataTypesName

A_UTILS_NS::cStringList m_strLstDataTypesName
private

The list contains all names of the data types.

If the list contains two equal names, it will be set an error in the tImporterMsgList.

Definition at line 180 of file ddlinspector.h.

◆ m_strLstEnumsName

A_UTILS_NS::cStringList m_strLstEnumsName
private

The list contains all names of the enum.

If the list contains two equal names, it will be set an error in the tImporterMsgList.

Definition at line 187 of file ddlinspector.h.

◆ m_strLstEnumsValues

A_UTILS_NS::cStringList m_strLstEnumsValues
private

The list contains all names of the enum values.

If the list contains two equal names, it will be set an warning in the tImporterMsgList.

Definition at line 194 of file ddlinspector.h.

◆ m_strLstPrefixName

A_UTILS_NS::cStringList m_strLstPrefixName
private

The list contains all names of the prefixes.

If the list contains two equal names, it will be set an error in the tImporterMsgList.

Definition at line 215 of file ddlinspector.h.

◆ m_strLstStreamsName

A_UTILS_NS::cStringList m_strLstStreamsName
private

The list contains all names of the streams.

If the list contains two equal names, it will be set an error in the tImporterMsgList.

Definition at line 208 of file ddlinspector.h.

◆ m_strLstUnitName

A_UTILS_NS::cStringList m_strLstUnitName
private

The list contains all names of the unit names.

If the list contains two equal names, it will be set an error in the tImporterMsgList.

Definition at line 222 of file ddlinspector.h.