diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-16 15:20:49 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-16 15:20:49 +0100 |
commit | 9929838e62d9c17647d74be54af5853e8b613c4b (patch) | |
tree | 732446f234419a0f1baa5208722e9236affd74bc /src/core/model/Domain.cpp | |
parent | 8cf24170a4998e316c1b9c9bfd2b56e266c544cd (diff) |
validate function for Domain::Descriptor.
Diffstat (limited to 'src/core/model/Domain.cpp')
-rw-r--r-- | src/core/model/Domain.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/model/Domain.cpp b/src/core/model/Domain.cpp index b4fea3c..2ac2d8d 100644 --- a/src/core/model/Domain.cpp +++ b/src/core/model/Domain.cpp @@ -36,6 +36,7 @@ static void checkUniqueName(Handle<Node> parent, NodeVector<T> vec, childNames.insert(c->getName()); } if (childNames.find(child->getName()) != childNames.end()) { + //TODO: Do we really want to have an exception here? throw OusiaException(std::string("The ") + parentClassName + " " + parent->getName() + " already has a " + childClassName + " with name " + child->getName()); @@ -218,6 +219,16 @@ StructuredClass::StructuredClass(Manager &mgr, std::string name, } } +bool StructuredClass::isSubclassOf(Handle<StructuredClass> c) const{ + if(c == nullptr || superclass == nullptr){ + return false; + } + if(c == superclass){ + return true; + } + return superclass->isSubclassOf(c); +} + /* Class AnnotationClass */ AnnotationClass::AnnotationClass( |