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

Homogeneous collection of Records. More...

#include <RecordArrayAV.h>

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

Public Member Functions

 RecordArrayAV (sp< LayoutAV > spLayout)
 
 RecordArrayAV (sp< LayoutAV > spLayout, FE_UWORD aCount)
 
 RecordArrayAV (const RecordArrayAV &other)
 
RecordArrayAVoperator= (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)
 
void enableDuplicates (bool a_bool)
 
bool addCreate (void)
 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...
 
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< RecordGroupm_hpRecordGroup
 
sp< LayoutAVm_spLayout
 
Array< FE_UWORD > m_pArrayIndex
 
Array< IWORD > m_pSN
 
BWORD m_weak
 
FE_UWORD m_serialLocator
 
bool m_duplicates
 
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)
 

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::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.

◆ addCovert() [1/2]

bool fe::RecordArrayAV::addCovert ( const RecordAV record,
IWORD *  index = NULL 
)

Add records without triggering watchers.

◆ addCovert() [2/2]

bool fe::RecordArrayAV::addCovert ( sp< RecordArrayAV spRA,
IWORD  start,
IWORD  size 
)

Add records without triggering watchers.

◆ addCreate()

bool fe::RecordArrayAV::addCreate ( void  )

create and add a record of an already set Layout.

This avoids the overhead of checking for duplicates.

◆ arrayindex()

FE_UWORD fe::RecordArrayAV::arrayindex ( IWORD  index) const
inlineprivate

Return the arrayindex at the given index.

◆ bind()

void fe::RecordArrayAV::bind ( sp< RecordGroup a_spRecordGroup)
inline

◆ clear()

void fe::RecordArrayAV::clear ( void  )

Clear the record array.

◆ find()

bool fe::RecordArrayAV::find ( const RecordAV record)

Return true if record is in the record array.

Otherwise return false.

Referenced by fe::RecordArraySB::add().

◆ getRecord()

RecordAV fe::RecordArrayAV::getRecord ( IWORD  index)
inline

Return the record at the given index.

◆ getWeakRecord()

WeakRecordAV fe::RecordArrayAV::getWeakRecord ( IWORD  index)
inline

Return a non-persistent record for the given index.

◆ isWeak()

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

Return TRUE if using weak referencing.

◆ layout()

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

Return the Layout.

◆ length()

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

Return the length of the array.

◆ prune()

void fe::RecordArrayAV::prune ( void  )

Remove any invalid weak references.

◆ rawLayout()

Layout* fe::RecordArrayAV::rawLayout ( void  ) const

Return a raw pointer to the Layout.

Mainly intended for Accessor for speed.

◆ remove() [1/2]

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.

◆ remove() [2/2]

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.

◆ removeCovert() [1/2]

bool fe::RecordArrayAV::removeCovert ( const RecordAV record,
IWORD *  index = NULL 
)

Remove records without triggering watchers.

◆ removeCovert() [2/2]

void fe::RecordArrayAV::removeCovert ( IWORD  index)

Add records without triggering watchers.

◆ setWeak()

void fe::RecordArrayAV::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: