2022-09-17 22:08:01 +02:00
|
|
|
|
|
|
|
#ifndef __cxz_aindex_h__
|
|
|
|
#define __cxz_aindex_h__
|
|
|
|
|
|
|
|
#include "ranges/range_base.h"
|
|
|
|
#include "ranges/index_base.h"
|
|
|
|
#include "ranges/xindex.h"
|
|
|
|
#include "ranges/yrange.h"
|
|
|
|
|
|
|
|
namespace CNORXZ
|
|
|
|
{
|
|
|
|
|
2022-11-22 19:11:41 +01:00
|
|
|
// AIndex (A = Array)
|
2022-09-17 22:08:01 +02:00
|
|
|
template <typename T>
|
2022-11-22 19:11:41 +01:00
|
|
|
class AIndex : public YIndex
|
2022-09-17 22:08:01 +02:00
|
|
|
{
|
|
|
|
public:
|
2022-11-22 19:11:41 +01:00
|
|
|
typedef YIndex::IB IB;
|
|
|
|
using YIndex::operator=;
|
2022-09-17 22:08:01 +02:00
|
|
|
|
|
|
|
DEFAULT_MEMBERS(AIndex);
|
2022-11-22 19:11:41 +01:00
|
|
|
AIndex(const T* data, const RangePtr& range, SizeT lexpos = 0);
|
|
|
|
AIndex(const T* data, const YIndex& yindex);
|
2022-09-17 22:08:01 +02:00
|
|
|
|
|
|
|
AIndex operator+(Int n) const;
|
|
|
|
AIndex operator-(Int n) const;
|
2022-11-22 19:11:41 +01:00
|
|
|
|
2022-09-17 22:08:01 +02:00
|
|
|
const T& operator*() const;
|
|
|
|
const T* operator->() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
const T* mCData = nullptr;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
// BIndex (because B comes after A...)
|
|
|
|
template <typename T>
|
|
|
|
class BIndex : public AIndex<T>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef AIndex<T> AI;
|
|
|
|
typedef typename AI::IB IB;
|
|
|
|
|
|
|
|
DEFAULT_MEMBERS(BIndex);
|
|
|
|
BIndex(T* data, const RangePtr& range, SizeT pos = 0);
|
2022-11-22 19:11:41 +01:00
|
|
|
BIndex(T* data, const AIndex<T>& cci);
|
2022-09-17 22:08:01 +02:00
|
|
|
|
|
|
|
BIndex operator+(Int n) const;
|
|
|
|
BIndex operator-(Int n) const;
|
|
|
|
|
|
|
|
T& operator*();
|
|
|
|
T* operator->();
|
|
|
|
|
|
|
|
private:
|
|
|
|
T* mData = nullptr;
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|