diff options
Diffstat (limited to 'src/core/model')
-rw-r--r-- | src/core/model/Document.cpp | 14 | ||||
-rw-r--r-- | src/core/model/Document.hpp | 4 | ||||
-rw-r--r-- | src/core/model/Domain.cpp | 13 | ||||
-rw-r--r-- | src/core/model/Domain.hpp | 5 | ||||
-rw-r--r-- | src/core/model/Project.cpp | 8 | ||||
-rw-r--r-- | src/core/model/Project.hpp | 22 | ||||
-rw-r--r-- | src/core/model/Typesystem.cpp | 29 | ||||
-rw-r--r-- | src/core/model/Typesystem.hpp | 5 |
8 files changed, 46 insertions, 54 deletions
diff --git a/src/core/model/Document.cpp b/src/core/model/Document.cpp index f22ccd6..f452695 100644 --- a/src/core/model/Document.cpp +++ b/src/core/model/Document.cpp @@ -25,7 +25,6 @@ #include <core/common/RttiBuilder.hpp> namespace ousia { -namespace model { /* Class DocumentEntity */ @@ -720,24 +719,23 @@ bool Document::hasChild(Handle<StructureNode> s) const } return false; } -} /* Type registrations */ namespace RttiTypes { -const Rtti Document = RttiBuilder<model::Document>("Document") +const Rtti Document = RttiBuilder<ousia::Document>("Document") .parent(&Node) .composedOf({&AnnotationEntity, &StructuredEntity}); const Rtti StructureNode = - RttiBuilder<model::StructureNode>("StructureNode").parent(&Node); + RttiBuilder<ousia::StructureNode>("StructureNode").parent(&Node); const Rtti StructuredEntity = - RttiBuilder<model::StructuredEntity>("StructuredEntity") + RttiBuilder<ousia::StructuredEntity>("StructuredEntity") .parent(&StructureNode) .composedOf({&StructuredEntity, &DocumentPrimitive, &Anchor}); -const Rtti DocumentPrimitive = RttiBuilder<model::DocumentPrimitive>( +const Rtti DocumentPrimitive = RttiBuilder<ousia::DocumentPrimitive>( "DocumentPrimitive").parent(&StructureNode); -const Rtti Anchor = RttiBuilder<model::Anchor>("Anchor").parent(&StructureNode); +const Rtti Anchor = RttiBuilder<ousia::Anchor>("Anchor").parent(&StructureNode); const Rtti AnnotationEntity = - RttiBuilder<model::AnnotationEntity>("AnnotationEntity") + RttiBuilder<ousia::AnnotationEntity>("AnnotationEntity") .parent(&Node) .composedOf({&StructuredEntity, &DocumentPrimitive, &Anchor}); } diff --git a/src/core/model/Document.hpp b/src/core/model/Document.hpp index 97bbb60..9ea2d6e 100644 --- a/src/core/model/Document.hpp +++ b/src/core/model/Document.hpp @@ -121,9 +121,6 @@ namespace ousia { // Forward declarations class Rtti; - -namespace model { - class Document; class StructureNode; class StructuredEntity; @@ -889,7 +886,6 @@ public: */ bool hasChild(Handle<StructureNode> s) const; }; -} namespace RttiTypes { extern const Rtti Document; diff --git a/src/core/model/Domain.cpp b/src/core/model/Domain.cpp index 3c4b64c..360aa83 100644 --- a/src/core/model/Domain.cpp +++ b/src/core/model/Domain.cpp @@ -24,7 +24,6 @@ #include "Domain.hpp" namespace ousia { -namespace model { /* Class FieldDescriptor */ @@ -545,21 +544,21 @@ Rooted<AnnotationClass> Domain::createAnnotationClass( return Rooted<AnnotationClass>{new AnnotationClass( getManager(), std::move(name), this, attributesDescriptor)}; } -} + /* Type registrations */ namespace RttiTypes { const Rtti FieldDescriptor = - RttiBuilder<model::FieldDescriptor>("FieldDescriptor").parent(&Node); + RttiBuilder<ousia::FieldDescriptor>("FieldDescriptor").parent(&Node); const Rtti Descriptor = - RttiBuilder<model::Descriptor>("Descriptor").parent(&Node); + RttiBuilder<ousia::Descriptor>("Descriptor").parent(&Node); const Rtti StructuredClass = - RttiBuilder<model::StructuredClass>("StructuredClass") + RttiBuilder<ousia::StructuredClass>("StructuredClass") .parent(&Descriptor) .composedOf(&FieldDescriptor); const Rtti AnnotationClass = - RttiBuilder<model::AnnotationClass>("AnnotationClass").parent(&Descriptor); -const Rtti Domain = RttiBuilder<model::Domain>("Domain") + RttiBuilder<ousia::AnnotationClass>("AnnotationClass").parent(&Descriptor); +const Rtti Domain = RttiBuilder<ousia::Domain>("Domain") .parent(&Node) .composedOf({&StructuredClass, &AnnotationClass}); } diff --git a/src/core/model/Domain.hpp b/src/core/model/Domain.hpp index ef228b1..541a428 100644 --- a/src/core/model/Domain.hpp +++ b/src/core/model/Domain.hpp @@ -212,10 +212,6 @@ namespace ousia { // Forward declarations class Rtti; - -namespace model { - -// Forward declarations class Descriptor; class StructuredClass; class Domain; @@ -1085,7 +1081,6 @@ public: typesystems.insert(typesystems.end(), ts.begin(), ts.end()); } }; -} namespace RttiTypes { diff --git a/src/core/model/Project.cpp b/src/core/model/Project.cpp index a0f1f08..a298ffc 100644 --- a/src/core/model/Project.cpp +++ b/src/core/model/Project.cpp @@ -25,10 +25,9 @@ namespace ousia { -namespace model { - -Project::Project(Manager &mgr) +Project::Project(Manager &mgr, Registry ®istry) : Node(mgr), + registry(registry), systemTypesystem(acquire(new SystemTypesystem(mgr))), documents(this) { @@ -69,10 +68,9 @@ void Project::addDocument(Handle<Document> document) } const NodeVector<Document> &Project::getDocuments() const { return documents; } -} namespace RttiTypes { -const Rtti Project = RttiBuilder<model::Project>("Project") +const Rtti Project = RttiBuilder<ousia::Project>("Project") .parent(&Node) .composedOf(&Document) .composedOf(&SystemTypesystem); diff --git a/src/core/model/Project.hpp b/src/core/model/Project.hpp index 4e2a43b..2c50f49 100644 --- a/src/core/model/Project.hpp +++ b/src/core/model/Project.hpp @@ -28,6 +28,8 @@ #ifndef _OUSIA_PROJECT_HPP_ #define _OUSIA_PROJECT_HPP_ +#include <core/resource/ResourceManager.hpp> + #include "Node.hpp" namespace ousia { @@ -35,9 +37,8 @@ namespace ousia { // Forward declarations class Logger; class Rtti; - -namespace model { - +class Registry; +class ParserContext; class SystemTypesystem; class Typesystem; class Document; @@ -51,6 +52,11 @@ class Domain; class Project : public Node { private: /** + * Reference at the internally used Registry instance. + */ + Registry ®istry; + + /** * Private instance of the system typesystem which is distributed as a * reference to all child typesystems. */ @@ -61,6 +67,11 @@ private: */ NodeVector<Document> documents; + /** + * ResourceManager used to manage all resources used by the project. + */ + ResourceManager resourceManager; + protected: /** * Validates the project and all parts it consists of. @@ -74,8 +85,10 @@ public: * Constructor of the Project class. * * @param mgr is the manager instance used for managing this Node. + * @param registry is the registry instance that should be used for locating + * files and finding parsers for these files. */ - Project(Manager &mgr); + Project(Manager &mgr, Registry ®istry); /** * Returns a reference to the internal system typesystem. @@ -123,7 +136,6 @@ public: */ const NodeVector<Document> &getDocuments() const; }; -} namespace RttiTypes { /** diff --git a/src/core/model/Typesystem.cpp b/src/core/model/Typesystem.cpp index f26363c..5f8f613 100644 --- a/src/core/model/Typesystem.cpp +++ b/src/core/model/Typesystem.cpp @@ -23,7 +23,6 @@ #include <core/common/VariantConverter.hpp> namespace ousia { -namespace model { /* Class Type */ @@ -562,31 +561,31 @@ SystemTypesystem::SystemTypesystem(Manager &mgr) addType(doubleType); addType(boolType); } -} + /* RTTI type registrations */ namespace RttiTypes { -const Rtti Type = RttiBuilder<model::Type>("Type").parent(&Node); +const Rtti Type = RttiBuilder<ousia::Type>("Type").parent(&Node); const Rtti StringType = - RttiBuilder<model::StringType>("StringType").parent(&Type); -const Rtti IntType = RttiBuilder<model::IntType>("IntType").parent(&Type); + RttiBuilder<ousia::StringType>("StringType").parent(&Type); +const Rtti IntType = RttiBuilder<ousia::IntType>("IntType").parent(&Type); const Rtti DoubleType = - RttiBuilder<model::DoubleType>("DoubleType").parent(&Type); -const Rtti BoolType = RttiBuilder<model::BoolType>("BoolType").parent(&Type); -const Rtti EnumType = RttiBuilder<model::EnumType>("EnumType").parent(&Type); + RttiBuilder<ousia::DoubleType>("DoubleType").parent(&Type); +const Rtti BoolType = RttiBuilder<ousia::BoolType>("BoolType").parent(&Type); +const Rtti EnumType = RttiBuilder<ousia::EnumType>("EnumType").parent(&Type); const Rtti StructType = - RttiBuilder<model::StructType>("StructType").parent(&Type).composedOf(&Attribute); -const Rtti ArrayType = RttiBuilder<model::ArrayType>("ArrayType").parent(&Type); + RttiBuilder<ousia::StructType>("StructType").parent(&Type).composedOf(&Attribute); +const Rtti ArrayType = RttiBuilder<ousia::ArrayType>("ArrayType").parent(&Type); const Rtti UnknownType = - RttiBuilder<model::UnknownType>("UnknownType").parent(&Type); -const Rtti Constant = RttiBuilder<model::Constant>("Constant").parent(&Node); -const Rtti Attribute = RttiBuilder<model::Attribute>("Attribute").parent(&Node); + RttiBuilder<ousia::UnknownType>("UnknownType").parent(&Type); +const Rtti Constant = RttiBuilder<ousia::Constant>("Constant").parent(&Node); +const Rtti Attribute = RttiBuilder<ousia::Attribute>("Attribute").parent(&Node); const Rtti Typesystem = - RttiBuilder<model::Typesystem>("Typesystem").parent(&Node).composedOf( + RttiBuilder<ousia::Typesystem>("Typesystem").parent(&Node).composedOf( {&StringType, &IntType, &DoubleType, &BoolType, &EnumType, &StructType, &Constant}); const Rtti SystemTypesystem = - RttiBuilder<model::SystemTypesystem> ("SystemTypesystem").parent(&Typesystem); + RttiBuilder<ousia::SystemTypesystem> ("SystemTypesystem").parent(&Typesystem); } } diff --git a/src/core/model/Typesystem.hpp b/src/core/model/Typesystem.hpp index e0aa81e..1405ed6 100644 --- a/src/core/model/Typesystem.hpp +++ b/src/core/model/Typesystem.hpp @@ -42,10 +42,6 @@ namespace ousia { // Forward declarations class Rtti; - -namespace model { - -// Forward declarations class Typesystem; class SystemTypesystem; @@ -1131,7 +1127,6 @@ public: */ Rooted<BoolType> getBoolType() { return boolType; } }; -} /* RTTI type registrations */ |