summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-07-22 00:21:44 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2017-07-22 00:21:44 +0100
commit9c12992889598ce3fadeb3d7dde36dba732d6fed (patch)
treec0e27b2b05f60d58703bf0725495e12dedacf243
parentMove some generated sequence code into impl.h (diff)
downloadslicer-9c12992889598ce3fadeb3d7dde36dba732d6fed.tar.bz2
slicer-9c12992889598ce3fadeb3d7dde36dba732d6fed.tar.xz
slicer-9c12992889598ce3fadeb3d7dde36dba732d6fed.zip
Move some generated enum code into impl.h
-rw-r--r--slicer/slicer/modelPartsTypes.impl.h16
-rw-r--r--slicer/tool/parser.cpp11
2 files changed, 16 insertions, 11 deletions
diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h
index 76b71dc..71ad746 100644
--- a/slicer/slicer/modelPartsTypes.impl.h
+++ b/slicer/slicer/modelPartsTypes.impl.h
@@ -368,6 +368,22 @@ namespace Slicer {
return i->second;
}
+ template<typename T>
+ void ModelPartForEnum<T>::SetValue(ValueSourcePtr s)
+ {
+ BOOST_ASSERT(this->Model);
+ std::string val;
+ s->set(val);
+ *this->Model = lookup(val);
+ }
+
+ template<typename T>
+ void ModelPartForEnum<T>::GetValue(ValueTargetPtr s)
+ {
+ BOOST_ASSERT(this->Model);
+ s->get(lookup(*this->Model));
+ }
+
// ModelPartForSequence
template<typename T>
ModelPartForSequence<T>::ModelPartForSequence(T * s) :
diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp
index a2fc81b..d9a7a2b 100644
--- a/slicer/tool/parser.cpp
+++ b/slicer/tool/parser.cpp
@@ -329,17 +329,6 @@ namespace Slicer {
}
fprintbf(cpp, "\treturn e;\n}());\n\n");
- fprintbf(cpp, "template<> DLL_PUBLIC\nvoid ModelPartForEnum< %s >::SetValue(ValueSourcePtr s) {\n\
- std::string val;\n\
- s->set(val);\n\
- *this->Model = lookup(val);\n\
-}\n\n",
- e->scoped());
- fprintbf(cpp, "template<> DLL_PUBLIC\nvoid ModelPartForEnum< %s >::GetValue(ValueTargetPtr s) {\n\
- s->get(lookup(*this->Model));\n\
-}\n\n",
- e->scoped());
-
auto name = metaDataValue("slicer:root:", e->getMetaData());
defineRoot(e->scoped(), name ? *name : e->name(), e);