summaryrefslogtreecommitdiff
path: root/src/core/model/Domain.hpp
diff options
context:
space:
mode:
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)
{
}