Validation and correction class for ADTF DDL for use with the. More...
#include <ddlinspector.h>
Classes | |
struct | tStructInfo |
Public Member Functions | |
cDDLInspector (bool bAutoCorrect=false) | |
CTOR. | |
virtual | ~cDDLInspector () |
DTOR. | |
virtual tResult | VisitDDL (cDDLDescription *poDescription) |
Visitor for a whole DDL description. | |
virtual tResult | Visit (cDDLHeader *poHeader) |
Visitor for DDL header objects. | |
virtual tResult | Visit (cDDLDataType *poDataType) |
Visitor for DDL datatype objects. | |
virtual tResult | Visit (cDDLComplex *poComplex) |
Visitor for DDL struct objects. | |
virtual tResult | Visit (cDDLStream *poStream) |
Visitor for DDL stream objects. | |
virtual tResult | Visit (cDDLUnit *poUnit) |
Visitor for DDL unit objects. | |
virtual tResult | Visit (cDDLBaseunit *poBaseunit) |
Visitor for DDL baseunit objects. | |
virtual tResult | Visit (cDDLExtDeclaration *poExtDeclaration) |
Visitor for external DDL declaration objects. | |
virtual tResult | Visit (cDDLElement *poElement) |
Visitor for DDL element objects. | |
virtual tResult | Visit (cDDLPrefix *poPrefix) |
Visitor for DDL prefix objects. | |
virtual tResult | Visit (cDDLRefUnit *poRefUnit) |
Visitor for DDL reference unit objects. | |
virtual tResult | Visit (cDDLStreamStruct *poStreamStruct) |
Visitor for DDL streamstruct objects. | |
virtual tResult | Visit (cDDLEnum *poEnum) |
Visitor for DDL enum objects. | |
virtual tResult | Visit (cDDLStreamMetaType *poStreamMetaType) |
Visitor for DDL stream meta type objects. | |
virtual tResult | Visit (cDDLProperty *poProperty) |
Visitor for DDL property objects. | |
void | SetAutoCorrect (bool bAutoCorrect) |
Setter for the auto-correction flag. | |
bool | GetAutoCorrect () const |
Getter for the auto-correction flag. | |
tImporterMsgList | GetSuggestions () const |
Getter for the list of suggestions. | |
A_UTILS_NS::cString | GetLastErrorDesc () const |
Getter for the most recent error description. | |
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. | |
unsigned int | GetLastBytePosOfAStructReal (const A_UTILS_NS::cString &strStructName) |
Returns the actual last Bytepos inclusive the last Element size. | |
![]() | |
virtual | ~IDDLVisitor () |
DTOR. | |
Static Public Member Functions | |
static tImporterMsgList | CheckValidyOfNestedStructs (const cDDLDescription *poDescription) |
Check the validy of nested structs. | |
Protected Member Functions | |
tResult | AddSuggestion (A_UTILS_NS::cString const &strDesc, tImporterMsgSeverity const eSeverity) |
Method for derived classes to add an own suggestion. | |
virtual bool | IsAlignable (size_t const posBytePos, size_t const szElementSize) |
Helper method to check if the element is alignable. | |
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. | |
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. | |
Private Attributes | |
cDDLDescription * | m_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. | |
A_UTILS_NS::cStringList | m_strLstDataTypesName |
The list contains all names of the data types. | |
A_UTILS_NS::cStringList | m_strLstEnumsName |
The list contains all names of the enum. | |
A_UTILS_NS::cStringList | m_strLstEnumsValues |
The list contains all names of the enum values. | |
A_UTILS_NS::cStringList | m_strLstBaseunitName |
The list contains all names of the base unit names. | |
A_UTILS_NS::cStringList | m_strLstStreamsName |
The list contains all names of the streams. | |
A_UTILS_NS::cStringList | m_strLstPrefixName |
The list contains all names of the prefixes. | |
A_UTILS_NS::cStringList | m_strLstUnitName |
The list contains all names of the unit names. | |
double | m_fVersion |
bool | m_bHasDynamicArrays |
std::map< cDDLComplex *, tStructInfo > | m_mapStructInfos |
Validation and correction class for ADTF DDL for use with the.
Definition at line 21 of file ddlinspector.h.
cDDLInspector | ( | bool | bAutoCorrect = false | ) |
CTOR.
[in] | bAutoCorrect | - Flag for implicit auto-correction (optional) |
References cDDLInspector().
Referenced by cDDLInspector(), and ~cDDLInspector().
|
protected |
Method for derived classes to add an own suggestion.
[in] | strDesc | Suggestion message |
[in] | eSeverity | Message severity |
ERR_EMPTY | The suggestion message must not be empty. |
ERR_INVALID_ARG | The message severity must have a valid value of type adtf::tImporterMsgSeverity . |
References AddSuggestion().
Referenced by AddSuggestion().
|
static |
Check the validy of nested structs.
[in] | poDescription | - pointer of the Description within you want to check a vality of nested structs |
Error | message list |
References CheckValidyOfNestedStructs().
Referenced by CheckValidyOfNestedStructs(), and CheckValidyOfNestedStructs().
|
staticprivate |
Recursive helper function for check of the validy of nested structs within a struct.
[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 |
true | if valid |
false | otherwise |
References CheckValidyOfNestedStructs().
bool GetAutoCorrect | ( | ) | const |
Getter for the auto-correction flag.
References GetAutoCorrect().
Referenced by GetAutoCorrect().
unsigned int GetLastBytePosOfAStructCorrected | ( | const A_UTILS_NS::cString & | strStructName | ) |
Returns the last corrected Bytepos position inclusive the last Element size.
[in] | strStructName | - name of the Struct where you want the last element |
References GetLastBytePosOfAStructCorrected().
Referenced by GetLastBytePosOfAStructCorrected().
unsigned int GetLastBytePosOfAStructReal | ( | const A_UTILS_NS::cString & | strStructName | ) |
Returns the actual last Bytepos inclusive the last Element size.
[in] | strStructName | - name of the Struct where you want the last element |
References GetLastBytePosOfAStructReal().
Referenced by GetLastBytePosOfAStructReal().
A_UTILS_NS::cString GetLastErrorDesc | ( | ) | const |
Getter for the most recent error description.
A_UTILS_NS::cString::Empty
if there was none. eImporterError
). References GetLastErrorDesc().
Referenced by GetLastErrorDesc().
tImporterMsgList GetSuggestions | ( | ) | const |
Getter for the list of suggestions.
References GetSuggestions().
Referenced by GetSuggestions().
|
protectedvirtual |
Helper method to check if the element is alignable.
[in] | posBytePos | - Current byte position inside the structure |
[in] | szElementSize | - Size of the element |
true | Element is alignable |
false | Element is not alignable |
References IsAlignable().
Referenced by IsAlignable().
|
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.
[in] | strLHS | String of the left-hand-side |
[in] | strRHS | String of the right-hand-side |
[in] | poType | Pointer to common type information |
true | LHS is lower than RHS |
false | LHS is not lower than RHS or type is not interpretable |
References LessDDL().
Referenced by LessDDL().
void SetAutoCorrect | ( | bool | bAutoCorrect | ) |
Setter for the auto-correction flag.
[in] | bAutoCorrect | - New value of the flag |
References SetAutoCorrect().
Referenced by SetAutoCorrect().
|
virtual |
Visitor for DDL baseunit objects.
[in] | poBaseunit | - Pointer to the baseunit object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
|
virtual |
Visitor for DDL struct objects.
[in] | poStruct | - Pointer to the struct object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
|
virtual |
Visitor for DDL datatype objects.
[in] | poDataType | - Pointer to the datatype object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
ERR_NOT_SUPPORTED | Data type detected which is not supported. |
Implements IDDLVisitor.
References Visit().
|
virtual |
Visitor for DDL element objects.
[in] | poElement | - Pointer to the element object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
Visitor for DDL enum objects.
[in] | poEnum | - Pointer to the enum object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
|
virtual |
Visitor for external DDL declaration objects.
[in] | poExtDeclaration | - Pointer to the extdeclaration object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
|
virtual |
Visitor for DDL header objects.
[in] | poHeader | - Pointer to the header object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
Referenced by Visit(), Visit(), Visit(), Visit(), Visit(), Visit(), Visit(), Visit(), Visit(), Visit(), Visit(), Visit(), Visit(), and Visit().
|
virtual |
Visitor for DDL prefix objects.
[in] | poPrefix | - Pointer to the prefix object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
|
virtual |
Visitor for DDL property objects.
[in] | poProperty | - Pointer to the object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
|
virtual |
Visitor for DDL reference unit objects.
[in] | poRefUnit | - Pointer to the refunit object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
|
virtual |
Visitor for DDL stream objects.
[in] | poStream | - Pointer to the stream object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
|
virtual |
Visitor for DDL stream meta type objects.
[in] | poStreamMetaType | - Pointer to the object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
|
virtual |
Visitor for DDL streamstruct objects.
[in] | poStreamStruct | - Pointer to the streamstruct object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
Visitor for DDL unit objects.
[in] | poUnit | - Pointer to the unit object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
Implements IDDLVisitor.
References Visit().
|
virtual |
Visitor for a whole DDL description.
[in] | poDescription | - Pointer to the description object |
ERR_POINTER | Null-pointer committed |
ERR_NOT_FOUND | Required node not found. |
ERR_NOT_INITIALIZED | Not yet initialized |
Implements IDDLVisitor.
References VisitDDL().
Referenced by VisitDDL().
|
private |
Definition at line 162 of file ddlinspector.h.
|
private |
Definition at line 226 of file ddlinspector.h.
|
private |
Definition at line 224 of file ddlinspector.h.
|
private |
The list contains all warnings and errors.
Definition at line 166 of file ddlinspector.h.
|
private |
Definition at line 236 of file ddlinspector.h.
|
private |
Definition at line 161 of file ddlinspector.h.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.