From c708de929ea0eca7901ffb7827809ffbb41c6425 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Fri, 13 Feb 2015 20:17:42 +0100 Subject: added domain references to domain. --- src/core/model/Domain.cpp | 19 +++++++++++-------- src/core/model/Domain.hpp | 17 ++++++++++++++++- 2 files changed, 27 insertions(+), 9 deletions(-) (limited to 'src/core') diff --git a/src/core/model/Domain.cpp b/src/core/model/Domain.cpp index 3cc9755..8288099 100644 --- a/src/core/model/Domain.cpp +++ b/src/core/model/Domain.cpp @@ -817,12 +817,12 @@ AnnotationClass::AnnotationClass(Manager &mgr, std::string name, void Domain::doResolve(ResolutionState &state) { - if (!continueResolveComposita(structuredClasses, - structuredClasses.getIndex(), state) | - continueResolveComposita(annotationClasses, - annotationClasses.getIndex(), state)) { - continueResolveReferences(typesystems, state); - } + continueResolveComposita(structuredClasses, structuredClasses.getIndex(), + state); + continueResolveComposita(annotationClasses, annotationClasses.getIndex(), + state); + continueResolveReferences(typesystems, state); + continueResolveReferences(domains, state); } bool Domain::doValidate(Logger &logger) const @@ -837,14 +837,17 @@ bool Domain::doValidate(Logger &logger) const void Domain::doReference(Handle node) { - if (node->isa(&RttiTypes::Domain)) { + if (node->isa(&RttiTypes::Typesystem)) { referenceTypesystem(node.cast()); } + if (node->isa(&RttiTypes::Domain)) { + referenceDomain(node.cast()); + } } RttiSet Domain::doGetReferenceTypes() const { - return RttiSet{&RttiTypes::Domain}; + return RttiSet{&RttiTypes::Domain, &RttiTypes::Typesystem}; } void Domain::addStructuredClass(Handle s) diff --git a/src/core/model/Domain.hpp b/src/core/model/Domain.hpp index 6bc2fba..d921a9c 100644 --- a/src/core/model/Domain.hpp +++ b/src/core/model/Domain.hpp @@ -913,6 +913,7 @@ private: NodeVector structuredClasses; NodeVector annotationClasses; NodeVector typesystems; + NodeVector domains; protected: void doResolve(ResolutionState &state) override; @@ -933,7 +934,8 @@ public: : RootNode(mgr, std::move(name), nullptr), structuredClasses(this), annotationClasses(this), - typesystems(this) + typesystems(this), + domains(this) { } @@ -1084,6 +1086,19 @@ public: { typesystems.insert(typesystems.end(), ts.begin(), ts.end()); } + + /** + * Adds a Domain reference to this Domain. + */ + void referenceDomain(Handle d) { domains.push_back(d); } + + /** + * Adds multiple Domain references to this Domain. + */ + void referenceDomains(const std::vector> &ds) + { + domains.insert(domains.end(), ds.begin(), ds.end()); + } }; namespace RttiTypes { -- cgit v1.2.3