From 1d882d55c405eaed2c2c71fb5bdd0fec7217258f Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Fri, 28 May 2021 19:48:27 +0200 Subject: [PATCH] ContainerRange typedef: remove template arg T + remove MultiRange Factory constructor for ContainerRange --- src/include/functional_multi_array.h | 2 +- src/include/multi_array.h | 2 +- src/include/multi_array_base.cc.h | 8 ++++---- src/include/multi_array_base.h | 4 ++-- src/include/multi_array_operation.h | 8 ++++---- src/include/ranges/container_range.h | 2 +- src/include/ranges/multi_range.h | 8 +++++--- src/include/ranges/rbase_def.h | 11 ++--------- src/include/slice.h | 4 ++-- src/tests/ranges/anonymous_unit_test.cc | 2 +- src/tests/ranges/index_unit_test.cc | 2 +- 11 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/include/functional_multi_array.h b/src/include/functional_multi_array.h index 14509fd..b2a8251 100644 --- a/src/include/functional_multi_array.h +++ b/src/include/functional_multi_array.h @@ -79,7 +79,7 @@ namespace MultiArrayTools { public: - typedef ContainerRange CRange; + typedef ContainerRange CRange; typedef MultiArrayBase MAB; typedef ConstContainerIndex IndexType; typedef MultiArray MAType; diff --git a/src/include/multi_array.h b/src/include/multi_array.h index 0481924..4fba5e9 100644 --- a/src/include/multi_array.h +++ b/src/include/multi_array.h @@ -30,7 +30,7 @@ namespace MultiArrayTools { public: - typedef ContainerRange CRange; + typedef ContainerRange CRange; typedef MultiArrayBase MAB; typedef ConstContainerIndex IndexType; diff --git a/src/include/multi_array_base.cc.h b/src/include/multi_array_base.cc.h index 3a8c4a6..80b4273 100644 --- a/src/include/multi_array_base.cc.h +++ b/src/include/multi_array_base.cc.h @@ -54,16 +54,16 @@ namespace MultiArrayTools template MultiArrayBase::MultiArrayBase(const std::shared_ptr&... ranges) { - ContainerRangeFactory crf(ranges...); - mRange = std::dynamic_pointer_cast >( crf.create() ); + ContainerRangeFactory crf(ranges...); + mRange = std::dynamic_pointer_cast >( crf.create() ); mProtoI = std::make_shared( mRange, reinterpret_cast(this) ); } template MultiArrayBase::MultiArrayBase(const typename CRange::Space& space) { - ContainerRangeFactory crf(space); - mRange = std::dynamic_pointer_cast >( crf.create() ); + ContainerRangeFactory crf(space); + mRange = std::dynamic_pointer_cast >( crf.create() ); mProtoI = std::make_shared( mRange, reinterpret_cast(this) ); } diff --git a/src/include/multi_array_base.h b/src/include/multi_array_base.h index 075d069..2e27abe 100644 --- a/src/include/multi_array_base.h +++ b/src/include/multi_array_base.h @@ -56,7 +56,7 @@ namespace MultiArrayTools public: typedef T value_type; - typedef ContainerRange CRange; + typedef ContainerRange CRange; typedef ConstContainerIndex IndexType; protected: @@ -125,7 +125,7 @@ namespace MultiArrayTools { public: - typedef ContainerRange CRange; + typedef ContainerRange CRange; typedef MultiArrayBase MAB; typedef ConstContainerIndex IndexType; diff --git a/src/include/multi_array_operation.h b/src/include/multi_array_operation.h index 01e3d48..f3e32b2 100644 --- a/src/include/multi_array_operation.h +++ b/src/include/multi_array_operation.h @@ -410,7 +410,7 @@ namespace MultiArrayTools typedef T value_type; typedef OperationBase > OT; - typedef ContainerRange CRange; + typedef ContainerRange CRange; typedef ConstContainerIndex IndexType; static constexpr size_t SIZE = 1; @@ -534,7 +534,7 @@ namespace MultiArrayTools typedef T value_type; typedef OperationBase > OT; - typedef ContainerRange CRange; + typedef ContainerRange CRange; typedef ConstContainerIndex IndexType; static constexpr size_t SIZE = 1; @@ -629,7 +629,7 @@ namespace MultiArrayTools typedef T value_type; typedef OperationBase > OT; - typedef ContainerRange CRange; + typedef ContainerRange CRange; typedef ConstContainerIndex IndexType; static constexpr size_t SIZE = 1; @@ -714,7 +714,7 @@ namespace MultiArrayTools public: typedef T value_type; typedef OperationBase > OT; - typedef ContainerRange CRange; + typedef ContainerRange CRange; typedef ConstContainerIndex IndexType; static constexpr size_t SIZE = 0; diff --git a/src/include/ranges/container_range.h b/src/include/ranges/container_range.h index c7f521b..3a81a4b 100644 --- a/src/include/ranges/container_range.h +++ b/src/include/ranges/container_range.h @@ -24,7 +24,7 @@ namespace MultiArrayTools std::tuple > IB; typedef std::tuple MetaType; typedef std::tuple...> IndexPack; - typedef ContainerRange RangeType; + typedef ContainerRange RangeType; static constexpr IndexType sType() { return IndexType::CONT; } static constexpr size_t sDim() { return sizeof...(Indices); } diff --git a/src/include/ranges/multi_range.h b/src/include/ranges/multi_range.h index 929b924..c9d81af 100644 --- a/src/include/ranges/multi_range.h +++ b/src/include/ranges/multi_range.h @@ -140,8 +140,8 @@ namespace MultiArrayTools MultiRangeFactory(const std::shared_ptr&... rs); MultiRangeFactory(const typename MultiRange::Space& space); - template - MultiRangeFactory(const std::shared_ptr >& cr); + //template + //MultiRangeFactory(const std::shared_ptr >& cr); virtual std::shared_ptr create() override; @@ -504,12 +504,14 @@ namespace MultiArrayTools mProd = std::shared_ptr< MultiRange >( new MultiRange( st ) ); } + /* template template - MultiRangeFactory::MultiRangeFactory(const std::shared_ptr >& cr) + MultiRangeFactory::MultiRangeFactory(const std::shared_ptr >& cr) { mProd = std::shared_ptr< MultiRange >( new MultiRange( cr->space() ) ); } + */ template std::shared_ptr MultiRangeFactory::create() diff --git a/src/include/ranges/rbase_def.h b/src/include/ranges/rbase_def.h index e94bc59..a30891c 100644 --- a/src/include/ranges/rbase_def.h +++ b/src/include/ranges/rbase_def.h @@ -81,15 +81,11 @@ namespace MultiArrayTools class MultiIndex; // container_range.h - //template - //class ContainerRangeFactory; - template + template using ContainerRangeFactory = MultiRangeFactory; // container_range.h - //template - //class ContainerRange; - template + template using ContainerRange = MultiRange; // container_range.h @@ -99,9 +95,6 @@ namespace MultiArrayTools // anonymous_range.h class AnonymousRangeFactory; - // anonymous_range.h - //class AnonymousRange; - // dynamic_range.h class IndexWrapperBase; diff --git a/src/include/slice.h b/src/include/slice.h index dc28d70..70c1af3 100644 --- a/src/include/slice.h +++ b/src/include/slice.h @@ -12,7 +12,7 @@ namespace MultiArrayTools { public: - typedef ContainerRange CRange; + typedef ContainerRange CRange; typedef MultiArrayBase MAB; typedef ConstContainerIndex IType; @@ -55,7 +55,7 @@ namespace MultiArrayTools { public: - typedef ContainerRange CRange; + typedef ContainerRange CRange; typedef MultiArrayBase MAB; typedef ConstContainerIndex IType; diff --git a/src/tests/ranges/anonymous_unit_test.cc b/src/tests/ranges/anonymous_unit_test.cc index b8b91ef..c2e6815 100644 --- a/src/tests/ranges/anonymous_unit_test.cc +++ b/src/tests/ranges/anonymous_unit_test.cc @@ -50,7 +50,7 @@ namespace { typedef MultiRangeFactory MasterRF; typedef MasterRF::oType MasterRange; - typedef ContainerRangeFactory CRF; + typedef ContainerRangeFactory CRF; typedef CRF::oType CRange; typedef ConstContainerIndex CIndex; diff --git a/src/tests/ranges/index_unit_test.cc b/src/tests/ranges/index_unit_test.cc index f4e6004..f9d81b5 100644 --- a/src/tests/ranges/index_unit_test.cc +++ b/src/tests/ranges/index_unit_test.cc @@ -88,7 +88,7 @@ namespace { typedef MultiRangeFactory MasterRF; typedef MasterRF::oType MasterRange; - typedef ContainerRangeFactory CRF; + typedef ContainerRangeFactory CRF; typedef CRF::oType CRange; typedef ConstContainerIndex CIndex;