#ifndef __cxz_slice_h__ #define __cxz_slice_h__ #include "base/base.h" #include "array_base.h" namespace CNORXZ { template class CSlice : public CArrayBase { public: typedef CArrayBase AB; typedef typename AB::const_iterator const_iterator; protected: const CArrayBase* mCParent = nullptr; Vector mBlockSizes; SizeT mOff = 0; public: DEFAULT_MEMBERS(CSlice); CSlice(const RangePtr& range, const CArrayBase* parent, const Vector& blockSizes, SizeT off); virtual const T* data() const override; virtual const_iterator cbegin() const override; virtual const_iterator cend() const override; virtual bool isView() const override final; }; template class Slice : public virtual ArrayBase, public virtual CSlice { public: typedef CArrayBase AB; typedef typename AB::const_iterator const_iterator; private: ArrayBase* mParent = nullptr; public: DEFAULT_MEMBERS(Slice); Slice(const RangePtr& range, ArrayBase* parent, const Vector& blockSizes, SizeT off); virtual T* data() override; }; } #endif