CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
aindex.h
Go to the documentation of this file.
1// -*- C++ -*-
12#ifndef __cxz_aindex_h__
13#define __cxz_aindex_h__
14
15#include "ranges/range_base.h"
16#include "ranges/index_base.h"
17#include "ranges/xindex.h"
18#include "ranges/yrange.h"
19
20namespace CNORXZ
21{
22
23 // AIndex (A = Array)
24 template <typename T>
25 class AIndex : public YIndex
26 {
27 public:
28 typedef YIndex::IB IB;
29 using YIndex::operator=;
30
32 AIndex(const T* data, const RangePtr& range, SizeT lexpos = 0);
33 AIndex(const T* data, const YIndex& yindex);
34 AIndex(const T* data, const AIndex<T>& aindex);
35
36 AIndex operator+(Int n) const;
37 AIndex operator-(Int n) const;
38
39 const T& operator*() const;
40 const T* operator->() const;
41
42 protected:
43 const T* mCData = nullptr;
44
45 };
46
47 // BIndex (because B comes after A...)
48 template <typename T>
49 class BIndex : public AIndex<T>
50 {
51 public:
52 typedef AIndex<T> AI;
53 typedef typename AI::IB IB;
54
56 BIndex(T* data, const RangePtr& range, SizeT pos = 0);
57 BIndex(T* data, const AIndex<T>& cci);
58
59 BIndex operator+(Int n) const;
60 BIndex operator-(Int n) const;
61
62 T& operator*();
63 T* operator->();
64
65 private:
66 T* mData = nullptr;
67
68 };
69}
70
71#endif
DEFAULT_MEMBERS(AIndex)
const T * mCData
Definition aindex.h:43
const T * operator->() const
Definition aindex.cc.h:62
AIndex operator-(Int n) const
Definition aindex.cc.h:48
const T & operator*() const
Definition aindex.cc.h:56
AIndex operator+(Int n) const
Definition aindex.cc.h:40
AIndex(const T *data, const RangePtr &range, SizeT lexpos=0)
Definition aindex.cc.h:21
YIndex::IB IB
Definition aindex.h:28
AIndex< T > AI
Definition aindex.h:52
T & operator*()
Definition aindex.cc.h:96
BIndex operator-(Int n) const
Definition aindex.cc.h:88
BIndex operator+(Int n) const
Definition aindex.cc.h:80
DEFAULT_MEMBERS(BIndex)
BIndex(T *data, const RangePtr &range, SizeT pos=0)
Definition aindex.cc.h:68
AI::IB IB
Definition aindex.h:53
Sptr< YRange > range() const
Definition yrange.cc:310
Index base declaration.
uint64_t SizeT
Definition types.h:38
Sptr< RangeBase > RangePtr
Definition types.h:157
int32_t Int
Definition types.h:36
YIndex yindex(const DPack &pack)
Definition yrange.cc:524
RangeBase declaration.
XIndexBase and XIndex template declaration.
YRange and YIndex declaration.