Free Electron
|
Homogeneous collection of Records. More...
#include <RecordArraySB.h>
Public Member Functions | |
RecordArraySB (sp< LayoutSB > spLayout) | |
RecordArraySB (sp< LayoutSB > spLayout, FE_UWORD aCount) | |
RecordArraySB (const RecordArraySB &other) | |
RecordArraySB & | operator= (const RecordArraySB &other) |
FE_UWORD | idr (IWORD index) |
Return the state block at the given index. More... | |
IWORD | length (void) |
Return the length of the array. More... | |
sp< Layout > | layout (void) |
Return the Layout. More... | |
bool | add (const RecordSB &record, IWORD *index=NULL) |
Return a raw pointer to the Layout. More... | |
bool | add (sp< RecordArraySB > spRA, IWORD start, IWORD size) |
bool | addCovert (const RecordSB &record, IWORD *index=NULL) |
bool | addCovert (sp< RecordArraySB > spRA, IWORD start, IWORD size) |
void | enableDuplicates (bool a_bool) |
bool | addCreate (void) |
create and add a record of an already set Layout. More... | |
bool | remove (const RecordSB &record, IWORD *index=NULL) |
Remove the given record from the array. More... | |
bool | removeCovert (const RecordSB &record, IWORD *index=NULL) |
void | removeCovert (IWORD index) |
void | bind (sp< RecordGroup > a_spRecordGroup) |
RecordSB | getRecord (IWORD index) |
Return the record at the given index. More... | |
WeakRecordSB | getWeakRecord (IWORD index) |
Return a non-persistent record for the given index. More... | |
void | clear (void) |
Clear the record array. More... | |
bool | find (const RecordSB &record) |
Return true if record is in the record array. More... | |
void | set (WeakRecordSB &record, IWORD index) |
void | set (RecordSB &record, IWORD index) |
void | setLayout (const sp< LayoutSB > &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 | remove (IWORD index) |
Remove record at given index. 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 | |
void * | data (IWORD index) const |
Return the state block at the given index. More... | |
void | grow (void) |
void | copy (const RecordArraySB &other) |
void | acquireSB (IWORD index) |
void | releaseSB (IWORD index) |
I32 | readSerialNumber (IWORD index) const |
void | trackBlock (U32 index) |
void | untrackBlock (U32 index) |
Private Attributes | |
sp< LayoutSB > | m_spLayout |
void ** | m_ppSB |
IWORD * | m_pSN |
IWORD | m_allocated |
IWORD | m_used |
BWORD | m_weak |
I32 | m_serialOffset |
bool | m_duplicates |
t_sb_map | m_sb_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::RecordArraySB::add | ( | const RecordSB & | record, |
IWORD * | index = NULL |
||
) |
Return a raw pointer to the Layout.
Mainly intended for Accessor for speed. 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 .
References fe::RecordArrayAV::find().
bool fe::RecordArraySB::addCreate | ( | void | ) |
create and add a record of an already set Layout.
This avoids the overhead of checking for duplicates.
void fe::RecordArraySB::clear | ( | void | ) |
Clear the record array.
|
inlineprivate |
Return the state block at the given index.
bool fe::RecordArraySB::find | ( | const RecordSB & | record | ) |
Return true if record is in the record array.
Otherwise return false.
References fe::RecordSB::data().
|
inline |
Return the record at the given index.
Referenced by fe::ext::SurfaceGroundTireSystem::step().
|
inline |
Return a non-persistent record for the given index.
|
inline |
Return the state block at the given index.
|
inline |
Return TRUE if using weak referencing.
|
inline |
Return the Layout.
|
inline |
Return the length of the array.
Referenced by fe::ext::SurfaceGroundTireSystem::step().
void fe::RecordArraySB::prune | ( | void | ) |
Remove any invalid weak references.
bool fe::RecordArraySB::remove | ( | const RecordSB & | 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.
References fe::RecordSB::data().
void fe::RecordArraySB::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.
|
inline |
Choose weak referencing.
This should only be set by RecordGroup at construction.