diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/model/Domain.cpp | 19 | ||||
| -rw-r--r-- | src/core/model/Domain.hpp | 17 | 
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 {  | 
