1#ifndef AAS_CORE_AAS_3_1_JSONIZATION_GUARD_
2#define AAS_CORE_AAS_3_1_JSONIZATION_GUARD_
11#pragma warning(push, 0)
12#include <nlohmann/json.hpp>
26namespace jsonization {
38 virtual std::unique_ptr<ISegment>
Clone()
const = 0;
58 std::unique_ptr<ISegment>
Clone()
const override;
78 std::unique_ptr<ISegment>
Clone()
const override;
87 std::deque<std::unique_ptr<ISegment> >
segments;
128 std::shared_ptr<types::IHasSemantics>,
131 const nlohmann::json& json,
132 bool additional_properties =
false
145 std::shared_ptr<types::IExtension>,
148 const nlohmann::json& json,
149 bool additional_properties =
false
162 std::shared_ptr<types::IHasExtensions>,
165 const nlohmann::json& json,
166 bool additional_properties =
false
179 std::shared_ptr<types::IReferable>,
182 const nlohmann::json& json,
183 bool additional_properties =
false
196 std::shared_ptr<types::IIdentifiable>,
199 const nlohmann::json& json,
200 bool additional_properties =
false
213 std::shared_ptr<types::IHasKind>,
216 const nlohmann::json& json,
217 bool additional_properties =
false
230 std::shared_ptr<types::IHasDataSpecification>,
233 const nlohmann::json& json,
234 bool additional_properties =
false
247 std::shared_ptr<types::IAdministrativeInformation>,
250 const nlohmann::json& json,
251 bool additional_properties =
false
264 std::shared_ptr<types::IQualifiable>,
267 const nlohmann::json& json,
268 bool additional_properties =
false
281 std::shared_ptr<types::IQualifier>,
284 const nlohmann::json& json,
285 bool additional_properties =
false
298 std::shared_ptr<types::IAssetAdministrationShell>,
301 const nlohmann::json& json,
302 bool additional_properties =
false
315 std::shared_ptr<types::IAssetInformation>,
318 const nlohmann::json& json,
319 bool additional_properties =
false
332 std::shared_ptr<types::IResource>,
335 const nlohmann::json& json,
336 bool additional_properties =
false
349 std::shared_ptr<types::ISpecificAssetId>,
352 const nlohmann::json& json,
353 bool additional_properties =
false
366 std::shared_ptr<types::ISubmodel>,
369 const nlohmann::json& json,
370 bool additional_properties =
false
383 std::shared_ptr<types::ISubmodelElement>,
386 const nlohmann::json& json,
387 bool additional_properties =
false
400 std::shared_ptr<types::IRelationshipElement>,
403 const nlohmann::json& json,
404 bool additional_properties =
false
417 std::shared_ptr<types::ISubmodelElementList>,
420 const nlohmann::json& json,
421 bool additional_properties =
false
434 std::shared_ptr<types::ISubmodelElementCollection>,
437 const nlohmann::json& json,
438 bool additional_properties =
false
451 std::shared_ptr<types::IDataElement>,
454 const nlohmann::json& json,
455 bool additional_properties =
false
468 std::shared_ptr<types::IProperty>,
471 const nlohmann::json& json,
472 bool additional_properties =
false
485 std::shared_ptr<types::IMultiLanguageProperty>,
488 const nlohmann::json& json,
489 bool additional_properties =
false
502 std::shared_ptr<types::IRange>,
505 const nlohmann::json& json,
506 bool additional_properties =
false
519 std::shared_ptr<types::IReferenceElement>,
522 const nlohmann::json& json,
523 bool additional_properties =
false
536 std::shared_ptr<types::IBlob>,
539 const nlohmann::json& json,
540 bool additional_properties =
false
553 std::shared_ptr<types::IFile>,
556 const nlohmann::json& json,
557 bool additional_properties =
false
570 std::shared_ptr<types::IAnnotatedRelationshipElement>,
573 const nlohmann::json& json,
574 bool additional_properties =
false
587 std::shared_ptr<types::IEntity>,
590 const nlohmann::json& json,
591 bool additional_properties =
false
604 std::shared_ptr<types::IEventPayload>,
607 const nlohmann::json& json,
608 bool additional_properties =
false
621 std::shared_ptr<types::IEventElement>,
624 const nlohmann::json& json,
625 bool additional_properties =
false
638 std::shared_ptr<types::IBasicEventElement>,
641 const nlohmann::json& json,
642 bool additional_properties =
false
655 std::shared_ptr<types::IOperation>,
658 const nlohmann::json& json,
659 bool additional_properties =
false
672 std::shared_ptr<types::IOperationVariable>,
675 const nlohmann::json& json,
676 bool additional_properties =
false
689 std::shared_ptr<types::ICapability>,
692 const nlohmann::json& json,
693 bool additional_properties =
false
706 std::shared_ptr<types::IConceptDescription>,
709 const nlohmann::json& json,
710 bool additional_properties =
false
723 std::shared_ptr<types::IReference>,
726 const nlohmann::json& json,
727 bool additional_properties =
false
740 std::shared_ptr<types::IKey>,
743 const nlohmann::json& json,
744 bool additional_properties =
false
757 std::shared_ptr<types::IAbstractLangString>,
760 const nlohmann::json& json,
761 bool additional_properties =
false
774 std::shared_ptr<types::ILangStringNameType>,
777 const nlohmann::json& json,
778 bool additional_properties =
false
791 std::shared_ptr<types::ILangStringTextType>,
794 const nlohmann::json& json,
795 bool additional_properties =
false
808 std::shared_ptr<types::IEnvironment>,
811 const nlohmann::json& json,
812 bool additional_properties =
false
825 std::shared_ptr<types::IDataSpecificationContent>,
828 const nlohmann::json& json,
829 bool additional_properties =
false
842 std::shared_ptr<types::IEmbeddedDataSpecification>,
845 const nlohmann::json& json,
846 bool additional_properties =
false
859 std::shared_ptr<types::ILevelType>,
862 const nlohmann::json& json,
863 bool additional_properties =
false
876 std::shared_ptr<types::IValueReferencePair>,
879 const nlohmann::json& json,
880 bool additional_properties =
false
893 std::shared_ptr<types::IValueList>,
896 const nlohmann::json& json,
897 bool additional_properties =
false
910 std::shared_ptr<types::ILangStringPreferredNameTypeIec61360>,
913 const nlohmann::json& json,
914 bool additional_properties =
false
927 std::shared_ptr<types::ILangStringShortNameTypeIec61360>,
930 const nlohmann::json& json,
931 bool additional_properties =
false
944 std::shared_ptr<types::ILangStringDefinitionTypeIec61360>,
947 const nlohmann::json& json,
948 bool additional_properties =
false
961 std::shared_ptr<types::IDataSpecificationIec61360>,
964 const nlohmann::json& json,
965 bool additional_properties =
false
982 const char*
what() const noexcept override;
984 const std::wstring&
cause() const noexcept;
990 const std::wstring cause_;
991 const iteration::
Path path_;
992 const std::
string msg_;
1004 const types::IClass& that
Definition jsonization.hpp:31
virtual std::wstring ToWstring() const =0
Convert the segment to a string in a JSON path.
virtual std::unique_ptr< ISegment > Clone() const =0
virtual ~ISegment()=default
Definition jsonization.hpp:975
const std::wstring & cause() const noexcept
SerializationException(std::wstring cause, iteration::Path path)
const char * what() const noexcept override
const iteration::Path & path() const noexcept
common::expected< std::shared_ptr< types::IExtension >, DeserializationError > ExtensionFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IExtension.
common::expected< std::shared_ptr< types::IHasKind >, DeserializationError > HasKindFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IHasKind.
common::expected< std::shared_ptr< types::IMultiLanguageProperty >, DeserializationError > MultiLanguagePropertyFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IMultiLanguageProperty.
common::expected< std::shared_ptr< types::IReferable >, DeserializationError > ReferableFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IReferable.
common::expected< std::shared_ptr< types::IEnvironment >, DeserializationError > EnvironmentFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IEnvironment.
common::expected< std::shared_ptr< types::IHasSemantics >, DeserializationError > HasSemanticsFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IHasSemantics.
common::expected< std::shared_ptr< types::IRelationshipElement >, DeserializationError > RelationshipElementFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IRelationshipElement.
common::expected< std::shared_ptr< types::IQualifiable >, DeserializationError > QualifiableFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IQualifiable.
common::expected< std::shared_ptr< types::IEmbeddedDataSpecification >, DeserializationError > EmbeddedDataSpecificationFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IEmbeddedDataSpecification.
common::expected< std::shared_ptr< types::IOperation >, DeserializationError > OperationFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IOperation.
common::expected< std::shared_ptr< types::IReferenceElement >, DeserializationError > ReferenceElementFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IReferenceElement.
common::expected< std::shared_ptr< types::IResource >, DeserializationError > ResourceFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IResource.
common::expected< std::shared_ptr< types::ISubmodelElementList >, DeserializationError > SubmodelElementListFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::ISubmodelElementList.
common::expected< std::shared_ptr< types::IValueList >, DeserializationError > ValueListFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IValueList.
common::expected< std::shared_ptr< types::ISubmodel >, DeserializationError > SubmodelFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::ISubmodel.
common::expected< std::shared_ptr< types::ILevelType >, DeserializationError > LevelTypeFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::ILevelType.
common::expected< std::shared_ptr< types::IFile >, DeserializationError > FileFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IFile.
common::expected< std::shared_ptr< types::IRange >, DeserializationError > RangeFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IRange.
common::expected< std::shared_ptr< types::IBlob >, DeserializationError > BlobFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IBlob.
common::expected< std::shared_ptr< types::IEntity >, DeserializationError > EntityFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IEntity.
common::expected< std::shared_ptr< types::ILangStringTextType >, DeserializationError > LangStringTextTypeFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::ILangStringTextType.
nlohmann::json Serialize(const types::IClass &that)
Serialize that instance to a JSON value.
common::expected< std::shared_ptr< types::IConceptDescription >, DeserializationError > ConceptDescriptionFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IConceptDescription.
common::expected< std::shared_ptr< types::IOperationVariable >, DeserializationError > OperationVariableFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IOperationVariable.
common::expected< std::shared_ptr< types::ICapability >, DeserializationError > CapabilityFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::ICapability.
common::expected< std::shared_ptr< types::IHasDataSpecification >, DeserializationError > HasDataSpecificationFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IHasDataSpecification.
common::expected< std::shared_ptr< types::ILangStringNameType >, DeserializationError > LangStringNameTypeFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::ILangStringNameType.
common::expected< std::shared_ptr< types::ISpecificAssetId >, DeserializationError > SpecificAssetIdFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::ISpecificAssetId.
common::expected< std::shared_ptr< types::ILangStringDefinitionTypeIec61360 >, DeserializationError > LangStringDefinitionTypeIec61360From(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::ILangStringDefinitionTypeIec61360.
common::expected< std::shared_ptr< types::IProperty >, DeserializationError > PropertyFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IProperty.
common::expected< std::shared_ptr< types::ILangStringPreferredNameTypeIec61360 >, DeserializationError > LangStringPreferredNameTypeIec61360From(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::ILangStringPreferredNameTypeIec61360.
common::expected< std::shared_ptr< types::IValueReferencePair >, DeserializationError > ValueReferencePairFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IValueReferencePair.
common::expected< std::shared_ptr< types::IAssetInformation >, DeserializationError > AssetInformationFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IAssetInformation.
common::expected< std::shared_ptr< types::IAbstractLangString >, DeserializationError > AbstractLangStringFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IAbstractLangString.
common::expected< std::shared_ptr< types::ISubmodelElementCollection >, DeserializationError > SubmodelElementCollectionFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::ISubmodelElementCollection.
common::expected< std::shared_ptr< types::ISubmodelElement >, DeserializationError > SubmodelElementFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::ISubmodelElement.
common::expected< std::shared_ptr< types::IAnnotatedRelationshipElement >, DeserializationError > AnnotatedRelationshipElementFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IAnnotatedRelationshipElement.
common::expected< std::shared_ptr< types::IBasicEventElement >, DeserializationError > BasicEventElementFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IBasicEventElement.
common::expected< std::shared_ptr< types::IEventPayload >, DeserializationError > EventPayloadFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IEventPayload.
common::expected< std::shared_ptr< types::IDataElement >, DeserializationError > DataElementFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IDataElement.
common::expected< std::shared_ptr< types::IReference >, DeserializationError > ReferenceFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IReference.
common::expected< std::shared_ptr< types::IIdentifiable >, DeserializationError > IdentifiableFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IIdentifiable.
common::expected< std::shared_ptr< types::IKey >, DeserializationError > KeyFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IKey.
common::expected< std::shared_ptr< types::IEventElement >, DeserializationError > EventElementFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IEventElement.
common::expected< std::shared_ptr< types::IAssetAdministrationShell >, DeserializationError > AssetAdministrationShellFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IAssetAdministrationShell.
common::expected< std::shared_ptr< types::IDataSpecificationContent >, DeserializationError > DataSpecificationContentFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IDataSpecificationContent.
common::expected< std::shared_ptr< types::IDataSpecificationIec61360 >, DeserializationError > DataSpecificationIec61360From(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IDataSpecificationIec61360.
common::expected< std::shared_ptr< types::ILangStringShortNameTypeIec61360 >, DeserializationError > LangStringShortNameTypeIec61360From(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::ILangStringShortNameTypeIec61360.
common::expected< std::shared_ptr< types::IHasExtensions >, DeserializationError > HasExtensionsFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IHasExtensions.
common::expected< std::shared_ptr< types::IAdministrativeInformation >, DeserializationError > AdministrativeInformationFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IAdministrativeInformation.
common::expected< std::shared_ptr< types::IQualifier >, DeserializationError > QualifierFrom(const nlohmann::json &json, bool additional_properties=false)
Deserialize json value to an instance of types::IQualifier.
Represent a path to some value.
Definition iteration.hpp:181
Definition jsonization.hpp:103
DeserializationError(std::wstring a_cause, Path a_path)
std::wstring cause
Definition jsonization.hpp:107
DeserializationError(std::wstring a_cause)
Path path
Definition jsonization.hpp:112
Definition jsonization.hpp:66
IndexSegment(size_t an_index)
std::wstring ToWstring() const override
Convert the segment to a string in a JSON path.
size_t index
Definition jsonization.hpp:70
~IndexSegment() override=default
std::unique_ptr< ISegment > Clone() const override
Definition jsonization.hpp:86
Path & operator=(Path &&other)
std::deque< std::unique_ptr< ISegment > > segments
Definition jsonization.hpp:87
std::wstring ToWstring() const
Path & operator=(const Path &other)
Definition jsonization.hpp:46
~PropertySegment() override=default
std::wstring ToWstring() const override
Convert the segment to a string in a JSON path.
PropertySegment(std::wstring a_name)
std::wstring name
Definition jsonization.hpp:50
std::unique_ptr< ISegment > Clone() const override