summaryrefslogtreecommitdiff
path: root/test/core
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2014-12-21 15:13:37 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2014-12-21 15:13:37 +0100
commitf1bb76dedf2d6b480b566540e811a7e0d3af9886 (patch)
treec71e4e637ee8fab349d4368af84bf67922bb234a /test/core
parent54d66cfa220128ae6c7cd05aa5db3354e459105b (diff)
First draft of book domain example and slight changes to the book domain: _all_ structuredclasses are listed in the domain now and StructuredClasses that are allowed at the root level have a root flag.
Diffstat (limited to 'test/core')
-rw-r--r--test/core/model/TestDomain.hpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/core/model/TestDomain.hpp b/test/core/model/TestDomain.hpp
index 41fcdef..dd58524 100644
--- a/test/core/model/TestDomain.hpp
+++ b/test/core/model/TestDomain.hpp
@@ -59,9 +59,9 @@ static Rooted<Domain> constructBookDomain(Manager &mgr)
any.merge(Range<size_t>::typeRangeFrom(0));
// Set up the "book" node.
- Rooted<StructuredClass> book{
- new StructuredClass(mgr, "book", domain, single)};
- domain->getRootStructures().push_back(book);
+ Rooted<StructuredClass> book{new StructuredClass(
+ mgr, "book", domain, single, {nullptr}, {nullptr}, false, true)};
+ domain->getStructureClasses().push_back(book);
// The structure field of it.
Rooted<FieldDescriptor> book_field{new FieldDescriptor(mgr, book)};
book->getFieldDescriptors().push_back(book_field);
@@ -70,6 +70,7 @@ static Rooted<Domain> constructBookDomain(Manager &mgr)
Rooted<StructuredClass> section{
new StructuredClass(mgr, "section", domain, any)};
book_field->getChildren().push_back(section);
+ domain->getStructureClasses().push_back(section);
// And the field of it.
Rooted<FieldDescriptor> section_field{new FieldDescriptor(mgr, section)};
section->getFieldDescriptors().push_back(section_field);
@@ -79,6 +80,7 @@ static Rooted<Domain> constructBookDomain(Manager &mgr)
mgr, "paragraph", domain, any, {nullptr}, {nullptr}, true)};
section_field->getChildren().push_back(paragraph);
book_field->getChildren().push_back(paragraph);
+ domain->getStructureClasses().push_back(paragraph);
// ... and has a primitive field.
Rooted<FieldDescriptor> paragraph_field{new FieldDescriptor(
mgr, paragraph, domain->getTypesystems()[0]->getTypes()[1], "text",