7 #ifndef __data_RecordAV_h__ 8 #define __data_RecordAV_h__ 46 FE_UWORD idr(
void)
const;
49 bool isValid(
void)
const;
55 T &accessAttribute(FE_UWORD aLocator)
const;
57 void *rawAttribute(FE_UWORD aLocator)
const;
64 FE_UWORD arrayIndex(
void)
const {
return m_arrayIndex; }
71 FE_UWORD m_arrayIndex;
74 const FE_DL_PUBLIC FE_UWORD ms_invalidIndex = (FE_UWORD)(-1);
78 { FE_UWORD operator()(
const RecordAV r_rec)
const 79 {
return r_rec.
idr() % 17191; } };
83 return (lhs.
idr() < rhs.
idr());
86 class RecordAVInfo :
public BaseType::Info
89 virtual String print(
void *instance);
90 virtual IWORD output(std::ostream &ostrm,
void *instance, t_serialMode mode);
91 virtual void input(std::istream &istrm,
void *instance, t_serialMode mode);
92 virtual IWORD iosize(
void);
93 virtual bool getConstruct(
void);
94 virtual void construct(
void *instance);
95 virtual void destruct(
void *instance);
98 inline RecordAV::RecordAV(I32)
100 m_arrayIndex = ms_invalidIndex;
104 inline RecordAV::RecordAV(
const RecordAV &other)
107 m_arrayIndex = other.m_arrayIndex;
111 inline RecordAV::~RecordAV(
void)
122 m_arrayIndex = other.m_arrayIndex;
128 inline bool RecordAV::operator==(
const RecordAV &other)
const 130 if (m_spLayout != other.
m_spLayout) {
return false; }
131 return (m_arrayIndex == other.m_arrayIndex);
134 inline bool RecordAV::operator!=(
const RecordAV &other)
const 136 if (m_spLayout != other.
m_spLayout) {
return true; }
137 return (m_arrayIndex != other.m_arrayIndex);
140 inline void RecordAV::set(FE_UWORD aArrayIndex,
sp<LayoutAV> a_spLayout)
143 m_arrayIndex = aArrayIndex;
144 m_spLayout = a_spLayout;
150 return m_spLayout->idr(m_arrayIndex);
154 inline T &RecordAV::accessAttribute(FE_UWORD aLocator)
const 157 return *(T *)(m_spLayout
158 ->m_attributeVector[m_spLayout->m_locatorTable[aLocator]]
159 ->raw_at(m_arrayIndex));
161 return *(T *)(m_spLayout->voidAccess(aLocator, m_arrayIndex));
164 inline void *RecordAV::rawAttribute(FE_UWORD aLocator)
const 167 return (
void *)(m_spLayout
168 ->m_attributeVector[m_spLayout->m_locatorTable[aLocator]]
169 ->raw_at(m_arrayIndex));
171 return (m_spLayout->voidAccess(aLocator, m_arrayIndex));
179 inline void RecordAV::release(
void)
181 if(m_arrayIndex != ms_invalidIndex)
183 m_spLayout->releaseArrayIndex(m_arrayIndex);
187 inline void RecordAV::acquire(
void)
189 if(m_arrayIndex != ms_invalidIndex)
191 m_spLayout->acquireArrayIndex(m_arrayIndex);
197 return (m_arrayIndex != ms_invalidIndex);
Homogeneous collection of Records.
Definition: RecordArrayAV.h:32
FE_UWORD idr(void) const
Return a unique runtime id (id-runtime, idr, since 'rid' has other meaning.
Definition: RecordAV.h:148
sp< Layout > layout(void) const
Return the Layout.
Definition: RecordAV.h:174
Smart pointer used with types represented by BaseType.
Definition: Instance.h:28
kernel
Definition: namespace.dox:3
BWORD operator!=(const DualString &s1, const DualString &s2)
Compare two DualString's (reverse logic)
Definition: DualString.h:229
BWORD operator==(const DualString &s1, const DualString &s2)
Compare two DualString's.
Definition: DualString.h:208
sp< LayoutAV > m_spLayout
WARNING: this constructor avoids reference counting.
Definition: RecordAV.h:70
Automatically reference-counted string container.
Definition: String.h:128
Reference to an instance of a Layout.
Definition: RecordAV.h:25
bool isValid(void) const
Return true if the Record points to a valid state block.
Definition: RecordAV.h:195
Record "type" definition.
Definition: LayoutAV.h:30
Non-persistent reference to an instance of a Layout.
Definition: WeakRecordAV.h:17