ADTF
3.18.2
|
Validation Info model will check for validation. More...
Public Types | |
enum | ValidationLevel : uint8_t { dont_know , invalid , good_enough , valid } |
Validation level. More... | |
enum class | UpdateType { all = 0 , only_last = 1 } |
Update type for the struct update. More... | |
using | Problem = ddl::dd::Problem |
Validation Problem to report. | |
Public Member Functions | |
DEV_ESSENTIAL_DEPRECATED_VALIDATION_API | ValidationInfo ()=default |
default CTOR | |
DEV_ESSENTIAL_DEPRECATED_VALIDATION_API | ValidationInfo (datamodel::Unit &unit, datamodel::DataDefinition &parent_dd) |
CTOR and immediatelly update a Validation Info for units. More... | |
DEV_ESSENTIAL_DEPRECATED_VALIDATION_API | ValidationInfo (datamodel::DataType &data_type, datamodel::DataDefinition &parent_dd) |
CTOR and immediatelly update a Validation Info for data_types. More... | |
DEV_ESSENTIAL_DEPRECATED_VALIDATION_API | ValidationInfo (datamodel::EnumType &enum_type, datamodel::DataDefinition &parent_dd) |
CTOR and immediatelly update a Validation Info for enum_type. More... | |
DEV_ESSENTIAL_DEPRECATED_VALIDATION_API | ValidationInfo (datamodel::Stream &stream, datamodel::DataDefinition &parent_dd) |
CTOR and immediatelly update a Validation Info for streams. More... | |
virtual | ~ValidationInfo () |
DTOR. | |
bool | isValid (ValidationLevel level=ValidationLevel::valid) const |
checks if the validation level is reached More... | |
void | forceRevalidation () |
sets the Info to invalid to force revalidation | |
ValidationLevel | getValidationLevel () const |
Get the Validation Level. More... | |
std::vector< Problem > | getProblems () const |
Get the Validation Problems (only set if below "valid") More... | |
void | addProblem (ValidationServiceInfo::ValidationProblem &&problem) |
adds a problem More... | |
void | addProblem (const ValidationServiceInfo::ValidationProblem &problem) |
adds a problem More... | |
void | removeProblems (datamodel::DataDefinition &parent_dd) |
Remove all problems. | |
void | update (datamodel::Unit &unit, datamodel::DataDefinition &parent_dd) |
Update and revalidate the unit. More... | |
void | update (datamodel::DataType &data_type, datamodel::DataDefinition &parent_dd) |
Update and revalidate the data_type. More... | |
void | update (datamodel::EnumType &enum_type, datamodel::DataDefinition &parent_dd) |
Update and revalidate the enum_type. More... | |
void | update (datamodel::StructType &struct_type, datamodel::DataDefinition &parent_dd, UpdateType update_type=UpdateType::all) |
Update and revalidate the struct_type. More... | |
void | update (datamodel::StreamMetaType &stream_meta_type, datamodel::DataDefinition &parent_dd) |
Update and revalidate the stream_meta_type. More... | |
void | update (datamodel::Stream &stream, datamodel::DataDefinition &parent_dd) |
Update and revalidate the stream. More... | |
Public Member Functions inherited from IInfo | |
virtual | ~IInfo ()=default |
virtual DTOR for IInfo object | |
Static Public Attributes | |
static constexpr const uint8_t | INFO_TYPE_ID = dd::InfoType::validation_info |
the type info id to use the datamodel::Info template. | |
Private Member Functions | |
void | addProblem (const std::shared_ptr< ValidationServiceInfo::ValidationProblem > &problem) |
Private Attributes | |
bool | _currently_on_validation = false |
std::map< uint8_t, std::unordered_map< ValidationServiceInfo::ValidationProblemId, std::shared_ptr< ValidationServiceInfo::ValidationProblem > > > | _validation_problems |
ValidationServiceInfo * | _current_validation_service = {} |
bool | _is_validated = false |
Additional Inherited Members | |
Protected Member Functions inherited from Info< ValidationInfo > | |
uint8_t | getInfoType () const override |
Get the Info Type object. More... | |
Validation Info model will check for validation.
Sometimes the TypeInfo must be already set before this validation can be performed.
Definition at line 420 of file dd_validationinfomodel.h.
|
strong |
Update type for the struct update.
Enumerator | |
---|---|
all | update all elements validation info |
only_last | update the last element only |
Definition at line 579 of file dd_validationinfomodel.h.
enum ValidationLevel : uint8_t |
Validation level.
This is used now used only for binary compatibility here.
Enumerator | |
---|---|
dont_know | The validation is not known. This means it is not calculated yet. Use i.e. ddl::dd::DataDefinition::validate |
invalid | the validation level is invalid, dependencies can not be obtained or the dependency "to" is invalid (struct to struct i.e.). |
good_enough | Structs and elements can be "good_enough" for the TypeInfo. This means the Coder and Decoder can calculate the sizes and the all access Functions can obtain values. Usually this should be the valid state. The problem is, that there are DataDefinition out there (in the users world) using i.e. units, but does not define the unit within that DD. At this point we do not want to break that code! So good enough means: Not well defined in some cases, but good enough for calculate byte positions and TypeInfo. Only structs, enums and datatypes may have a validationlevel of "good_enough" if there are any other DD Objects used in a DataDefinition and they are "invalid", the DD will also set to "invalid"! |
valid | every thing is well defined. |
Definition at line 471 of file dd_validationinfomodel.h.
DEV_ESSENTIAL_DEPRECATED_VALIDATION_API ValidationInfo | ( | datamodel::Unit & | unit, |
datamodel::DataDefinition & | parent_dd | ||
) |
CTOR and immediatelly update a Validation Info for units.
unit | the unit to update the validation info |
parent_dd | the parent DD to retrieve dependencies |
DEV_ESSENTIAL_DEPRECATED_VALIDATION_API ValidationInfo | ( | datamodel::DataType & | data_type, |
datamodel::DataDefinition & | parent_dd | ||
) |
CTOR and immediatelly update a Validation Info for data_types.
data_type | the data_type to update the validation info |
parent_dd | the parent DD to retrieve dependencies |
DEV_ESSENTIAL_DEPRECATED_VALIDATION_API ValidationInfo | ( | datamodel::EnumType & | enum_type, |
datamodel::DataDefinition & | parent_dd | ||
) |
CTOR and immediatelly update a Validation Info for enum_type.
enum_type | the enum_type to update the validation info |
parent_dd | the parent DD to retrieve dependencies |
DEV_ESSENTIAL_DEPRECATED_VALIDATION_API ValidationInfo | ( | datamodel::Stream & | stream, |
datamodel::DataDefinition & | parent_dd | ||
) |
CTOR and immediatelly update a Validation Info for streams.
stream | the stream to update the validation info |
parent_dd | the parent DD to retrieve dependencies |
void addProblem | ( | const ValidationServiceInfo::ValidationProblem & | problem | ) |
adds a problem
problem | the prpblem to add |
void addProblem | ( | ValidationServiceInfo::ValidationProblem && | problem | ) |
adds a problem
problem | the problem to add |
std::vector<Problem> getProblems | ( | ) | const |
Get the Validation Problems (only set if below "valid")
ValidationLevel getValidationLevel | ( | ) | const |
Get the Validation Level.
bool isValid | ( | ValidationLevel | level = ValidationLevel::valid | ) | const |
checks if the validation level is reached
level | can only be "good_enough" or "valid" |
level
is reached level
is NOT reached void update | ( | datamodel::DataType & | data_type, |
datamodel::DataDefinition & | parent_dd | ||
) |
Update and revalidate the data_type.
data_type | the unit to validate |
parent_dd | the parent DD |
void update | ( | datamodel::EnumType & | enum_type, |
datamodel::DataDefinition & | parent_dd | ||
) |
Update and revalidate the enum_type.
enum_type | the unit to validate |
parent_dd | the parent DD |
void update | ( | datamodel::Stream & | stream, |
datamodel::DataDefinition & | parent_dd | ||
) |
Update and revalidate the stream.
stream | the stream to validate |
parent_dd | the parent DD |
void update | ( | datamodel::StreamMetaType & | stream_meta_type, |
datamodel::DataDefinition & | parent_dd | ||
) |
Update and revalidate the stream_meta_type.
stream_meta_type | the stream_meta_type to validate |
parent_dd | the parent DD |
void update | ( | datamodel::StructType & | struct_type, |
datamodel::DataDefinition & | parent_dd, | ||
UpdateType | update_type = UpdateType::all |
||
) |
Update and revalidate the struct_type.
struct_type | the struct_type to validate |
parent_dd | the parent DD |
update_type | update type to determine to validate only the last added element or all |
void update | ( | datamodel::Unit & | unit, |
datamodel::DataDefinition & | parent_dd | ||
) |
Update and revalidate the unit.
unit | the unit to validate |
parent_dd | the parent DD |