From 772d9c28283be0fb71c94bcfcdd6b62378c02f93 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Tue, 6 Nov 2018 16:35:37 +0100 Subject: [PATCH] im com --- src/include/ranges/dynamic_range.h | 57 ++++++++++++++++++------------ src/include/ranges/rbase_def.h | 3 ++ 2 files changed, 37 insertions(+), 23 deletions(-) diff --git a/src/include/ranges/dynamic_range.h b/src/include/ranges/dynamic_range.h index c2413b6..6e5b4a2 100644 --- a/src/include/ranges/dynamic_range.h +++ b/src/include/ranges/dynamic_range.h @@ -26,36 +26,26 @@ namespace MultiArrayTools //using MultiArrayHelper::DynamicExpression; //using MultiArrayHelper::ExpressionHolder; - - template - class IndexWrapperBase - { - protected: - std::shared_ptr mEc; - public: - IndexWrapperBase() = default; - IndexWrapperBase(const IndexWrapperBase& in) = default; - IndexWrapperBase(IndexWrapperBase&& in) = default; - IndexWrapperBase& operator=(const IndexWrapperBase& in) = default; - IndexWrapperBase& operator=(IndexWrapperBase&& in) = default; - + class AbstractIW + { + public: + AbstractIW() = default; + AbstractIW(const AbstractIW& in) = default; + AbstractIW(AbstractIW&& in) = default; + AbstractIW& operator=(const AbstractIW& in) = default; + AbstractIW& operator=(AbstractIW&& in) = default; + virtual IndexType type() const = 0; - virtual IndexWrapperBase& operator=(size_t pos) = 0; - virtual IndexWrapperBase& operator++() = 0; - virtual IndexWrapperBase& operator--() = 0; + virtual AbstractIW& operator=(size_t pos) = 0; + virtual AbstractIW& operator++() = 0; + virtual AbstractIW& operator--() = 0; virtual int pp(std::intptr_t idxPtrNum) = 0; virtual int mm(std::intptr_t idxPtrNum) = 0; virtual std::string stringMeta() const = 0; - //virtual DynamicMetaT meta() const = 0; - //virtual const DynamicMetaT* metaPtr() const = 0; - //virtual IndexWrapperBase& at(const U& metaPos) = 0; - //virtual size_t posAt(const U& metaPos) const = 0; - - //virtual bool isMeta(const U& metaPos) const = 0; virtual size_t pos() const = 0; virtual size_t max() const = 0; @@ -70,7 +60,28 @@ namespace MultiArrayTools virtual std::intptr_t get() const = 0; virtual std::intptr_t ptrNum() const = 0; - + + //virtual DynamicMetaT meta() const = 0; + //virtual const DynamicMetaT* metaPtr() const = 0; + //virtual AbstractIW& at(const U& metaPos) = 0; + //virtual size_t posAt(const U& metaPos) const = 0; + + //virtual bool isMeta(const U& metaPos) const = 0; + }; + + template + class IndexWrapperBase : public AbstractIW + { + protected: + std::shared_ptr mEc; + public: + + IndexWrapperBase() = default; + IndexWrapperBase(const IndexWrapperBase& in) = default; + IndexWrapperBase(IndexWrapperBase&& in) = default; + IndexWrapperBase& operator=(const IndexWrapperBase& in) = default; + IndexWrapperBase& operator=(IndexWrapperBase&& in) = default; + template ExpressionHolder ifor(size_t step, ExpressionHolder ex) const; diff --git a/src/include/ranges/rbase_def.h b/src/include/ranges/rbase_def.h index 80c2796..fba3ff9 100644 --- a/src/include/ranges/rbase_def.h +++ b/src/include/ranges/rbase_def.h @@ -89,6 +89,9 @@ namespace MultiArrayTools // anonymous_range.h //class AnonymousRange; + // dynamic_range.h + class AbstractIW; + // dynamic_range.h template class DynamicIndex;