summaryrefslogtreecommitdiff
path: root/test/core/model/TestDomain.hpp
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-12 13:42:10 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-12 13:42:10 +0100
commit60d9d3f9f54fab975c39d4c341f118df90628375 (patch)
treee3e43951c70960b6cd8d55abb348bd4d4589bb2b /test/core/model/TestDomain.hpp
parent909a9e98999e72262bd353027ce70c6c0377cf9c (diff)
normalized NodeVector access in model classes and added some more documentation to model classes.
Diffstat (limited to 'test/core/model/TestDomain.hpp')
-rw-r--r--test/core/model/TestDomain.hpp32
1 files changed, 16 insertions, 16 deletions
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<Domain> constructBookDomain(Manager &mgr,
// Set up the "book" node.
Rooted<StructuredClass> 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<FieldDescriptor> book_field{new FieldDescriptor(mgr, book)};
- book->getFieldDescriptors().push_back(book_field);
+ book->addFieldDescriptor(book_field);
// From there on the "section".
Rooted<StructuredClass> 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<FieldDescriptor> 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<StructuredClass> 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<FieldDescriptor> paragraph_field{
new FieldDescriptor(mgr, paragraph)};
- paragraph->getFieldDescriptors().push_back(paragraph_field);
+ paragraph->addFieldDescriptor(paragraph_field);
// We append "subsection" to section.
Rooted<StructuredClass> 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<FieldDescriptor> 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<StructuredClass> 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<FieldDescriptor> 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;
}