1#ifndef AAS_CORE_AAS_3_1_VERIFICATION_GUARD_
2#define AAS_CORE_AAS_3_1_VERIFICATION_GUARD_
12#pragma warning(push, 0)
23namespace verification {
48 explicit Error(std::wstring a_cause);
77 using iterator_category = std::forward_iterator_tag;
79 using difference_type = std::ptrdiff_t;
86 std::unique_ptr<impl::IVerificator> verificator
88 verificator_(std::move(verificator)) {
111 std::unique_ptr<impl::IVerificator> verificator_;
122 virtual void Start() = 0;
123 virtual void Next() = 0;
124 virtual bool Done()
const = 0;
126 virtual const Error& Get()
const = 0;
127 virtual Error& GetMutable() = 0;
128 virtual long Index()
const = 0;
130 virtual std::unique_ptr<IVerificator> Clone()
const = 0;
132 virtual ~IVerificator() =
default;
169 const std::shared_ptr<types::IClass>& instance
177 const std::shared_ptr<types::IClass>& instance_;
205 const std::shared_ptr<types::IClass>& instance
213 const std::shared_ptr<types::IClass>& instance_;
220 const std::wstring& text
225 const std::wstring& text
230 const std::wstring& text
241 const std::wstring& text
254 const std::wstring& text
264 const std::wstring& text
276 const std::wstring& text
283 const std::wstring& text
289 typename LangStringT,
290 typename std::enable_if<
291 std::is_base_of<types::IAbstractLangString, LangStringT>::value
296 std::shared_ptr<LangStringT>
302 std::set<std::wstring> language_set;
304 for (
const std::shared_ptr<LangStringT>& lang_string : lang_strings) {
305 const std::wstring& language = lang_string->language();
307 if (language_set.find(language) != language_set.end()) {
310 language_set.insert(language);
319 std::shared_ptr<types::IQualifier>
328 const std::wstring& text
343 const std::wstring& text
350 const std::wstring& text
357 const std::wstring& text
364 const std::wstring& text
371 const std::wstring& text
382 const std::wstring& text
389 const std::wstring& text
396 const std::wstring& text
403 const std::wstring& text
410 const std::wstring& text
417 const std::wstring& text
424 const std::wstring& text
431 const std::wstring& text
438 const std::wstring& text
445 const std::wstring& text
452 const std::wstring& text
459 const std::wstring& text
466 const std::wstring& text
473 const std::wstring& text
480 const std::wstring& text
487 const std::wstring& text
494 const std::wstring& text
501 const std::wstring& text
508 const std::wstring& text
515 const std::wstring& text
522 const std::wstring& text
529 const std::wstring& text
536 const std::wstring& text
543 const std::wstring& text
550 const std::wstring& text
557 const std::wstring& text
562 const std::wstring& value,
667 const std::shared_ptr<types::IReference>& reference,
673 const std::shared_ptr<types::IReference>& reference
680 typename std::enable_if<
681 std::is_base_of<types::IReferable, ReferableT>::value
685 std::shared_ptr<ReferableT>
688 std::set<std::wstring> id_short_set;
690 for (
const std::shared_ptr<types::IReferable> referable : referables) {
691 const common::optional<std::wstring>& id_short = referable->id_short();
693 if (id_short.has_value()) {
694 if (id_short_set.find(*id_short) != id_short_set.end()) {
698 id_short_set.insert(*id_short);
709 const common::optional<
711 std::shared_ptr<types::IOperationVariable>
714 const common::optional<
716 std::shared_ptr<types::IOperationVariable>
719 const common::optional<
721 std::shared_ptr<types::IOperationVariable>
723 >& inoutput_variables
729 std::shared_ptr<types::IExtension>
736 std::shared_ptr<types::ISubmodelElement>
743 const std::shared_ptr<types::ISubmodelElement>& element,
750 std::shared_ptr<types::ISubmodelElement>
757 const std::shared_ptr<types::IReference>& that,
758 const std::shared_ptr<types::IReference>& other
765 std::shared_ptr<types::IEmbeddedDataSpecification>
766 >& embedded_data_specifications
773 std::shared_ptr<types::IEmbeddedDataSpecification>
774 >& embedded_data_specifications
781 std::shared_ptr<types::IEmbeddedDataSpecification>
782 >& embedded_data_specifications
789 std::shared_ptr<types::IEmbeddedDataSpecification>
790 >& embedded_data_specifications
797 std::shared_ptr<types::IEmbeddedDataSpecification>
798 >& embedded_data_specifications
805 std::shared_ptr<types::IEmbeddedDataSpecification>
806 >& embedded_data_specifications
811 const std::wstring& text
827 const std::wstring& that
839 const std::wstring& that
851 const std::wstring& that
863 const std::wstring& that
875 const std::vector<std::uint8_t>& that
887 const std::wstring& that
899 const std::wstring& that
911 const std::wstring& that
923 const std::wstring& that
935 const std::wstring& that
947 const std::wstring& that
959 const std::wstring& that
971 const std::wstring& that
983 const std::wstring& that
995 const std::wstring& that
1007 const std::wstring& that
1019 const std::wstring& that
1031 const std::wstring& that
Definition verification.hpp:137
virtual ~IVerification()=default
virtual Iterator begin() const =0
virtual const Iterator & end() const =0
Iterate over the verification errors.
Definition verification.hpp:76
Iterator(const Iterator &other)
Iterator(std::unique_ptr< impl::IVerificator > verificator)
Definition verification.hpp:85
friend bool operator!=(const Iterator &a, const Iterator &b)
Iterator & operator=(Iterator &&other)
reference operator*() const
Iterator(Iterator &&other)
pointer operator->() const
friend bool operator==(const Iterator &a, const Iterator &b)
Iterator & operator=(const Iterator &other)
Verify that the instance conforms to the meta-model constraints.
Definition verification.hpp:166
Iterator begin() const override
NonRecursiveVerification(const std::shared_ptr< types::IClass > &instance)
~NonRecursiveVerification() override=default
const Iterator & end() const override
Verify that the instance conforms to the meta-model constraints.
Definition verification.hpp:202
const Iterator & end() const override
RecursiveVerification(const std::shared_ptr< types::IClass > &instance)
~RecursiveVerification() override=default
Iterator begin() const override
KeyTypes
Enumeration of different key value types within a key.
Definition types.hpp:182
DataTypeDefXsd
Enumeration listing all XSD anySimpleTypes.
Definition types.hpp:233
AasSubmodelElements
Enumeration of all possible elements of a ISubmodelElementList.
Definition types.hpp:118
bool MatchesXsLong(const std::wstring &text)
Check that text conforms to the pattern of an xs:long.
bool MatchesXsByte(const std::wstring &text)
Check that text conforms to the pattern of an xs:byte.
bool IsXsDouble(const std::wstring &value)
Check that value is a valid xs:double.
bool MatchesXsHexBinary(const std::wstring &text)
Check that text conforms to the pattern of an xs:hexBinary.
bool IsXsDateTimeUtc(const std::wstring &text)
Check that text is a xs:dateTime with time zone set to UTC.
bool MatchesXsGMonthDay(const std::wstring &text)
Check that text conforms to the pattern of an xs:gMonthDay.
bool MatchesXsNonNegativeInteger(const std::wstring &text)
Check that text conforms to the pattern of an xs:nonNegativeInteger.
bool IsXsUnsignedShort(const std::wstring &value)
Check that value is a valid xs:unsignedShort.
bool IsXsShort(const std::wstring &value)
Check that value is a valid xs:short.
bool MatchesXsGDay(const std::wstring &text)
Check that text conforms to the pattern of an xs:gDay.
bool MatchesXsTime(const std::wstring &text)
Check that text conforms to the pattern of an xs:time.
bool SubmodelElementIsOfType(const std::shared_ptr< types::ISubmodelElement > &element, types::AasSubmodelElements element_type)
Check that the run-time type of the element coincides with element_type.
bool MatchesXsFloat(const std::wstring &text)
Check that text conforms to the pattern of an xs:float.
bool MatchesXsUnsignedInt(const std::wstring &text)
Check that text conforms to the pattern of an xs:unsignedInt.
bool MatchesRevisionType(const std::wstring &text)
Check that text is a valid revision string.
bool DataSpecificationIec61360sHaveDefinitionAtLeastInEnglish(const std::vector< std::shared_ptr< types::IEmbeddedDataSpecification > > &embedded_data_specifications)
Check that the types::IDataSpecificationIec61360::definition is defined for all data specifications w...
bool MatchesXsDuration(const std::wstring &text)
Check that text conforms to the pattern of an xs:duration.
bool PropertiesOrRangesHaveValueType(const std::vector< std::shared_ptr< types::ISubmodelElement > > &elements, types::DataTypeDefXsd value_type)
Check that all the elements have the value_type.
bool MatchesVersionType(const std::wstring &text)
Check that text is a valid version string.
std::unique_ptr< IVerification > VerifyMessageTopicType(const std::wstring &that)
Verify that the invariants hold for that value.
std::unique_ptr< IVerification > VerifyRevisionType(const std::wstring &that)
Verify that the invariants hold for that value.
bool IsXsLong(const std::wstring &value)
Check that value is a valid xs:long.
bool DataSpecificationIec61360sForPropertyOrValueHaveAppropriateDataType(const std::vector< std::shared_ptr< types::IEmbeddedDataSpecification > > &embedded_data_specifications)
Check that the types::IDataSpecificationIec61360::data_type is defined appropriately for all data spe...
bool MatchesXsUnsignedShort(const std::wstring &text)
Check that text conforms to the pattern of an xs:unsignedShort.
bool MatchesXsGYearMonth(const std::wstring &text)
Check that text conforms to the pattern of an xs:gYearMonth.
bool DataSpecificationIec61360sHaveDataType(const std::vector< std::shared_ptr< types::IEmbeddedDataSpecification > > &embedded_data_specifications)
Check that the types::IDataSpecificationIec61360::data_type is defined for all data specifications wh...
bool MatchesXsUnsignedByte(const std::wstring &text)
Check that text conforms to the pattern of an xs:unsignedByte.
bool IsXsDate(const std::wstring &text)
Check that value is a valid xs:date.
bool ValueConsistentWithXsdType(const std::wstring &value, types::DataTypeDefXsd value_type)
Check that the value conforms to its value_type.
std::unique_ptr< IVerification > VerifyVersionType(const std::wstring &that)
Verify that the invariants hold for that value.
bool IsXsByte(const std::wstring &value)
Check that value is a valid xs:byte.
std::unique_ptr< IVerification > VerifyContentType(const std::wstring &that)
Verify that the invariants hold for that value.
bool MatchesXsAnyUri(const std::wstring &text)
Check that text conforms to the pattern of an xs:anyURI.
bool operator!=(const Iterator &a, const Iterator &b)
std::unique_ptr< IVerification > VerifyQualifierType(const std::wstring &that)
Verify that the invariants hold for that value.
bool IdShortsOfVariablesAreUnique(const common::optional< std::vector< std::shared_ptr< types::IOperationVariable > > > &input_variables, const common::optional< std::vector< std::shared_ptr< types::IOperationVariable > > > &output_variables, const common::optional< std::vector< std::shared_ptr< types::IOperationVariable > > > &inoutput_variables)
Check that the types::IReferable::id_short's among all the input_variables, output_variables and inou...
bool ReferenceKeyValuesEqual(const std::shared_ptr< types::IReference > &that, const std::shared_ptr< types::IReference > &other)
Check that the two references are equal by comparing their key values.
bool MatchesXsDate(const std::wstring &text)
Check that text conforms to the pattern of an xs:date.
bool MatchesXsDouble(const std::wstring &text)
Check that text conforms to the pattern of an xs:double.
bool ExtensionNamesAreUnique(const std::vector< std::shared_ptr< types::IExtension > > &extensions)
Check that the extension names are unique.
bool IdShortsAreUnique(const std::vector< std::shared_ptr< ReferableT > > &referables)
Check that the types::IReferable::id_short's among the referables are unique.
Definition verification.hpp:683
std::unique_ptr< IVerification > VerifyDuration(const std::wstring &that)
Verify that the invariants hold for that value.
bool IsXsDateTime(const std::wstring &text)
Check that text is a xs:dateTime with time zone set to UTC.
bool IsXsUnsignedByte(const std::wstring &value)
Check that value is a valid xs:unsignedByte.
bool IsXsUnsignedLong(const std::wstring &value)
Check that value is a valid xs:unsignedLong.
bool LangStringsHaveUniqueLanguages(const std::vector< std::shared_ptr< LangStringT > > &lang_strings)
Check that the lang_strings do not have overlapping types::IAbstractLangString::language's.
Definition verification.hpp:294
bool MatchesXsBoolean(const std::wstring &text)
Check that text conforms to the pattern of an xs:boolean.
bool operator==(const Iterator &a, const Iterator &b)
bool IsXsUnsignedInt(const std::wstring &value)
Check that value is a valid xs:unsignedInt.
bool MatchesXsInt(const std::wstring &text)
Check that text conforms to the pattern of an xs:int.
bool MatchesXsDecimal(const std::wstring &text)
Check that text conforms to the pattern of an xs:decimal.
bool MatchesXmlSerializableString(const std::wstring &text)
Check that text conforms to the pattern of the Constraint AASd-130.
bool SubmodelElementsHaveIdenticalSemanticIds(const std::vector< std::shared_ptr< types::ISubmodelElement > > &elements)
Check that all semantic IDs are identical, if specified.
bool IsModelReferenceToReferable(const std::shared_ptr< types::IReference > &reference)
Check that the target of the reference matches a constants::kAasReferables.
bool IsXsGMonthDay(const std::wstring &value)
Check that value is a valid xs:gMonthDay.
bool MatchesXsNonPositiveInteger(const std::wstring &text)
Check that text conforms to the pattern of an xs:nonPositiveInteger.
bool IsXsInt(const std::wstring &value)
Check that value is a valid xs:int.
bool IsModelReferenceTo(const std::shared_ptr< types::IReference > &reference, types::KeyTypes expected_type)
Check that the target of the model reference matches the expected_type.
bool MatchesXsDateTime(const std::wstring &text)
Check that text conforms to the pattern of an xs:dateTime.
bool MatchesMimeType(const std::wstring &text)
Check that text conforms to the pattern of MIME type.
std::unique_ptr< IVerification > VerifyPathType(const std::wstring &that)
Verify that the invariants hold for that value.
bool MatchesXsUnsignedLong(const std::wstring &text)
Check that text conforms to the pattern of an xs:unsignedLong.
std::unique_ptr< IVerification > VerifyBlobType(const std::vector< std::uint8_t > &that)
Verify that the invariants hold for that value.
std::unique_ptr< IVerification > VerifyXmlSerializableString(const std::wstring &that)
Verify that the invariants hold for that value.
bool DataSpecificationIec61360sForDocumentHaveAppropriateDataType(const std::vector< std::shared_ptr< types::IEmbeddedDataSpecification > > &embedded_data_specifications)
Check that the types::IDataSpecificationIec61360::data_type is defined appropriately for all data spe...
bool MatchesXsNegativeInteger(const std::wstring &text)
Check that text conforms to the pattern of an xs:negativeInteger.
std::unique_ptr< IVerification > VerifyDateTimeUtc(const std::wstring &that)
Verify that the invariants hold for that value.
bool MatchesXsDateTimeUtc(const std::wstring &text)
Check that text conforms to the pattern of an xs:dateTime.
bool MatchesXsInteger(const std::wstring &text)
Check that text conforms to the pattern of an xs:integer.
std::unique_ptr< IVerification > VerifyNonEmptyXmlSerializableString(const std::wstring &that)
Verify that the invariants hold for that value.
bool MatchesBcp47(const std::wstring &text)
Check that text is a valid BCP 47 language tag.
std::unique_ptr< IVerification > VerifyValueTypeIec61360(const std::wstring &that)
Verify that the invariants hold for that value.
bool MatchesXsGYear(const std::wstring &text)
Check that text conforms to the pattern of an xs:gYear.
bool MatchesXsShort(const std::wstring &text)
Check that text conforms to the pattern of an xs:short.
std::unique_ptr< IVerification > VerifyIdShortType(const std::wstring &that)
Verify that the invariants hold for that value.
bool MatchesXsGMonth(const std::wstring &text)
Check that text conforms to the pattern of an xs:gMonth.
bool IsBcp47ForEnglish(const std::wstring &text)
Check that the text corresponds to a BCP47 code for english.
std::unique_ptr< IVerification > VerifyValueDataType(const std::wstring &that)
Verify that the invariants hold for that value.
bool MatchesRfc2396(const std::wstring &text)
Check that text matches to the URI pattern defined in RFC 2396.
std::unique_ptr< IVerification > VerifyNameType(const std::wstring &that)
Verify that the invariants hold for that value.
std::unique_ptr< IVerification > VerifyBcp47LanguageTag(const std::wstring &that)
Verify that the invariants hold for that value.
bool IsXsFloat(const std::wstring &value)
Check that value is a valid xs:float.
bool MatchesXsString(const std::wstring &text)
Check that text conforms to the pattern of an xs:string.
bool MatchesXsPositiveInteger(const std::wstring &text)
Check that text conforms to the pattern of an xs:positiveInteger.
std::unique_ptr< IVerification > VerifyLabelType(const std::wstring &that)
Verify that the invariants hold for that value.
bool MatchesIdShort(const std::wstring &text)
Check that text is a valid short ID.
bool QualifierTypesAreUnique(const std::vector< std::shared_ptr< types::IQualifier > > &qualifiers)
Check that types::IQualifier::type's of qualifiers are unique.
bool DataSpecificationIec61360sHaveValue(const std::vector< std::shared_ptr< types::IEmbeddedDataSpecification > > &embedded_data_specifications)
Check that the types::IDataSpecificationIec61360::value is defined for all data specifications whose ...
bool MatchesXsBase64Binary(const std::wstring &text)
Check that text conforms to the pattern of an xs:base64Binary.
bool DataSpecificationIec61360sForReferenceHaveAppropriateDataType(const std::vector< std::shared_ptr< types::IEmbeddedDataSpecification > > &embedded_data_specifications)
Check that the types::IDataSpecificationIec61360::data_type is defined appropriately for all data spe...
std::unique_ptr< IVerification > VerifyIdentifier(const std::wstring &that)
Verify that the invariants hold for that value.
Represent a path to some value.
Definition iteration.hpp:181
Definition verification.hpp:37
iteration::Path path
Definition verification.hpp:46
std::wstring cause
Definition verification.hpp:41
Error(std::wstring a_cause, iteration::Path a_path)
Error(std::wstring a_cause)