From 60d9d3f9f54fab975c39d4c341f118df90628375 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Mon, 12 Jan 2015 13:42:10 +0100 Subject: normalized NodeVector access in model classes and added some more documentation to model classes. --- test/core/model/TestDomain.hpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'test/core/model/TestDomain.hpp') diff --git a/test/core/model/TestDomain.hpp b/test/core/model/TestDomain.hpp index aa3096d..48db57a 100644 --- a/test/core/model/TestDomain.hpp +++ b/test/core/model/TestDomain.hpp @@ -44,53 +44,53 @@ static Rooted constructBookDomain(Manager &mgr, // Set up the "book" node. Rooted book{new StructuredClass( mgr, "book", domain, single, {nullptr}, {nullptr}, false, true)}; - domain->getStructureClasses().push_back(book); + domain->addStructuredClass(book); // The structure field of it. Rooted book_field{new FieldDescriptor(mgr, book)}; - book->getFieldDescriptors().push_back(book_field); + book->addFieldDescriptor(book_field); // From there on the "section". Rooted section{ new StructuredClass(mgr, "section", domain, any)}; - book_field->getChildren().push_back(section); - domain->getStructureClasses().push_back(section); + book_field->addChild(section); + domain->addStructuredClass(section); // And the field of it. Rooted section_field{new FieldDescriptor(mgr, section)}; - section->getFieldDescriptors().push_back(section_field); + section->addFieldDescriptor(section_field); // We also add the "paragraph", which is transparent. Rooted paragraph{new StructuredClass( mgr, "paragraph", domain, any, {nullptr}, {nullptr}, true)}; - section_field->getChildren().push_back(paragraph); - book_field->getChildren().push_back(paragraph); - domain->getStructureClasses().push_back(paragraph); + section_field->addChild(paragraph); + book_field->addChild(paragraph); + domain->addStructuredClass(paragraph); // And the field of it. Rooted paragraph_field{ new FieldDescriptor(mgr, paragraph)}; - paragraph->getFieldDescriptors().push_back(paragraph_field); + paragraph->addFieldDescriptor(paragraph_field); // We append "subsection" to section. Rooted subsection{ new StructuredClass(mgr, "subsection", domain, any)}; - section_field->getChildren().push_back(subsection); - domain->getStructureClasses().push_back(subsection); + section_field->addChild(subsection); + domain->addStructuredClass(subsection); // And the field of it. Rooted subsection_field{ new FieldDescriptor(mgr, subsection)}; - subsection->getFieldDescriptors().push_back(subsection_field); + subsection->addFieldDescriptor(subsection_field); // and we add the paragraph to subsections fields - subsection_field->getChildren().push_back(paragraph); + subsection_field->addChild(paragraph); // Finally we add the "text" node, which is transparent as well. Rooted text{new StructuredClass( mgr, "text", domain, any, {nullptr}, {nullptr}, true)}; - paragraph_field->getChildren().push_back(text); - domain->getStructureClasses().push_back(text); + paragraph_field->addChild(text); + domain->addStructuredClass(text); // ... and has a primitive field. Rooted text_field{new FieldDescriptor( mgr, text, domain->getTypesystems()[0]->getTypes()[0], "content", false)}; - text->getFieldDescriptors().push_back(text_field); + text->addFieldDescriptor(text_field); return domain; } -- cgit v1.2.3