From ef7b65317bf27bd7dcfaf306a2ec2e21b1cbe784 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 3 Nov 2020 00:44:14 +0000 Subject: Remove empty wrapper constructors from modelpart tree --- slicer/slicer/modelParts.h | 5 ++--- slicer/slicer/modelPartsTypes.h | 18 +++++++++--------- slicer/slicer/modelPartsTypes.impl.h | 26 -------------------------- 3 files changed, 11 insertions(+), 38 deletions(-) diff --git a/slicer/slicer/modelParts.h b/slicer/slicer/modelParts.h index 6b283a4..97b1623 100644 --- a/slicer/slicer/modelParts.h +++ b/slicer/slicer/modelParts.h @@ -159,9 +159,8 @@ namespace Slicer { }; template class DLL_PUBLIC ModelPartModel { - protected: - explicit ModelPartModel() : Model(nullptr) { } - explicit ModelPartModel(T * m) : Model(m) { } + public: + explicit ModelPartModel(T * m = nullptr) : Model(m) { } T * Model; }; diff --git a/slicer/slicer/modelPartsTypes.h b/slicer/slicer/modelPartsTypes.h index e1e96d6..af9bc9d 100644 --- a/slicer/slicer/modelPartsTypes.h +++ b/slicer/slicer/modelPartsTypes.h @@ -42,7 +42,7 @@ namespace Slicer { public: using element_type = T; - explicit ModelPartForSimple(T * h); + using ModelPartModel::ModelPartModel; void SetValue(ValueSource && s) override; bool GetValue(ValueTarget && s) override; @@ -73,7 +73,7 @@ namespace Slicer { public: using element_type = T; - explicit ModelPartForConverted(T * h); + using ModelPartModel::ModelPartModel; void SetValue(ValueSource && s) override; bool GetValue(ValueTarget && s) override; @@ -86,7 +86,7 @@ namespace Slicer { public: using element_type = Ice::optional; - explicit ModelPartForConverted(Ice::optional * h); + using ModelPartModel>::ModelPartModel; void SetValue(ValueSource && s) override; bool GetValue(ValueTarget && s) override; @@ -167,7 +167,7 @@ namespace Slicer { public: using element_type = std::shared_ptr; - explicit ModelPartForClass(element_type * h); + using ModelPartModel::ModelPartModel; void Create() override; @@ -199,7 +199,7 @@ namespace Slicer { public: using element_type = T; - explicit ModelPartForStruct(T * o); + using ModelPartModel::ModelPartModel; T * GetModel() override; @@ -221,7 +221,7 @@ namespace Slicer { public: using element_type = T; - explicit ModelPartForEnum(T * s); + using ModelPartModel::ModelPartModel; const Metadata & GetMetadata() const override; @@ -247,7 +247,7 @@ namespace Slicer { public: using element_type = T; - explicit ModelPartForSequence(T * s); + using ModelPartModel::ModelPartModel; void OnEachChild(const ChildHandler & ch) override; @@ -291,7 +291,7 @@ namespace Slicer { public: using element_type = T; - explicit ModelPartForDictionary(T * d); + using ModelPartModel::ModelPartModel; void OnEachChild(const ChildHandler & ch) override; @@ -329,7 +329,7 @@ namespace Slicer { template class DLL_PUBLIC ModelPartForStream : public ModelPartForStreamBase, ModelPartModel> { public: - explicit ModelPartForStream(Stream * s); + using ModelPartModel>::ModelPartModel; ModelPartPtr GetContainedModelPart() override; void OnEachChild(const ChildHandler & ch) override; diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h index b332c08..b75ad36 100644 --- a/slicer/slicer/modelPartsTypes.impl.h +++ b/slicer/slicer/modelPartsTypes.impl.h @@ -168,8 +168,6 @@ namespace Slicer { } // ModelPartForSimple - template ModelPartForSimple::ModelPartForSimple(T * h) : ModelPartModel(h) { } - template void ModelPartForSimple::SetValue(ValueSource && s) @@ -187,18 +185,6 @@ namespace Slicer { return true; } - // ModelPartForConverted - template - ModelPartForConverted::ModelPartForConverted(T * h) : ModelPartModel(h) - { - } - - template M::*MV> - ModelPartForConverted, M, MV>::ModelPartForConverted(Ice::optional * h) : - ModelPartModel>(h) - { - } - template M::*MV> bool ModelPartForConverted, M, MV>::HasValue() const @@ -397,8 +383,6 @@ namespace Slicer { }; // ModelPartForClass - template ModelPartForClass::ModelPartForClass(element_type * h) : ModelPartModel(h) { } - template void ModelPartForClass::Create() @@ -493,8 +477,6 @@ namespace Slicer { } // ModelPartForStruct - template ModelPartForStruct::ModelPartForStruct(T * o) : ModelPartModel(o) { } - template T * ModelPartForStruct::GetModel() @@ -510,8 +492,6 @@ namespace Slicer { } // ModelPartForEnum - template ModelPartForEnum::ModelPartForEnum(T * s) : ModelPartModel(s) { } - template const Metadata & ModelPartForEnum::GetMetadata() const @@ -565,8 +545,6 @@ namespace Slicer { } // ModelPartForSequence - template ModelPartForSequence::ModelPartForSequence(T * s) : ModelPartModel(s) { } - template void ModelPartForSequence::OnEachChild(const ChildHandler & ch) @@ -622,8 +600,6 @@ namespace Slicer { } // ModelPartForDictionary - template ModelPartForDictionary::ModelPartForDictionary(T * d) : ModelPartModel(d) { } - template void ModelPartForDictionary::OnEachChild(const ChildHandler & ch) @@ -668,8 +644,6 @@ namespace Slicer { } // ModelPartForStream - template ModelPartForStream::ModelPartForStream(Stream * s) : ModelPartModel>(s) { } - template ModelPartPtr ModelPartForStream::GetContainedModelPart() -- cgit v1.2.3