From 7269e0e232c7971248ffa47aa2ae44786f3d303a Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Thu, 8 Jan 2015 17:20:56 +0100 Subject: slight changes to Domain and Document. Started to add a more advanced test document creation function as well as the respective domain creation functions. The DemoOutputTest for it looks good so far. --- src/core/model/Domain.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/core/model/Domain.hpp') diff --git a/src/core/model/Domain.hpp b/src/core/model/Domain.hpp index 6995d14..96e13c7 100644 --- a/src/core/model/Domain.hpp +++ b/src/core/model/Domain.hpp @@ -261,6 +261,11 @@ protected: VisitorSet &visited) override; public: + /** + * Note, that this flag will always be set to "false" for non-primitive + * FieldDescriptors, because in that case the cardinalities regulate + * whether children have to be inserted or not. + */ const bool optional; // TODO: What about the name of default fields? @@ -300,18 +305,15 @@ public: * TREE for the main or default structure or SUBTREE * for supporting structures. * @param name is the name of this field. - * @param optional should be set to 'false' is this field needs to be - * filled in order for an instance of the parent - * Descriptor to be valid. */ FieldDescriptor(Manager &mgr, Handle parent, FieldType fieldType = FieldType::TREE, - std::string name = "", bool optional = false) + std::string name = "") : Node(mgr, std::move(name), parent), children(this), fieldType(fieldType), // TODO: What would be a wise initialization of the primitiveType? - optional(optional) + optional(false) { } -- cgit v1.2.3