Free Electron
Public Member Functions | Private Member Functions | Private Attributes | List of all members
fe::RecordArraySB Class Reference

Homogeneous collection of Records. More...

#include <RecordArraySB.h>

Inheritance diagram for fe::RecordArraySB:
Inheritance graph
[legend]

Public Member Functions

 RecordArraySB (sp< LayoutSB > spLayout)
 
 RecordArraySB (sp< LayoutSB > spLayout, FE_UWORD aCount)
 
 RecordArraySB (const RecordArraySB &other)
 
RecordArraySBoperator= (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< LayoutSBm_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)
 

Detailed Description

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.

Member Function Documentation

◆ add()

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().

◆ addCreate()

bool fe::RecordArraySB::addCreate ( void  )

create and add a record of an already set Layout.

This avoids the overhead of checking for duplicates.

◆ clear()

void fe::RecordArraySB::clear ( void  )

Clear the record array.

◆ data()

void * fe::RecordArraySB::data ( IWORD  index) const
inlineprivate

Return the state block at the given index.

◆ find()

bool fe::RecordArraySB::find ( const RecordSB record)

Return true if record is in the record array.

Otherwise return false.

References fe::RecordSB::data().

◆ getRecord()

RecordSB fe::RecordArraySB::getRecord ( IWORD  index)
inline

Return the record at the given index.

Referenced by fe::ext::SurfaceGroundTireSystem::step().

◆ getWeakRecord()

WeakRecordSB fe::RecordArraySB::getWeakRecord ( IWORD  index)
inline

Return a non-persistent record for the given index.

◆ idr()

FE_UWORD fe::RecordArraySB::idr ( IWORD  index)
inline

Return the state block at the given index.

◆ isWeak()

BWORD fe::RecordArraySB::isWeak ( void  ) const
inline

Return TRUE if using weak referencing.

◆ layout()

sp< Layout > fe::RecordArraySB::layout ( void  )
inline

Return the Layout.

◆ length()

IWORD fe::RecordArraySB::length ( void  )
inline

Return the length of the array.

Referenced by fe::ext::SurfaceGroundTireSystem::step().

◆ prune()

void fe::RecordArraySB::prune ( void  )

Remove any invalid weak references.

◆ remove() [1/2]

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().

◆ remove() [2/2]

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.

◆ setWeak()

void fe::RecordArraySB::setWeak ( BWORD  weak)
inline

Choose weak referencing.

This should only be set by RecordGroup at construction.


The documentation for this class was generated from the following files: