From 5e99516fcb5d9013e879c8534d3ea9f65a8bb51d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 22 Jul 2017 01:57:43 +0100 Subject: Move modelPartType implementations from header into impl.h --- slicer/slicer/modelPartsTypes.h | 23 ++++++-------------- slicer/slicer/modelPartsTypes.impl.h | 42 ++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/slicer/slicer/modelPartsTypes.h b/slicer/slicer/modelPartsTypes.h index ca63638..8082e07 100644 --- a/slicer/slicer/modelPartsTypes.h +++ b/slicer/slicer/modelPartsTypes.h @@ -113,25 +113,18 @@ namespace Slicer { public: class DLL_PRIVATE HookBase : public HookCommon { public: - HookBase(const std::string & n) : HookCommon(n) { } + HookBase(const std::string & n); virtual ModelPartPtr Get(T * t) const = 0; - virtual const Metadata & GetMetadata() const override { return emptyMetadata; } + virtual const Metadata & GetMetadata() const override; }; typedef IceUtil::Handle HookPtr; template class DLL_PRIVATE Hook : public HookBase { public: - Hook(MT T::* m, const std::string & n) : - HookBase(n), - member(m) - { - } + Hook(MT T::* m, const std::string & n); - ModelPartPtr Get(T * t) const override - { - return new MP(t ? const_cast::type *>(&(t->*member)) : NULL); - } + ModelPartPtr Get(T * t) const override; private: const MT T::* member; @@ -140,13 +133,9 @@ namespace Slicer { template class DLL_PRIVATE HookMetadata : public Hook { public: - HookMetadata(MT T::* member, const std::string & n, const Metadata & md) : - Hook(member, n), - metadata(md) - { - } + HookMetadata(MT T::* member, const std::string & n, const Metadata & md); - virtual const Metadata & GetMetadata() const override { return metadata; } + virtual const Metadata & GetMetadata() const override; const Metadata metadata; }; diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h index 71ad746..ef69309 100644 --- a/slicer/slicer/modelPartsTypes.impl.h +++ b/slicer/slicer/modelPartsTypes.impl.h @@ -241,6 +241,48 @@ namespace Slicer { return metadata; } + template + ModelPartForComplex::HookBase::HookBase(const std::string & n) : + HookCommon(n) + { + } + + template + const Metadata & ModelPartForComplex::HookBase::GetMetadata() const + { + return emptyMetadata; + } + + template + template + ModelPartForComplex::Hook::Hook(MT T::* m, const std::string & n) : + HookBase(n), + member(m) + { + } + + template + template + ModelPartPtr ModelPartForComplex::Hook::Get(T * t) const + { + return new MP(t ? const_cast::type *>(&(t->*member)) : NULL); + } + + template + template + ModelPartForComplex::HookMetadata::HookMetadata(MT T::* member, const std::string & n, const Metadata & md) : + Hook(member, n), + metadata(md) + { + } + + template + template + const Metadata & ModelPartForComplex::HookMetadata::GetMetadata() const + { + return metadata; + } + // ModelPartForClass template ModelPartForClass::ModelPartForClass(element_type * h) : -- cgit v1.2.3