summaryrefslogtreecommitdiff
path: root/src/core/model
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-13 20:17:42 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-13 20:17:42 +0100
commitc708de929ea0eca7901ffb7827809ffbb41c6425 (patch)
tree1b4eea39b893eaa1121adafa3b202a0d315eefa4 /src/core/model
parent4b06295dbb1b3b928df3a7bbdfc5968e4a604b2c (diff)
added domain references to domain.
Diffstat (limited to 'src/core/model')
-rw-r--r--src/core/model/Domain.cpp19
-rw-r--r--src/core/model/Domain.hpp17
2 files changed, 27 insertions, 9 deletions
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> node)
{
- if (node->isa(&RttiTypes::Domain)) {
+ if (node->isa(&RttiTypes::Typesystem)) {
referenceTypesystem(node.cast<Typesystem>());
}
+ if (node->isa(&RttiTypes::Domain)) {
+ referenceDomain(node.cast<Domain>());
+ }
}
RttiSet Domain::doGetReferenceTypes() const
{
- return RttiSet{&RttiTypes::Domain};
+ return RttiSet{&RttiTypes::Domain, &RttiTypes::Typesystem};
}
void Domain::addStructuredClass(Handle<StructuredClass> 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<StructuredClass> structuredClasses;
NodeVector<AnnotationClass> annotationClasses;
NodeVector<Typesystem> typesystems;
+ NodeVector<Domain> 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<Domain> d) { domains.push_back(d); }
+
+ /**
+ * Adds multiple Domain references to this Domain.
+ */
+ void referenceDomains(const std::vector<Handle<Domain>> &ds)
+ {
+ domains.insert(domains.end(), ds.begin(), ds.end());
+ }
};
namespace RttiTypes {