summaryrefslogtreecommitdiff
path: root/test/core/model/TestDomain.hpp
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-05 15:05:28 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-05 15:05:28 +0100
commit15dd9d1aa1e0cfe8b31364fb42985ee8d5c5fc9d (patch)
treeb2a2543b442cc4b70e21cea80641bc36aa3b1e36 /test/core/model/TestDomain.hpp
parent4b5f49447e1583756c6f6bb15d7bc643bb7adda3 (diff)
corrected RTTI for domain und document and added a reference to system type system in test domain.
Diffstat (limited to 'test/core/model/TestDomain.hpp')
-rw-r--r--test/core/model/TestDomain.hpp30
1 files changed, 7 insertions, 23 deletions
diff --git a/test/core/model/TestDomain.hpp b/test/core/model/TestDomain.hpp
index f457531..54e79ee 100644
--- a/test/core/model/TestDomain.hpp
+++ b/test/core/model/TestDomain.hpp
@@ -26,32 +26,15 @@ namespace ousia {
namespace model {
/**
- * This constructs a somewhat trivial system of standard types.
- *
- * Currently contained: string, text (struct wrapper for string)
- */
-static Rooted<Typesystem> constructTypeSystem(Manager &mgr, Logger &logger)
-{
- Rooted<Typesystem> sys{new Typesystem(mgr, "std")};
- Rooted<StringType> string{new StringType(mgr, sys)};
- sys->addType(string);
- Rooted<StructType> string_struct{StructType::createValidated(
- mgr, "text", sys, nullptr, {new Attribute(mgr, "content", string, "", false)}, logger)};
- sys->addType(string_struct);
-
- return sys;
-}
-
-/**
* This constructs the "book" domain for test purposes. The structure of the
* domain is fairly simple and can be seen from the construction itself.
*/
-static Rooted<Domain> constructBookDomain(Manager &mgr, Logger &logger)
+static Rooted<Domain> constructBookDomain(Manager &mgr,
+ Handle<SystemTypesystem> sys,
+ Logger &logger)
{
// Start with the Domain itself.
- Rooted<Domain> domain{new Domain(mgr, "book")};
- // The standard type system.
- domain->getTypesystems().push_back(constructTypeSystem(mgr, logger));
+ Rooted<Domain> domain{new Domain(mgr, sys, "book")};
// Set up the cardinalities we'll need.
Cardinality single;
single.merge({1});
@@ -82,9 +65,10 @@ static Rooted<Domain> constructBookDomain(Manager &mgr, Logger &logger)
book_field->getChildren().push_back(paragraph);
domain->getStructureClasses().push_back(paragraph);
// And the field of it.
- Rooted<FieldDescriptor> paragraph_field{new FieldDescriptor(mgr, paragraph)};
+ Rooted<FieldDescriptor> paragraph_field{
+ new FieldDescriptor(mgr, paragraph)};
paragraph->getFieldDescriptors().push_back(paragraph_field);
-
+
// Finally we add the "text" node, which is transparent as well.
Rooted<StructuredClass> text{new StructuredClass(
mgr, "text", domain, any, {nullptr}, {nullptr}, true)};