From 15e866702806b941dedb8dff94342528c9cd0b69 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 5 Oct 2016 16:15:56 +0100 Subject: Use single instantiation point for model part roots --- slicer/slicer/modelPartsTypes.cpp | 18 ------------------ slicer/slicer/modelPartsTypes.impl.h | 2 ++ slicer/tool/parser.cpp | 3 --- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/slicer/slicer/modelPartsTypes.cpp b/slicer/slicer/modelPartsTypes.cpp index bc3810c..7cf508e 100644 --- a/slicer/slicer/modelPartsTypes.cpp +++ b/slicer/slicer/modelPartsTypes.cpp @@ -28,24 +28,6 @@ namespace Slicer { template<> const std::string Slicer::ModelPartForRoot>::rootName = "OptionalInt"; template<> const std::string Slicer::ModelPartForRoot>::rootName = "OptionalLong"; - template class Slicer::ModelPartForRoot; - template class Slicer::ModelPartForRoot; - template class Slicer::ModelPartForRoot; - template class Slicer::ModelPartForRoot; - template class Slicer::ModelPartForRoot; - template class Slicer::ModelPartForRoot; - template class Slicer::ModelPartForRoot; - template class Slicer::ModelPartForRoot; - - template class Slicer::ModelPartForRoot>; - template class Slicer::ModelPartForRoot>; - template class Slicer::ModelPartForRoot>; - template class Slicer::ModelPartForRoot>; - template class Slicer::ModelPartForRoot>; - template class Slicer::ModelPartForRoot>; - template class Slicer::ModelPartForRoot>; - template class Slicer::ModelPartForRoot>; - // ModelPartForRootBase ModelPartForRootBase::ModelPartForRootBase(ModelPartPtr m) : mp(m) diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h index 5788c3f..c34b482 100644 --- a/slicer/slicer/modelPartsTypes.impl.h +++ b/slicer/slicer/modelPartsTypes.impl.h @@ -10,6 +10,8 @@ #define CUSTOMMODELPARTFOR(Type, BaseModelPart, ModelPartType) \ template class BaseModelPart; \ + template class ModelPartForRoot; \ + template class ModelPartForRoot< IceUtil::Optional >; \ template<> ModelPartPtr ModelPart::CreateFor(Type & s) { return new ModelPartType(s); } \ template<> ModelPartPtr ModelPart::CreateFor(IceUtil::Optional & s) { return new ModelPartForOptional(s); } \ template<> ModelPartForRootPtr ModelPart::CreateRootFor(Type & s) { return new ModelPartForRoot(s); } \ diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp index d61c8a6..7613ab6 100644 --- a/slicer/tool/parser.cpp +++ b/slicer/tool/parser.cpp @@ -169,9 +169,6 @@ namespace Slicer { fprintbf(cpp, "template<> DLL_PUBLIC\n"); fprintbf(cpp, "const std::string ModelPartForRoot< IceUtil::Optional< %s > >::rootName(\"Optional%s\");\n\n", type, name); - - fprintbf(cpp, "template class ModelPartForRoot< %s >;\n\n", type); - fprintbf(cpp, "template class ModelPartForRoot< IceUtil::Optional< %s > >;\n\n", type); } bool -- cgit v1.2.3