diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-12-06 23:07:12 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-12-06 23:07:12 +0000 |
commit | 2ac73347b605101e38500ca1030c14497dc0806b (patch) | |
tree | 10faa6c8669ae1ff8f58fcb57ccb911c695f0158 | |
parent | Push non-template dependent functions of model parts into common non-template... (diff) | |
download | slicer-2ac73347b605101e38500ca1030c14497dc0806b.tar.bz2 slicer-2ac73347b605101e38500ca1030c14497dc0806b.tar.xz slicer-2ac73347b605101e38500ca1030c14497dc0806b.zip |
Add missing support for optional roots in user types
-rw-r--r-- | slicer/slicer/parser.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/slicer/slicer/parser.cpp b/slicer/slicer/parser.cpp index 9c8e28e..607ff36 100644 --- a/slicer/slicer/parser.cpp +++ b/slicer/slicer/parser.cpp @@ -91,6 +91,8 @@ namespace Slicer { fprintbf(cpp, "#include <%s>\n\n", fs::change_extension(topLevelFile.filename(), ".h").string()); fprintbf(cpp, "#include <slicer/modelParts.h>\n\n"); fprintbf(cpp, "#define templateMODELPARTFOR(Type, ModelPart) \\\n"); + fprintbf(cpp, "template <> ModelPartPtr DLL_PUBLIC ModelPartFor(IceUtil::Optional<Type> & t) { return new ModelPartForOptional< ModelPart< Type > >(t); } \\\n"); + fprintbf(cpp, "template <> ModelPartPtr DLL_PUBLIC ModelPartFor(IceUtil::Optional<Type> * t) { return new ModelPartForOptional< ModelPart< Type > >(t); } \\\n"); fprintbf(cpp, "template <> ModelPartPtr DLL_PUBLIC ModelPartFor(Type & t) { return new ModelPart< Type >(t); } \\\n"); fprintbf(cpp, "template <> ModelPartPtr DLL_PUBLIC ModelPartFor(Type * t) { return new ModelPart< Type >(t); }\n\n"); fprintbf(cpp, "namespace Slicer {\n"); @@ -132,6 +134,9 @@ namespace Slicer { fprintbf(cpp, "template<>\n"); fprintbf(cpp, "DLL_PUBLIC std::string ModelPartForRoot< %s >::rootName(\"%s\");\n\n", type, name); + fprintbf(cpp, "template<>\n"); + fprintbf(cpp, "DLL_PUBLIC std::string ModelPartForRoot< IceUtil::Optional< %s > >::rootName(\"Optional%s\");\n\n", + type, name); } bool |