ADTF
3.18.2
|
Validation Service Info used only as one global instance at the dd::DataDefinition. More...
Classes | |
struct | Dependency |
dependency More... | |
struct | InvalidatedTypes |
Return structure for forceRevalidationOfTypeDependencies call. More... | |
class | ValidationProblem |
A Validation problem. More... | |
Public Types | |
enum | DependencyType : uint8_t { unit_to_unit_prefix , unit_to_base_unit , data_type_to_unit , data_type_to_base_unit , enum_type_to_data_type , struct_type_to_data_type , struct_type_to_enum_type , struct_type_to_struct_type , struct_type_to_unit , struct_type_to_base_unit , stream_meta_type_to_stream_meta_type , stream_to_stream_meta_type , stream_to_struct_type } |
dependency type for loose coupling More... | |
typedef std::unordered_map< std::string, std::unordered_set< std::string > > | ToFromMap |
dependencies are stored in ToFrom maps (not in FromTo maps) to raise performance. | |
using | ValidationProblemId = void * |
Id to identify a concrete validation problem entry. | |
Public Member Functions | |
DEV_ESSENTIAL_DEPRECATED_VALIDATION_API | ValidationServiceInfo ()=default |
default CTOR | |
void | addDependency (const Dependency &dependency) |
add the dependency to the depemndency model More... | |
void | removed (const datamodel::BaseUnit &base_unit, datamodel::DataDefinition &parent_dd) |
A base unit was removed. More... | |
void | removed (const datamodel::UnitPrefix &unit_prefix, datamodel::DataDefinition &parent_dd) |
A unit prefix was removed. More... | |
void | removed (const datamodel::Unit &unit, datamodel::DataDefinition &parent_dd) |
A unit was removed. More... | |
void | removed (const datamodel::DataType &data_type, datamodel::DataDefinition &parent_dd) |
A data_type was removed. More... | |
void | removed (const datamodel::EnumType &enum_type, datamodel::DataDefinition &parent_dd) |
A enum_type was removed. More... | |
void | removed (const datamodel::StructType &struct_type, datamodel::DataDefinition &parent_dd) |
A struct_type was removed. More... | |
void | removed (const datamodel::StreamMetaType &stream_meta_type, datamodel::DataDefinition &parent_dd) |
A stream_meta_type was removed. More... | |
void | removed (const datamodel::Stream &stream, datamodel::DataDefinition &parent_dd) |
A stream was removed. More... | |
void | renamed (const datamodel::BaseUnit &base_unit, const std::string &old_name, datamodel::DataDefinition &parent_dd) |
Update all dependency to the renamed base_unit. More... | |
void | renamed (const datamodel::UnitPrefix &unit_prefix, const std::string &old_name, datamodel::DataDefinition &parent_dd) |
Update all dependency to the renamed unit_prefix. More... | |
void | renamed (const datamodel::Unit &unit, const std::string &old_name, datamodel::DataDefinition &parent_dd) |
Update all dependency to the renamed unit. More... | |
void | renamed (const datamodel::DataType &data_type, const std::string &old_name, datamodel::DataDefinition &parent_dd) |
Update all dependency to the renamed data_type. More... | |
void | renamed (const datamodel::EnumType &enum_type, const std::string &old_name, datamodel::DataDefinition &parent_dd) |
Update all dependency to the renamed enum_type. More... | |
void | renamed (const datamodel::StructType &struct_type, const std::string &old_name, datamodel::DataDefinition &parent_dd) |
Update all dependency to the renamed struct_type. More... | |
void | renamed (const datamodel::StreamMetaType &stream_meta_type, const std::string &old_name, datamodel::DataDefinition &parent_dd) |
Update all dependency to the renamed base_stream_meta_typeunit. More... | |
void | renamed (const datamodel::Stream &stream, const std::string &old_name, datamodel::DataDefinition &parent_dd) |
Update all dependency to the renamed stream. More... | |
bool | validationNeeded () const |
this will internally prevent multiple revalidations More... | |
void | forceRevalidationOfTypeDependencies (const std::string &type_name, ddl::dd::TypeOfType type, datamodel::DataDefinition &parent_dd, InvalidatedTypes &invalidated_types_to_return) const |
Collect all dependent types to the given one and sets them invalid. More... | |
void | updateProblem (ValidationProblemId id, const std::shared_ptr< const ValidationProblem > &problem) |
updates or add a problem entry by id More... | |
void | removeProblem (ValidationProblemId id, ValidationLevel level) |
Removes a validation propbelm entry by id and level. More... | |
ValidationLevel | getValidationLevel () const |
Get the current Validation Level. More... | |
std::vector< Problem > | getProblems () const |
Get all current known problems of validation. 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_service_info |
definiton of info type to use the datamodel::Info | |
Private Attributes | |
std::unordered_map< uint8_t, ToFromMap > | _dependencies |
dependencies are stored in ToFrom maps (not in FromTo maps) | |
std::map< uint8_t, std::unordered_map< ValidationProblemId, std::shared_ptr< const ValidationProblem > > > | _validation_problems |
bool | _validation_needed = true |
Additional Inherited Members | |
Protected Member Functions inherited from Info< ValidationServiceInfo > | |
uint8_t | getInfoType () const override |
Get the Info Type object. More... | |
Validation Service Info used only as one global instance at the dd::DataDefinition.
It keeps the model consistent while renaming types, unit, enum values, streammetatypes while using a loose coupling.
Definition at line 47 of file dd_validationinfomodel.h.
enum DependencyType : uint8_t |
dependency type for loose coupling
Definition at line 56 of file dd_validationinfomodel.h.
void addDependency | ( | const Dependency & | dependency | ) |
add the dependency to the depemndency model
dependency | to add. |
void forceRevalidationOfTypeDependencies | ( | const std::string & | type_name, |
ddl::dd::TypeOfType | type, | ||
datamodel::DataDefinition & | parent_dd, | ||
InvalidatedTypes & | invalidated_types_to_return | ||
) | const |
Collect all dependent types to the given one and sets them invalid.
type_name | the type_name looking for dependencies |
type | the type of the given type_name |
parent_dd | the dd where to set forceRevalidation |
invalidated_types_to_return | the invalidated types collection as return value |
std::vector<Problem> getProblems | ( | ) | const |
Get all current known problems of validation.
ValidationLevel getValidationLevel | ( | ) | const |
Get the current Validation Level.
void removed | ( | const datamodel::BaseUnit & | base_unit, |
datamodel::DataDefinition & | parent_dd | ||
) |
A base unit was removed.
base_unit | the base unit that is removed |
parent_dd | the parent DD |
void removed | ( | const datamodel::DataType & | data_type, |
datamodel::DataDefinition & | parent_dd | ||
) |
A data_type was removed.
This will invalidate all dependent structs using the data_type!
data_type | the data_type that is removed |
parent_dd | the parent DD |
void removed | ( | const datamodel::EnumType & | enum_type, |
datamodel::DataDefinition & | parent_dd | ||
) |
A enum_type was removed.
This will invalidate all dependent structs using the enum_type!
enum_type | the enum_type that is removed |
parent_dd | the parent DD |
void removed | ( | const datamodel::Stream & | stream, |
datamodel::DataDefinition & | parent_dd | ||
) |
A stream was removed.
stream | the stream that is removed |
parent_dd | the parent DD |
void removed | ( | const datamodel::StreamMetaType & | stream_meta_type, |
datamodel::DataDefinition & | parent_dd | ||
) |
A stream_meta_type was removed.
This will invalidate all dependent streams and other stream_meta_type using the stream_meta_type!
stream_meta_type | the stream_meta_type that is removed |
parent_dd | the parent DD |
void removed | ( | const datamodel::StructType & | struct_type, |
datamodel::DataDefinition & | parent_dd | ||
) |
A struct_type was removed.
This will invalidate all dependent structs using the struct_type!
struct_type | the struct_type that is removed |
parent_dd | the parent DD |
void removed | ( | const datamodel::Unit & | unit, |
datamodel::DataDefinition & | parent_dd | ||
) |
A unit was removed.
This will invalidate all dependent struct_types and data_types using the unit!
unit | the unit that is removed |
parent_dd | the parent DD |
void removed | ( | const datamodel::UnitPrefix & | unit_prefix, |
datamodel::DataDefinition & | parent_dd | ||
) |
A unit prefix was removed.
unit_prefix | the unit prefix that is removed |
parent_dd | the parent DD |
void removeProblem | ( | ValidationProblemId | id, |
ValidationLevel | level | ||
) |
Removes a validation propbelm entry by id and level.
id | the id to find the problem |
level | the level the entry belongs to |
void renamed | ( | const datamodel::BaseUnit & | base_unit, |
const std::string & | old_name, | ||
datamodel::DataDefinition & | parent_dd | ||
) |
Update all dependency to the renamed base_unit.
base_unit | the base_unit renamed |
old_name | the old name of the base_unit |
parent_dd | the parent DD |
void renamed | ( | const datamodel::DataType & | data_type, |
const std::string & | old_name, | ||
datamodel::DataDefinition & | parent_dd | ||
) |
Update all dependency to the renamed data_type.
data_type | the data_type renamed |
old_name | the old name of the data_type |
parent_dd | the parent DD |
void renamed | ( | const datamodel::EnumType & | enum_type, |
const std::string & | old_name, | ||
datamodel::DataDefinition & | parent_dd | ||
) |
Update all dependency to the renamed enum_type.
enum_type | the enum_type renamed |
old_name | the old name of the enum_type |
parent_dd | the parent DD |
void renamed | ( | const datamodel::Stream & | stream, |
const std::string & | old_name, | ||
datamodel::DataDefinition & | parent_dd | ||
) |
Update all dependency to the renamed stream.
stream | the stream renamed |
old_name | the old name of the stream |
parent_dd | the parent DD |
void renamed | ( | const datamodel::StreamMetaType & | stream_meta_type, |
const std::string & | old_name, | ||
datamodel::DataDefinition & | parent_dd | ||
) |
Update all dependency to the renamed base_stream_meta_typeunit.
stream_meta_type | the stream_meta_type renamed |
old_name | the old name of the stream_meta_type |
parent_dd | the parent DD |
void renamed | ( | const datamodel::StructType & | struct_type, |
const std::string & | old_name, | ||
datamodel::DataDefinition & | parent_dd | ||
) |
Update all dependency to the renamed struct_type.
struct_type | the struct_type renamed |
old_name | the old name of the struct_type |
parent_dd | the parent DD |
void renamed | ( | const datamodel::Unit & | unit, |
const std::string & | old_name, | ||
datamodel::DataDefinition & | parent_dd | ||
) |
Update all dependency to the renamed unit.
unit | the unit renamed |
old_name | the old name of the unit |
parent_dd | the parent DD |
void renamed | ( | const datamodel::UnitPrefix & | unit_prefix, |
const std::string & | old_name, | ||
datamodel::DataDefinition & | parent_dd | ||
) |
Update all dependency to the renamed unit_prefix.
unit_prefix | the unit_prefix renamed |
old_name | the old name of the unit_prefix |
parent_dd | the parent DD |
void updateProblem | ( | ValidationProblemId | id, |
const std::shared_ptr< const ValidationProblem > & | problem | ||
) |
updates or add a problem entry by id
id | the id of the problem |
problem | the problem entry |
bool validationNeeded | ( | ) | const |
this will internally prevent multiple revalidations