diff options
-rw-r--r-- | slicer/slicer/modelPartsTypes.impl.h | 16 | ||||
-rw-r--r-- | slicer/tool/parser.cpp | 11 |
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); |