// -*- C++ -*- #ifndef __range_base_h__ #define __range_base_h__ #include #include #include "base_def.h" namespace MultiArrayTools { enum class RangeType { NIL = 0, SPACE = 1, MOMENTUM = 2, LORENTZ = 3, SPIN = 4 }; class MultiRangeType { public: DEFAULT_MEMBERS(MultiRangeType); MultiRangeType& operator=(RangeType& type); MultiRangeType& operator=(const std::vector& multiType); MultiRangeType& operator[](size_t num); const MultiRangeType& operator[](size_t num) const; bool multi() const; bool operator==(const MultiRangeType& in) const; bool operator!=(const MultiRangeType& in) const; private: void setType(RangeType type); void setMultiType(const std::vector& multiType); RangeType mType; std::vector* mMultiType; }; template class RangeBase { public: typedef Index IndexType; virtual size_t size() const = 0; virtual Index begin() = 0; virtual Index end() = 0; virtual RangeBase* base() = 0; virtual bool isSubRange() const; protected: DEFAULT_MEMBERS(RangeBase); }; template auto cross(const Range& r1, const Range& r2) -> /**/; template auto cross(const Range1& r1, const Range2& r2) -> /**/; template class SubRangeBase : public RangeBase { public: virtual bool isSubRange() const override; protected: DEFAULT_MEMBERS(SubRangeBase); RangeBase* mBase; std::vector mOccupation; }; } #include "range_base.cc" #endif