CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
aindex.cc.h
Go to the documentation of this file.
1// -*- C++ -*-
12#ifndef __cxz_aindex_cc_h__
13#define __cxz_aindex_cc_h__
14
15#include "aindex.h"
16
17namespace CNORXZ
18{
19
20 template <typename T>
21 AIndex<T>::AIndex(const T* data, const RangePtr& range, SizeT lexpos) :
22 YIndex(range, lexpos),
23 mCData(data)
24 {}
25
26 template <typename T>
27 AIndex<T>::AIndex(const T* data, const YIndex& yindex) :
29 mCData(data)
30 {}
31
32 template <typename T>
33 AIndex<T>::AIndex(const T* data, const AIndex<T>& aindex) :
34 AIndex<T>(aindex)
35 {
36 mCData = data;
37 }
38
39 template <typename T>
41 {
42 AIndex<T> o = *this;
43 o += n;
44 return o;
45 }
46
47 template <typename T>
49 {
50 AIndex<T> o = *this;
51 o -= n;
52 return o;
53 }
54
55 template <typename T>
56 const T& AIndex<T>::operator*() const
57 {
58 return mCData[IB::mPos];
59 }
60
61 template <typename T>
62 const T* AIndex<T>::operator->() const
63 {
64 return mCData + IB::mPos;
65 }
66
67 template <typename T>
68 BIndex<T>::BIndex(T* data, const RangePtr& range, SizeT lexpos) :
69 AIndex<T>(data, range, lexpos),
70 mData(data)
71 {}
72
73 template <typename T>
74 BIndex<T>::BIndex(T* data, const AIndex<T>& ai) :
75 AIndex<T>(data, ai),
76 mData(data)
77 {}
78
79 template <typename T>
81 {
82 BIndex<T> o = *this;
83 o += n;
84 return o;
85 }
86
87 template <typename T>
89 {
90 BIndex<T> o = *this;
91 o -= n;
92 return o;
93 }
94
95 template <typename T>
97 {
98 return mData[IB::mPos];
99 }
100
101 template <typename T>
103 {
104 return mData + IB::mPos;
105 }
106
107}
108
109#endif
Array index declaration.
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
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
BIndex(T *data, const RangePtr &range, SizeT pos=0)
Definition aindex.cc.h:68
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