From 0c06b2798b50ce3f54795d80aa6032175382af54 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 18 Jan 2015 21:09:11 +0100 Subject: Made constructors of Typesystem, Document and Domain more consistent --- src/core/model/Domain.hpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src/core/model/Domain.hpp') diff --git a/src/core/model/Domain.hpp b/src/core/model/Domain.hpp index 579a65c..dad726a 100644 --- a/src/core/model/Domain.hpp +++ b/src/core/model/Domain.hpp @@ -703,22 +703,36 @@ protected: void addAnnotationClass(Handle a); public: + /** * The constructor for a new domain. Note that this is an empty Domain and * still has to be filled with StructuredClasses and AnnotationClasses. * * @param mgr is the Manager instance. - * @param sys is the SystemTypesystem instance. * @param name is a name for this domain which will be used for later * references to this Domain. */ - Domain(Manager &mgr, Handle sys, std::string name) - // TODO: Can a domain have a parent? + Domain(Manager &mgr, std::string name) : Node(mgr, std::move(name), nullptr), structuredClasses(this), annotationClasses(this), - typesystems(this, std::vector>{sys}) + typesystems(this) + { + } + + /** + * The constructor for a new domain. Note that this is an empty Domain and + * still has to be filled with StructuredClasses and AnnotationClasses. + * + * @param mgr is the Manager instance. + * @param sys is the SystemTypesystem instance. + * @param name is a name for this domain which will be used for later + * references to this Domain. + */ + Domain(Manager &mgr, Handle sys, std::string name) + : Domain(mgr, std::move(name)) { + includeTypesystem(sys); } /** @@ -757,12 +771,12 @@ public: /** * Adds a Typesystem reference to this Domain. */ - void addTypesystem(Handle t) { typesystems.push_back(t); } + void includeTypesystem(Handle t) { typesystems.push_back(t); } /** * Adds multiple Typesystem references to this Domain. */ - void addTypesystems(const std::vector> &ts) + void includeTypesystems(const std::vector> &ts) { typesystems.insert(typesystems.end(), ts.begin(), ts.end()); } -- cgit v1.2.3