diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-18 18:22:14 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-18 18:22:14 +0100 |
commit | a30e627ffccf36384689295ce54af32e38ef5ef8 (patch) | |
tree | ffd03045f2f292da9d9f2d684d166093abaf7a21 /src/core/model | |
parent | 1ebaaf08c0bc7de704a3c2a423f572c54c4a069b (diff) |
Droped Rtti<T> class, using RttiType instead
Diffstat (limited to 'src/core/model')
-rw-r--r-- | src/core/model/Document.cpp | 32 | ||||
-rw-r--r-- | src/core/model/Document.hpp | 14 | ||||
-rw-r--r-- | src/core/model/Domain.cpp | 22 | ||||
-rw-r--r-- | src/core/model/Domain.hpp | 10 | ||||
-rw-r--r-- | src/core/model/Node.cpp | 7 | ||||
-rw-r--r-- | src/core/model/Node.hpp | 2 | ||||
-rw-r--r-- | src/core/model/Typesystem.cpp | 40 | ||||
-rw-r--r-- | src/core/model/Typesystem.hpp | 28 |
8 files changed, 79 insertions, 76 deletions
diff --git a/src/core/model/Document.cpp b/src/core/model/Document.cpp index 5f0ad4c..f817845 100644 --- a/src/core/model/Document.cpp +++ b/src/core/model/Document.cpp @@ -22,7 +22,7 @@ #include <set> #include <core/common/Exceptions.hpp> -#include <core/common/Rtti.hpp> +#include <core/common/RttiBuilder.hpp> namespace ousia { namespace model { @@ -347,20 +347,24 @@ bool Document::hasChild(Handle<StructureNode> s) const /* Type registrations */ namespace RttiTypes { -const Rtti<model::Document> Document = - RttiBuilder("Document").parent(&Node).composedOf( +const RttiType Document = + RttiBuilder<model::Document>("Document").parent(&Node).composedOf( {&AnnotationEntity, &StructuredEntity}); -const Rtti<model::StructureNode> StructureNode = - RttiBuilder("StructureNode").parent(&Node); -const Rtti<model::StructuredEntity> StructuredEntity = - RttiBuilder("StructuredEntity").parent(&StructureNode).composedOf( - {&StructuredEntity, &DocumentPrimitive, &Anchor}); -const Rtti<model::DocumentPrimitive> DocumentPrimitive = - RttiBuilder("DocumentPrimitive").parent(&StructureNode); -const Rtti<model::Anchor> Anchor = RttiBuilder("Anchor").parent(&StructureNode); -const Rtti<model::AnnotationEntity> AnnotationEntity = - RttiBuilder("AnnotationEntity").parent(&Node).composedOf( - {&StructuredEntity, &DocumentPrimitive, &Anchor}); +const RttiType StructureNode = + RttiBuilder<model::StructureNode>("StructureNode").parent(&Node); +const RttiType StructuredEntity = + RttiBuilder<model::StructuredEntity>("StructuredEntity") + .parent(&StructureNode) + .composedOf({&StructuredEntity, &DocumentPrimitive, &Anchor}); +const RttiType DocumentPrimitive = + RttiBuilder<model::DocumentPrimitive>("DocumentPrimitive") + .parent(&StructureNode); +const RttiType Anchor = + RttiBuilder<model::Anchor>("Anchor").parent(&StructureNode); +const RttiType AnnotationEntity = + RttiBuilder<model::AnnotationEntity>("AnnotationEntity") + .parent(&Node) + .composedOf({&StructuredEntity, &DocumentPrimitive, &Anchor}); } } diff --git a/src/core/model/Document.hpp b/src/core/model/Document.hpp index 9410d17..d9729c3 100644 --- a/src/core/model/Document.hpp +++ b/src/core/model/Document.hpp @@ -641,13 +641,13 @@ public: } namespace RttiTypes { -extern const Rtti<model::Document> Document; -extern const Rtti<model::DocumentEntity> DocumentEntity; -extern const Rtti<model::AnnotationEntity> AnnotationEntity; -extern const Rtti<model::StructureNode> StructureNode; -extern const Rtti<model::StructuredEntity> StructuredEntity; -extern const Rtti<model::DocumentPrimitive> DocumentPrimitive; -extern const Rtti<model::Anchor> Anchor; +extern const RttiType Document; +extern const RttiType DocumentEntity; +extern const RttiType AnnotationEntity; +extern const RttiType StructureNode; +extern const RttiType StructuredEntity; +extern const RttiType DocumentPrimitive; +extern const RttiType Anchor; } } diff --git a/src/core/model/Domain.cpp b/src/core/model/Domain.cpp index 9a0ed0d..6f50b1c 100644 --- a/src/core/model/Domain.cpp +++ b/src/core/model/Domain.cpp @@ -18,7 +18,7 @@ #include <set> -#include <core/common/Rtti.hpp> +#include <core/common/RttiBuilder.hpp> #include <core/common/Exceptions.hpp> #include "Domain.hpp" @@ -279,17 +279,17 @@ void Domain::addAnnotationClass(Handle<AnnotationClass> a) /* Type registrations */ namespace RttiTypes { -const Rtti<model::FieldDescriptor> FieldDescriptor = - RttiBuilder("FieldDescriptor").parent(&Node); -const Rtti<model::Descriptor> Descriptor = - RttiBuilder("Descriptor").parent(&Node); -const Rtti<model::StructuredClass> StructuredClass = - RttiBuilder("StructuredClass").parent(&Descriptor).composedOf( +const RttiType FieldDescriptor = + RttiBuilder<model::FieldDescriptor>("FieldDescriptor").parent(&Node); +const RttiType Descriptor = + RttiBuilder<model::Descriptor>("Descriptor").parent(&Node); +const RttiType StructuredClass = + RttiBuilder<model::StructuredClass>("StructuredClass").parent(&Descriptor).composedOf( &FieldDescriptor); -const Rtti<model::AnnotationClass> AnnotationClass = - RttiBuilder("AnnotationClass").parent(&Descriptor); -const Rtti<model::Domain> Domain = - RttiBuilder("Domain").parent(&Node).composedOf( +const RttiType AnnotationClass = + RttiBuilder<model::AnnotationClass>("AnnotationClass").parent(&Descriptor); +const RttiType Domain = + RttiBuilder<model::Domain>("Domain").parent(&Node).composedOf( {&StructuredClass, &AnnotationClass}); } } diff --git a/src/core/model/Domain.hpp b/src/core/model/Domain.hpp index d1ba44f..b192c11 100644 --- a/src/core/model/Domain.hpp +++ b/src/core/model/Domain.hpp @@ -769,11 +769,11 @@ public: namespace RttiTypes { -extern const Rtti<model::FieldDescriptor> FieldDescriptor; -extern const Rtti<model::Descriptor> Descriptor; -extern const Rtti<model::StructuredClass> StructuredClass; -extern const Rtti<model::AnnotationClass> AnnotationClass; -extern const Rtti<model::Domain> Domain; +extern const RttiType FieldDescriptor; +extern const RttiType Descriptor; +extern const RttiType StructuredClass; +extern const RttiType AnnotationClass; +extern const RttiType Domain; } } diff --git a/src/core/model/Node.cpp b/src/core/model/Node.cpp index bd023e1..be13d42 100644 --- a/src/core/model/Node.cpp +++ b/src/core/model/Node.cpp @@ -21,8 +21,7 @@ #include <core/common/Exceptions.hpp> #include <core/common/Logger.hpp> -#include <core/common/Rtti.hpp> -#include <core/common/TypedRttiBuilder.hpp> +#include <core/common/RttiBuilder.hpp> #include <core/common/Utils.hpp> #include "Node.hpp" @@ -438,8 +437,8 @@ bool Node::validate(Logger &logger) const /* RTTI type registrations */ namespace RttiTypes { -const Rtti<ousia::Node> Node = - TypedRttiBuilder<ousia::Node>("Node") +const RttiType Node = + RttiBuilder<ousia::Node>("Node") .property("name", {RttiTypes::String, {[](const ousia::Node *obj) { return Variant::fromString(obj->getName()); diff --git a/src/core/model/Node.hpp b/src/core/model/Node.hpp index 0168a3e..79f38b8 100644 --- a/src/core/model/Node.hpp +++ b/src/core/model/Node.hpp @@ -575,7 +575,7 @@ namespace RttiTypes { /** * Typeinformation for the base "Node" class. */ -extern const Rtti<Node> Node; +extern const RttiType Node; } } diff --git a/src/core/model/Typesystem.cpp b/src/core/model/Typesystem.cpp index 13bb38c..2be564d 100644 --- a/src/core/model/Typesystem.cpp +++ b/src/core/model/Typesystem.cpp @@ -18,7 +18,7 @@ #include "Typesystem.hpp" -#include <core/common/Rtti.hpp> +#include <core/common/RttiBuilder.hpp> #include <core/common/Utils.hpp> #include <core/common/VariantConverter.hpp> @@ -560,27 +560,27 @@ SystemTypesystem::SystemTypesystem(Manager &mgr) /* RTTI type registrations */ namespace RttiTypes { -const Rtti<model::Type> Type = RttiBuilder("Type").parent(&Node); -const Rtti<model::StringType> StringType = - RttiBuilder("StringType").parent(&Type); -const Rtti<model::IntType> IntType = RttiBuilder("IntType").parent(&Type); -const Rtti<model::DoubleType> DoubleType = - RttiBuilder("DoubleType").parent(&Type); -const Rtti<model::BoolType> BoolType = RttiBuilder("BoolType").parent(&Type); -const Rtti<model::EnumType> EnumType = RttiBuilder("EnumType").parent(&Type); -const Rtti<model::StructType> StructType = - RttiBuilder("StructType").parent(&Type).composedOf(&Attribute); -const Rtti<model::ArrayType> ArrayType = RttiBuilder("ArrayType").parent(&Type); -const Rtti<model::UnknownType> UnknownType = - RttiBuilder("UnknownType").parent(&Type); -const Rtti<model::Constant> Constant = RttiBuilder("Constant").parent(&Node); -const Rtti<model::Attribute> Attribute = RttiBuilder("Attribute").parent(&Node); -const Rtti<model::Typesystem> Typesystem = - RttiBuilder("Typesystem").parent(&Node).composedOf( +const RttiType Type = RttiBuilder<model::Type>("Type").parent(&Node); +const RttiType StringType = + RttiBuilder<model::StringType>("StringType").parent(&Type); +const RttiType IntType = RttiBuilder<model::IntType>("IntType").parent(&Type); +const RttiType DoubleType = + RttiBuilder<model::DoubleType>("DoubleType").parent(&Type); +const RttiType BoolType = RttiBuilder<model::BoolType>("BoolType").parent(&Type); +const RttiType EnumType = RttiBuilder<model::EnumType>("EnumType").parent(&Type); +const RttiType StructType = + RttiBuilder<model::StructType>("StructType").parent(&Type).composedOf(&Attribute); +const RttiType ArrayType = RttiBuilder<model::ArrayType>("ArrayType").parent(&Type); +const RttiType UnknownType = + RttiBuilder<model::UnknownType>("UnknownType").parent(&Type); +const RttiType Constant = RttiBuilder<model::Constant>("Constant").parent(&Node); +const RttiType Attribute = RttiBuilder<model::Attribute>("Attribute").parent(&Node); +const RttiType Typesystem = + RttiBuilder<model::Typesystem>("Typesystem").parent(&Node).composedOf( {&StringType, &IntType, &DoubleType, &BoolType, &EnumType, &StructType, &Constant}); -const Rtti<model::SystemTypesystem> SystemTypesystem = - RttiBuilder("SystemTypesystem").parent(&Typesystem); +const RttiType SystemTypesystem = + RttiBuilder<model::SystemTypesystem> ("SystemTypesystem").parent(&Typesystem); } } diff --git a/src/core/model/Typesystem.hpp b/src/core/model/Typesystem.hpp index a4a679d..1b54a07 100644 --- a/src/core/model/Typesystem.hpp +++ b/src/core/model/Typesystem.hpp @@ -1097,67 +1097,67 @@ namespace RttiTypes { /** * Type information for the Type class. */ -extern const Rtti<model::Type> Type; +extern const RttiType Type; /** * Type information for the StringType class. */ -extern const Rtti<model::StringType> StringType; +extern const RttiType StringType; /** * Type information for the IntType class. */ -extern const Rtti<model::IntType> IntType; +extern const RttiType IntType; /** * Type information for the DoubleType class. */ -extern const Rtti<model::DoubleType> DoubleType; +extern const RttiType DoubleType; /** * Type information for the BoolType class. */ -extern const Rtti<model::BoolType> BoolType; +extern const RttiType BoolType; /** * Type information for the EnumType class. */ -extern const Rtti<model::EnumType> EnumType; +extern const RttiType EnumType; /** * Type information for the StructType class. */ -extern const Rtti<model::StructType> StructType; +extern const RttiType StructType; /** * Type information for the ArrayType class. */ -extern const Rtti<model::ArrayType> ArrayType; +extern const RttiType ArrayType; /** * Type information for the UnknownType class. */ -extern const Rtti<model::UnknownType> UnknownType; +extern const RttiType UnknownType; /** * Type information for the Constant class. */ -extern const Rtti<model::Constant> Constant; +extern const RttiType Constant; /** - * Type information for the Constant class. + * Type information for the Attribute class. */ -extern const Rtti<model::Attribute> Attribute; +extern const RttiType Attribute; /** * Type information for the Typesystem class. */ -extern const Rtti<model::Typesystem> Typesystem; +extern const RttiType Typesystem; /** * Type information for the SystemTypesystem class. */ -extern const Rtti<model::SystemTypesystem> SystemTypesystem; +extern const RttiType SystemTypesystem; } } |