Free Electron
|
Homogeneous collection of Records. More...
#include <RecordArrayAV.h>
Public Member Functions | |
RecordArrayAV (sp< LayoutAV > spLayout) | |
RecordArrayAV (sp< LayoutAV > spLayout, FE_UWORD aCount) | |
RecordArrayAV (const RecordArrayAV &other) | |
RecordArrayAV & | operator= (const RecordArrayAV &other) |
FE_UWORD | idr (IWORD index) |
IWORD | length (void) |
Return the length of the array. More... | |
sp< Layout > | layout (void) |
Return the Layout. More... | |
Layout * | rawLayout (void) const |
Return a raw pointer to the Layout. More... | |
bool | add (const RecordAV &record, IWORD *index=NULL) |
Add the given record to the array. More... | |
bool | add (sp< RecordArrayAV > spRA, IWORD start, IWORD size) |
bool | addCovert (const RecordAV &record, IWORD *index=NULL) |
bool | addCovert (sp< RecordArrayAV > spRA, IWORD start, IWORD size) |
bool | addCreateCovert (U32 a_count) |
create and add a record of an already set Layout. More... | |
bool | remove (const RecordAV &record, IWORD *index=NULL) |
Remove the given record from the array. More... | |
void | remove (IWORD index) |
Remove record at given index. More... | |
bool | removeCovert (const RecordAV &record, IWORD *index=NULL) |
void | removeCovert (IWORD index) |
void | bind (sp< RecordGroup > a_spRecordGroup) |
RecordAV | getRecord (IWORD index) |
Return the record at the given index. More... | |
WeakRecordAV | getWeakRecord (IWORD index) |
Return a non-persistent record for the given index. More... | |
void | clear (void) |
Clear the record array. More... | |
bool | find (const RecordAV &record) |
Return true if record is in the record array. More... | |
void | set (WeakRecordAV &record, IWORD index) |
void | set (RecordAV &record, IWORD index) |
void | setLayout (const sp< LayoutAV > &rspLayout) |
void | prune (void) |
Remove any invalid weak references. More... | |
void | setWeak (BWORD weak) |
Choose weak referencing. More... | |
BWORD | isWeak (void) const |
Return TRUE if using weak referencing. More... | |
void | enableDuplicates (bool a_bool) |
Don't retain a mappping from Record to array index. More... | |
void | maintainOrder (bool a_bool) |
Don't reorder entries during removal. More... | |
template<class T > | |
T & | accessAttribute (FE_UWORD aLocator, FE_UWORD aIndex) const |
Public Member Functions inherited from fe::Counted | |
virtual void | acquire (void) |
Increment the reference count. More... | |
virtual void | acquire (int &rCount) |
Increment the reference count (and get the count) More... | |
virtual void | release (void) |
Decrement the reference count. More... | |
virtual void | abandon (void) |
Decrement the reference count. More... | |
int | count (void) const |
Return the count of references. More... | |
void | setName (const String &) |
void | trackReference (void *pReference, String what) |
void | untrackReference (void *pReference) |
void | registerRegion (void *pT, U32 bytes) |
Private Member Functions | |
FE_UWORD | arrayindex (IWORD index) const |
Return the arrayindex at the given index. More... | |
template<class T > | |
T & | accessAttributeUnsafe (FE_UWORD aLocator, FE_UWORD aIndex) const |
void | grow (void) |
void | copy (const RecordArrayAV &other) |
I32 | readSerialNumber (IWORD index) const |
void | trackBlock (U32 index) |
void | untrackBlock (U32 index) |
void | acquireAV (IWORD index) |
void | releaseAV (IWORD index) |
Private Attributes | |
hp< RecordGroup > | m_hpRecordGroup |
sp< LayoutAV > | m_spLayout |
Array< FE_UWORD > | m_pArrayIndex |
Array< IWORD > | m_pSN |
BWORD | m_weak |
FE_UWORD | m_serialLocator |
bool | m_duplicates |
bool | m_maintainOrder |
t_av_map | m_av_map |
Additional Inherited Members | |
Static Public Member Functions inherited from fe::Counted | |
static String | reportTracker (void) |
static U32 | trackerCount (void) |
Protected Member Functions inherited from fe::Counted | |
int | releaseInternal (void) |
Decrement the reference count. More... | |
void | suppressReport (void) |
Homogeneous collection of Records.
An array of Records, or more precisely an array of state block pointers all pointing to state blocks of the same layout. Therefore only a single reference to the layout itself is stored. Therefore this record array object consumes less memory than an array of record objects.
bool fe::RecordArrayAV::add | ( | const RecordAV & | record, |
IWORD * | index = NULL |
||
) |
Add the given record to the array.
If the record array already has records and the Layout is different than for record the record will not be added and false will be returned. On success true is returned and if index is not NULL the index of the added record is return in index.
bool fe::RecordArrayAV::addCovert | ( | const RecordAV & | record, |
IWORD * | index = NULL |
||
) |
Add records without triggering watchers.
bool fe::RecordArrayAV::addCovert | ( | sp< RecordArrayAV > | spRA, |
IWORD | start, | ||
IWORD | size | ||
) |
Add records without triggering watchers.
bool fe::RecordArrayAV::addCreateCovert | ( | U32 | a_count | ) |
create and add a record of an already set Layout.
This avoids the overhead of checking for duplicates.
|
inlineprivate |
Return the arrayindex at the given index.
|
inline |
void fe::RecordArrayAV::clear | ( | void | ) |
Clear the record array.
void fe::RecordArrayAV::enableDuplicates | ( | bool | a_bool | ) |
Don't retain a mappping from Record to array index.
RecordArray::remove will be faster, while RecordArray::find will be slower.
This should only be set by RecordGroup at construction.
bool fe::RecordArrayAV::find | ( | const RecordAV & | record | ) |
Return true if record is in the record array.
Otherwise return false.
Referenced by fe::RecordArraySB::add().
|
inline |
Return the record at the given index.
|
inline |
Return a non-persistent record for the given index.
|
inline |
Return TRUE if using weak referencing.
|
inline |
Return the Layout.
|
inline |
Return the length of the array.
|
inline |
Don't reorder entries during removal.
RecordArray::remove can be slower, particularly if enableDuplicates is false.
This should only be set by RecordGroup at construction.
void fe::RecordArrayAV::prune | ( | void | ) |
Remove any invalid weak references.
Layout* fe::RecordArrayAV::rawLayout | ( | void | ) | const |
Return a raw pointer to the Layout.
Mainly intended for Accessor for speed.
bool fe::RecordArrayAV::remove | ( | const RecordAV & | record, |
IWORD * | index = NULL |
||
) |
Remove the given record from the array.
On success return true and if index is provided return the index of the removed record. If the record is not in the array return false.
void fe::RecordArrayAV::remove | ( | IWORD | index | ) |
Remove record at given index.
The array is kept contiguous by moving the last element into the the given index after removal. Therefore, in an iteration that involves deletion it is best to iterate backwards through the array.
bool fe::RecordArrayAV::removeCovert | ( | const RecordAV & | record, |
IWORD * | index = NULL |
||
) |
Remove records without triggering watchers.
void fe::RecordArrayAV::removeCovert | ( | IWORD | index | ) |
Remove records without triggering watchers.
|
inline |
Choose weak referencing.
This should only be set by RecordGroup at construction.