From 601d07df6339696bace0f303a69a0a02a39f9eea Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Thu, 22 Jan 2015 00:43:14 +0100 Subject: made setParent protected to be consistent with move semantics. --- src/core/model/Document.hpp | 5 ++++- src/core/model/Domain.hpp | 6 ++++++ src/core/model/Node.hpp | 14 +++++++------- 3 files changed, 17 insertions(+), 8 deletions(-) (limited to 'src/core/model') diff --git a/src/core/model/Document.hpp b/src/core/model/Document.hpp index a7dee25..f13faf2 100644 --- a/src/core/model/Document.hpp +++ b/src/core/model/Document.hpp @@ -372,6 +372,8 @@ public: * information please refer to the header documentation above. */ class StructuredEntity : public StructureNode, public DocumentEntity { + friend Document; + protected: bool doValidate(Logger &logger) const override; @@ -497,7 +499,7 @@ public: class Anchor : public StructureNode { protected: bool doValidate(Logger &logger) const override; - + public: /** * Constructor for Anchor. @@ -545,6 +547,7 @@ public: */ class AnnotationEntity : public Node, public DocumentEntity { friend DocumentEntity; + friend Document; private: Owned start; diff --git a/src/core/model/Domain.hpp b/src/core/model/Domain.hpp index e485171..85caa14 100644 --- a/src/core/model/Domain.hpp +++ b/src/core/model/Domain.hpp @@ -249,6 +249,8 @@ class Domain; * undefined state. */ class FieldDescriptor : public Node { + friend Descriptor; + public: /** * This enum class contains all possible FieldTypes, meaning either the @@ -672,6 +674,8 @@ static const Cardinality AnyCardinality = createAny(); * What about the cardinality? */ class StructuredClass : public Descriptor { + friend Domain; + private: const Cardinality cardinality; Owned superclass; @@ -833,6 +837,8 @@ public: * This class has no special properties and is in essence just a Descriptor. */ class AnnotationClass : public Descriptor { + friend Domain; + public: /** * The constructor for a new AnnotationClass. Note that you have to add diff --git a/src/core/model/Node.hpp b/src/core/model/Node.hpp index 6923125..c5761a8 100644 --- a/src/core/model/Node.hpp +++ b/src/core/model/Node.hpp @@ -209,6 +209,13 @@ private: Logger &logger) const; protected: + /** + * Sets the parent node. + * + * @param parent is a Handle to the parent node. + */ + void setParent(Handle parent); + /** * Function which should be overwritten by derived classes in order to * resolve node names to a list of possible nodes. The implementations of @@ -450,13 +457,6 @@ public: */ Rooted getParent() const { return parent; } - /** - * Sets the parent node. - * - * @param parent is a Handle to the parent node. - */ - void setParent(Handle parent); - /** * Returns true, if the node does not have a parent. Root nodes may either * be the root element of the complete DOM tree -- cgit v1.2.3