diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-16 17:33:56 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-16 17:33:56 +0100 |
commit | 821648607f5e0c6702eefbc206c0421d1a347bda (patch) | |
tree | d6a5241ba39d75d7aec1f7e8544e05a03142e47d /src/core/model/Document.hpp | |
parent | 9929838e62d9c17647d74be54af5853e8b613c4b (diff) |
first attempt on validation method for Document classes.
Diffstat (limited to 'src/core/model/Document.hpp')
-rw-r--r-- | src/core/model/Document.hpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/core/model/Document.hpp b/src/core/model/Document.hpp index c70a6a3..b73e07d 100644 --- a/src/core/model/Document.hpp +++ b/src/core/model/Document.hpp @@ -108,6 +108,8 @@ #ifndef _OUSIA_MODEL_DOCUMENT_HPP_ #define _OUSIA_MODEL_DOCUMENT_HPP_ +#include <set> + #include <core/managed/ManagedContainer.hpp> #include <core/common/Variant.hpp> @@ -159,6 +161,8 @@ protected: fields[getFieldDescriptorIndex(fieldName, true)].push_back(s); } + bool doValidate(Logger &logger, std::set<ManagedUid> &visited) const; + public: /** * The constructor for a DocumentEntity. Node that this does not inherit @@ -256,8 +260,6 @@ public: return fields[getFieldDescriptorIndex(fieldDescriptor, true)]; } - bool validate(Logger& logger) const; - // TODO: Change this to move methods. // /** // * This adds a StructureNode to the field with the given name. If an @@ -343,6 +345,8 @@ public: * common superclass for StructuredEntity, Anchor and DocumentPrimitive. */ class StructureNode : public Node { + friend DocumentEntity; + public: /** * Constructor for a StructureNode at the root. @@ -364,6 +368,10 @@ public: * information please refer to the header documentation above. */ class StructuredEntity : public StructureNode, public DocumentEntity { +protected: + bool doValidate(Logger &logger, + std::set<ManagedUid> &visited) const override; + public: /** * Constructor for a StructuredEntity in the Structure Tree. @@ -505,6 +513,9 @@ class AnnotationEntity : public Node, public DocumentEntity { private: Owned<Anchor> start; Owned<Anchor> end; +protected: + bool doValidate(Logger &logger, + std::set<ManagedUid> &visited) const override; public: /** |