summaryrefslogtreecommitdiff
path: root/src/core/model/Domain.hpp
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-08 18:11:21 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-08 18:11:21 +0100
commit2c3b327739b79d5ba7fe931e205bec1ad320b360 (patch)
tree6afca317bcd036a51e37e4cbec3cddb6bdeaf555 /src/core/model/Domain.hpp
parent7269e0e232c7971248ffa47aa2ae44786f3d303a (diff)
further extended the advanced document example, slightly improved XML serialization and fixed a bug in DemoOutput leading to errors if a section/paragraph had no heading.
Diffstat (limited to 'src/core/model/Domain.hpp')
-rw-r--r--src/core/model/Domain.hpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/model/Domain.hpp b/src/core/model/Domain.hpp
index 96e13c7..8d5de0c 100644
--- a/src/core/model/Domain.hpp
+++ b/src/core/model/Domain.hpp
@@ -261,11 +261,6 @@ 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?
@@ -305,15 +300,19 @@ 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<Descriptor> parent,
FieldType fieldType = FieldType::TREE,
- std::string name = "")
+ std::string name = "",
+ bool optional = false)
: Node(mgr, std::move(name), parent),
children(this),
fieldType(fieldType),
// TODO: What would be a wise initialization of the primitiveType?
- optional(false)
+ optional(optional)
{
}