diff options
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( |