7 #ifndef __datatool_RecordArrayView_h__ 8 #define __datatool_RecordArrayView_h__ 47 #if FE_CPLUSPLUS >= 201103L 49 m_spRecordArray(a_iterator.m_spRecordArray),
50 m_index(a_iterator.m_index)
52 a_iterator.m_recordView.scope()); }
56 m_spRecordArray(NULL),
60 m_spRecordArray(a_spRecordArray),
64 a_spRecordArray->layout()->scope());
65 m_recordView.bind(spScope);
68 Iterator& operator=(
const Iterator& other)
const 69 { m_spRecordArray=other.m_spRecordArray;
70 m_index=other.m_index;
72 m_spRecordArray->layout()->scope()); }
75 {
return m_spRecordArray==other.m_spRecordArray &&
76 m_index==other.m_index; }
79 {
return m_spRecordArray!=other.m_spRecordArray ||
80 m_index!=other.m_index; }
83 { m_recordView.setWeakRecord(
84 m_spRecordArray->getWeakRecord(m_index));
85 return m_recordView; }
87 const Iterator& operator++(
void)
89 #if FE_CODEGEN<=FE_DEBUG 90 if(m_index>=m_spRecordArray->length())
92 feX(
"RecordArrayView::Iterator::operator++" 93 "incrementing past end");
100 const Iterator operator++(
int)
102 #if FE_CODEGEN<=FE_DEBUG 103 if(m_index>=m_spRecordArray->length())
105 feX(
"RecordArrayView::Iterator::operator++(int)" 106 "incrementing past end");
109 return Iterator(m_spRecordArray,m_index++);
112 const Iterator& operator--(
void)
114 #if FE_CODEGEN<=FE_DEBUG 117 feX(
"RecordArrayView::Iterator::operator--" 118 "decrementing ahead of begin");
125 const Iterator operator--(
int)
127 #if FE_CODEGEN<=FE_DEBUG 130 feX(
"RecordArrayView::Iterator::operator--(int)" 131 "decrementing ahead of begin");
134 return Iterator(m_spRecordArray,m_index--);
137 I32 index(
void)
const {
return m_index; }
156 m_spRecordArray=rspRecordArray;
158 m_spRecordArray->layout()->scope();
165 return m_spRecordArray.isValid() &&
166 m_spRecordArray->length()>0;
176 { m_recordView.bind(rspScope); }
180 {
return m_recordView.scope(); }
184 {
return Iterator(m_spRecordArray,0); }
188 {
return Iterator(m_spRecordArray,
189 m_spRecordArray->length()); }
201 FEASSERT(m_spRecordArray.isValid());
202 FEASSERT(a_index<m_spRecordArray->length());
203 m_recordView.setWeakRecord(
204 m_spRecordArray->getWeakRecord(a_index));
219 if(m_spRecordArray.isValid() &&
220 a_index<m_spRecordArray->length())
223 m_spRecordArray->getWeakRecord(a_index));
227 m_recordView.unbind();
void bind(sp< Scope > &rspScope)
Associate with a specific Scope.
Definition: RecordArrayView.h:175
T & recordView(void)
Return the contained RecordView.
Definition: RecordArrayView.h:245
T & at(U32 a_index)
Return a RecordView potentially bound to a Record.
Definition: RecordArrayView.h:217
kernel
Definition: namespace.dox:3
sp< Scope > scope(void)
Return the bound Scope.
Definition: RecordArrayView.h:179
Iterator begin(void) const
Return an Iterator pointing at the first index.
Definition: RecordArrayView.h:183
void bind(const sp< RecordArray > &rspRecordArray)
Associate with a specific RecordArray.
Definition: RecordArrayView.h:154
BWORD operator!=(const DualString &s1, const DualString &s2)
Compare two DualString's (reverse logic)
Definition: DualString.h:229
RecordView Iteration over a RecordArray.
Definition: RecordArrayView.h:37
BWORD operator==(const DualString &s1, const DualString &s2)
Compare two DualString's.
Definition: DualString.h:208
BWORD isBound(void) const
Check if bound to a non-zero length RecordArray.
Definition: RecordArrayView.h:163
Iterator end(void) const
Return an invalid Iterator indicating no more.
Definition: RecordArrayView.h:187
Base for all interfacable components.
Definition: Component.h:20
void setWeakRecord(const WeakRecord weakRecord)
Associate with a specific WeakRecord.
Definition: RecordView.h:427
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
T & operator[](U32 a_index)
Return a RecordView bound to a Record.
Definition: RecordArrayView.h:199
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192