From e2a765fc4eaf559bce04b53ca1a1538b1f5f1628 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Mon, 16 Feb 2015 13:49:47 +0100 Subject: Allow typesystem references in Document --- src/core/model/Document.hpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/core/model/Document.hpp') diff --git a/src/core/model/Document.hpp b/src/core/model/Document.hpp index 5f06eb0..e314304 100644 --- a/src/core/model/Document.hpp +++ b/src/core/model/Document.hpp @@ -754,6 +754,7 @@ private: Owned root; NodeVector annotations; NodeVector domains; + NodeVector typesystems; protected: void doResolve(ResolutionState &state) override; @@ -771,7 +772,8 @@ public: Document(Manager &mgr, std::string name) : RootNode(mgr, std::move(name), nullptr), annotations(this), - domains(this) + domains(this), + typesystems(this) { } @@ -890,6 +892,25 @@ public: domains.insert(domains.end(), d.begin(), d.end()); } + /** + * Adds a Typesystem reference to this Document. + */ + void referenceTypesystem(Handle d) + { + invalidate(); + typesystems.push_back(d); + } + + /** + * Adds multiple Typesystem references to this Document. + */ + void referenceTypesystems(const std::vector> &d) + { + invalidate(); + typesystems.insert(typesystems.end(), d.begin(), d.end()); + } + + /** * Returns true if and only if the given StructureNode is part of this * document, meaning that there is a path of parent references in the -- cgit v1.2.3