34 virtual void Reset() = 0;
35 virtual bool Next(T &t) = 0;
47 Line(T b, T e, T s) :beg(b), end(e), step(s), cur(b) {}
48 virtual void Reset() { cur = beg; }
51 if ((cur-end>0) == (step>0))
66 Ary(T *p_p,
int p_len) :p(p_p), len(p_len), cur(0) {}
67 virtual void Reset() { cur = 0; }
89 vIter(T *pbuf,
int dim) : m_pBuf(pbuf), m_nDim(dim), m_nCur(0) {}
93 for (
int i = 0; i < m_nDim; i++) {
102 for (
int i = 0; i < m_nDim; i++) {
103 m_aObj[i]->Next(m_pBuf[i]);
108 for (i = 0; i < m_nDim; i++) {
109 if (m_aObj[i]->
Next(m_pBuf[i]))
112 m_aObj[i]->Next(m_pBuf[i]);
125 for (
int i = 0; i < m_nDim; i++)
133 for (
int i = 0; i < m_nDim; i++)
void AddLine(T beg, T end, T step=1)
Array< iter::Obj< T > * > m_aObj
the iter of each dimension
void AddAllLine(T beg, T end, T step=1)
void Add(T t)
Add a value to the tail of array.
virtual bool Next(T &t)=0
void AddAllAry(T *p, int n)
int len
the length of the array
#define SAFE_DEL_POINTER_ARRAY(a)
define all the code written by Bin Wang.
Defination of simple dynamic array/stack/queue and so on.