From f1bb76dedf2d6b480b566540e811a7e0d3af9886 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Sun, 21 Dec 2014 15:13:37 +0100 Subject: 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. --- test/core/model/TestDomain.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/core') 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 constructBookDomain(Manager &mgr) any.merge(Range::typeRangeFrom(0)); // Set up the "book" node. - Rooted book{ - new StructuredClass(mgr, "book", domain, single)}; - domain->getRootStructures().push_back(book); + Rooted book{new StructuredClass( + mgr, "book", domain, single, {nullptr}, {nullptr}, false, true)}; + domain->getStructureClasses().push_back(book); // The structure field of it. Rooted book_field{new FieldDescriptor(mgr, book)}; book->getFieldDescriptors().push_back(book_field); @@ -70,6 +70,7 @@ static Rooted constructBookDomain(Manager &mgr) Rooted section{ new StructuredClass(mgr, "section", domain, any)}; book_field->getChildren().push_back(section); + domain->getStructureClasses().push_back(section); // And the field of it. Rooted section_field{new FieldDescriptor(mgr, section)}; section->getFieldDescriptors().push_back(section_field); @@ -79,6 +80,7 @@ static Rooted 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 paragraph_field{new FieldDescriptor( mgr, paragraph, domain->getTypesystems()[0]->getTypes()[1], "text", -- cgit v1.2.3