summaryrefslogtreecommitdiff
path: root/src/core/model/Document.hpp
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-15 12:13:18 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-15 12:13:18 +0100
commit496c4e527852d0fd64a24bd5ac2506e50ba0afc7 (patch)
treedfcd496dd09e203849d0c4a557f48f355fbfc9c4 /src/core/model/Document.hpp
parent86885e5a63c10d264bac822cb054607c27c0f734 (diff)
supported more automatic registration behaviour, checked for internal name consistency regarding FieldDescriptors, AnnotationClasses and StructuredClasses and made adding methods for automatically registered references protected.
Diffstat (limited to 'src/core/model/Document.hpp')
-rw-r--r--src/core/model/Document.hpp30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/core/model/Document.hpp b/src/core/model/Document.hpp
index 357b752..15a5ec8 100644
--- a/src/core/model/Document.hpp
+++ b/src/core/model/Document.hpp
@@ -427,7 +427,9 @@ public:
* The constructor for an AnnotationEntity.
*
* @param mgr is the Manager instance.
- * @param parent is the Document this AnnotationEntity is part of.
+ * @param parent is the Document this AnnotationEntity is part of. The
+ * constructor will automatically register this
+ * AnnotationEntity at that document.
* @param descriptor is the AnnotationClass of this AnnotationEntity.
* @param start is the start Anchor of this AnnotationEntity. It has to
* be part of the Document given as parent.
@@ -441,13 +443,7 @@ public:
AnnotationEntity(Manager &mgr, Handle<Document> parent,
Handle<AnnotationClass> descriptor, Handle<Anchor> start,
Handle<Anchor> end, Variant attributes = {},
- std::string name = "")
- : Node(mgr, std::move(name), parent),
- DocumentEntity(this, descriptor, attributes),
- start(acquire(start)),
- end(acquire(end))
- {
- }
+ std::string name = "");
/**
* Returns the start Anchor of this AnnotationEntity.
@@ -470,6 +466,9 @@ public:
* document and the AnnotationEntities that span over Anchors in this Document.
*/
class Document : public Node {
+
+friend AnnotationEntity;
+
private:
// TODO: Might there be several roots? E.g. metadata?
Owned<StructuredEntity> root;
@@ -511,21 +510,6 @@ public:
}
/**
- * Adds an AnnotationEntity to this document. The Anchors used as start and
- * end of this AnnotationEntity have to be part of this document.
- */
- void addAnnotation(Handle<AnnotationEntity> a) { annotations.push_back(a); }
- /**
- * Adds multiple AnnotationEntities to this document. The Anchors used as
- * start and end of these AnnotationEntities have to be part of this
- * document.
- */
- void addAnnotations(const std::vector<Handle<AnnotationEntity>> &as)
- {
- annotations.insert(annotations.end(), as.begin(), as.end());
- }
-
- /**
* Returns a const reference to the NodeVector of Domains that are used
* within this Document.
*