diff options
-rw-r--r-- | slicer/slicer/modelParts.h | 5 | ||||
-rw-r--r-- | slicer/slicer/modelPartsTypes.h | 18 | ||||
-rw-r--r-- | 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<typename T> 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<T>::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<T>::ModelPartModel; void SetValue(ValueSource && s) override; bool GetValue(ValueTarget && s) override; @@ -86,7 +86,7 @@ namespace Slicer { public: using element_type = Ice::optional<T>; - explicit ModelPartForConverted(Ice::optional<T> * h); + using ModelPartModel<Ice::optional<T>>::ModelPartModel; void SetValue(ValueSource && s) override; bool GetValue(ValueTarget && s) override; @@ -167,7 +167,7 @@ namespace Slicer { public: using element_type = std::shared_ptr<T>; - explicit ModelPartForClass(element_type * h); + using ModelPartModel<element_type>::ModelPartModel; void Create() override; @@ -199,7 +199,7 @@ namespace Slicer { public: using element_type = T; - explicit ModelPartForStruct(T * o); + using ModelPartModel<T>::ModelPartModel; T * GetModel() override; @@ -221,7 +221,7 @@ namespace Slicer { public: using element_type = T; - explicit ModelPartForEnum(T * s); + using ModelPartModel<T>::ModelPartModel; const Metadata & GetMetadata() const override; @@ -247,7 +247,7 @@ namespace Slicer { public: using element_type = T; - explicit ModelPartForSequence(T * s); + using ModelPartModel<T>::ModelPartModel; void OnEachChild(const ChildHandler & ch) override; @@ -291,7 +291,7 @@ namespace Slicer { public: using element_type = T; - explicit ModelPartForDictionary(T * d); + using ModelPartModel<T>::ModelPartModel; void OnEachChild(const ChildHandler & ch) override; @@ -329,7 +329,7 @@ namespace Slicer { template<typename T> class DLL_PUBLIC ModelPartForStream : public ModelPartForStreamBase, ModelPartModel<Stream<T>> { public: - explicit ModelPartForStream(Stream<T> * s); + using ModelPartModel<Stream<T>>::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<typename T> ModelPartForSimple<T>::ModelPartForSimple(T * h) : ModelPartModel<T>(h) { } - template<typename T> void ModelPartForSimple<T>::SetValue(ValueSource && s) @@ -187,18 +185,6 @@ namespace Slicer { return true; } - // ModelPartForConverted - template<typename T, typename M, T M::*MV> - ModelPartForConverted<T, M, MV>::ModelPartForConverted(T * h) : ModelPartModel<T>(h) - { - } - - template<typename T, typename M, Ice::optional<T> M::*MV> - ModelPartForConverted<Ice::optional<T>, M, MV>::ModelPartForConverted(Ice::optional<T> * h) : - ModelPartModel<Ice::optional<T>>(h) - { - } - template<typename T, typename M, Ice::optional<T> M::*MV> bool ModelPartForConverted<Ice::optional<T>, M, MV>::HasValue() const @@ -397,8 +383,6 @@ namespace Slicer { }; // ModelPartForClass - template<typename T> ModelPartForClass<T>::ModelPartForClass(element_type * h) : ModelPartModel<element_type>(h) { } - template<typename T> void ModelPartForClass<T>::Create() @@ -493,8 +477,6 @@ namespace Slicer { } // ModelPartForStruct - template<typename T> ModelPartForStruct<T>::ModelPartForStruct(T * o) : ModelPartModel<T>(o) { } - template<typename T> T * ModelPartForStruct<T>::GetModel() @@ -510,8 +492,6 @@ namespace Slicer { } // ModelPartForEnum - template<typename T> ModelPartForEnum<T>::ModelPartForEnum(T * s) : ModelPartModel<T>(s) { } - template<typename T> const Metadata & ModelPartForEnum<T>::GetMetadata() const @@ -565,8 +545,6 @@ namespace Slicer { } // ModelPartForSequence - template<typename T> ModelPartForSequence<T>::ModelPartForSequence(T * s) : ModelPartModel<T>(s) { } - template<typename T> void ModelPartForSequence<T>::OnEachChild(const ChildHandler & ch) @@ -622,8 +600,6 @@ namespace Slicer { } // ModelPartForDictionary - template<typename T> ModelPartForDictionary<T>::ModelPartForDictionary(T * d) : ModelPartModel<T>(d) { } - template<typename T> void ModelPartForDictionary<T>::OnEachChild(const ChildHandler & ch) @@ -668,8 +644,6 @@ namespace Slicer { } // ModelPartForStream - template<typename T> ModelPartForStream<T>::ModelPartForStream(Stream<T> * s) : ModelPartModel<Stream<T>>(s) { } - template<typename T> ModelPartPtr ModelPartForStream<T>::GetContainedModelPart() |