summaryrefslogtreecommitdiff
path: root/src/core/model/Domain.cpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-23 01:25:26 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-23 01:25:26 +0100
commit1dabb6ca6d5a6a294ea0d6115a16d402cf4799ab (patch)
tree7816e703a323107c5ff3faf797a108b5c3b3c568 /src/core/model/Domain.cpp
parent748a44fba54acb936249d13f69231c85f07a1069 (diff)
parent78bdb210ad81edd0ba41a6adfc4797b1ccc62228 (diff)
Merge branch 'master' of somweyr.de:ousia
Diffstat (limited to 'src/core/model/Domain.cpp')
-rw-r--r--src/core/model/Domain.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/core/model/Domain.cpp b/src/core/model/Domain.cpp
index b425174..c7afd22 100644
--- a/src/core/model/Domain.cpp
+++ b/src/core/model/Domain.cpp
@@ -289,6 +289,20 @@ bool Descriptor::removeFieldDescriptor(Handle<FieldDescriptor> fd)
return false;
}
+Rooted<FieldDescriptor> Descriptor::createPrimitiveFieldDescriptor(
+ Handle<Type> primitiveType, std::string name, bool optional)
+{
+ return Rooted<FieldDescriptor>{new FieldDescriptor(
+ getManager(), this, primitiveType, std::move(name), optional)};
+}
+
+Rooted<FieldDescriptor> Descriptor::createFieldDescriptor(
+ FieldDescriptor::FieldType fieldType, std::string name, bool optional)
+{
+ return Rooted<FieldDescriptor>{new FieldDescriptor(
+ getManager(), this, fieldType, std::move(name), optional)};
+}
+
/* Class StructuredClass */
StructuredClass::StructuredClass(Manager &mgr, std::string name,
@@ -481,6 +495,16 @@ bool Domain::removeStructuredClass(Handle<StructuredClass> s)
return false;
}
+Rooted<StructuredClass> Domain::createStructuredClass(
+ std::string name, const Cardinality &cardinality,
+ Handle<StructType> attributesDescriptor, Handle<StructuredClass> superclass,
+ bool transparent, bool root)
+{
+ return Rooted<StructuredClass>{new StructuredClass(
+ getManager(), std::move(name), this, cardinality, attributesDescriptor,
+ superclass, std::move(transparent), std::move(root))};
+}
+
void Domain::addAnnotationClass(Handle<AnnotationClass> a)
{
// only add it if we need to.
@@ -509,6 +533,13 @@ bool Domain::removeAnnotationClass(Handle<AnnotationClass> a)
}
return false;
}
+
+Rooted<AnnotationClass> Domain::createAnnotationClass(
+ std::string name, Handle<StructType> attributesDescriptor)
+{
+ return Rooted<AnnotationClass>{new AnnotationClass(
+ getManager(), std::move(name), this, attributesDescriptor)};
+}
}
/* Type registrations */