From f90a9bf51f300dd277071b1461d00411d7c21b89 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Thu, 22 Jan 2015 02:45:57 +0100 Subject: Rethought task of the Project class: Only keeps track of the included documents -- does not have references to typesystems, domains etc. (this allows instances of these classes to be freed as soon as no document refers to them). Project should be a parent of Document. Project should resolve documents as composita (this allows to have between-document references). --- src/core/model/Project.hpp | 51 +++++++--------------------------------------- 1 file changed, 7 insertions(+), 44 deletions(-) (limited to 'src/core/model/Project.hpp') diff --git a/src/core/model/Project.hpp b/src/core/model/Project.hpp index 576bd60..4e2a43b 100644 --- a/src/core/model/Project.hpp +++ b/src/core/model/Project.hpp @@ -44,8 +44,9 @@ class Document; class Domain; /** - * The Project class constitutes the top-level node in which documents, domains, - * typesystems and other resources are embedded. + * The Project class constitutes the top-level node in which a collection of + * documents are stored. It also contains an instance of the SystemTypesystem + * and allows for simple creation of new Typesystem and Domain instances. */ class Project : public Node { private: @@ -60,16 +61,6 @@ private: */ NodeVector documents; - /** - * List containing all loaded domains. - */ - NodeVector domains; - - /** - * List containing all loaded typesystems. - */ - NodeVector typesystems; - protected: /** * Validates the project and all parts it consists of. @@ -102,13 +93,6 @@ public: */ Rooted createTypesystem(const std::string &name); - /** - * Adds a single new typesystem to the project. - * - * @param typesystem is the typesystem that should be added to the project. - */ - void addTypesystem(Handle typesystem); - /** * Returns a new document with the given name and adds it to the list of * documents. @@ -117,13 +101,6 @@ public: */ Rooted createDocument(const std::string &name); - /** - * Adds the given document to the list of documents in the project. - * - * @param document is the document that should be added to the project. - */ - void addDocument(Handle document); - /** * Returns a new domain with the given name and adds it to the list of * domains. Provides a reference of the system typesystem to the domain. @@ -133,32 +110,18 @@ public: Rooted createDomain(const std::string &name); /** - * Adds the given domain to the list of domains in the project. + * Adds the given document to the list of documents in the project. * - * @param domain is the document that should be added to the project. + * @param document is the document that should be added to the project. */ - void addDomain(Handle domain); + void addDocument(Handle document); /** * Returns all documents of this project. * * @return a reference pointing at the document list. */ - const NodeVector &getDocuments(); - - /** - * Returns all domains of this project. - * - * @return a reference pointing at the domain list. - */ - const NodeVector &getDomains(); - - /** - * Returns all typesystems of this project. - * - * @return a reference pointing at the typesystem list. - */ - const NodeVector &getTypesystems(); + const NodeVector &getDocuments() const; }; } -- cgit v1.2.3