Free Electron
Public Member Functions | Private Attributes | List of all members
fe::ext::RecordArrayView< T > Class Template Reference

RecordView Iteration over a RecordArray. More...

#include <RecordArrayView.h>

Inheritance diagram for fe::ext::RecordArrayView< T >:
Inheritance graph
[legend]

Public Member Functions

void bind (const sp< RecordArray > &rspRecordArray)
 Associate with a specific RecordArray. More...
 
BWORD isBound (void) const
 Check if bound to a non-zero length RecordArray. More...
 
void bind (sp< Scope > &rspScope)
 Associate with a specific Scope. More...
 
sp< Scopescope (void)
 Return the bound Scope. More...
 
Iterator begin (void) const
 Return an Iterator pointing at the first index. More...
 
Iterator end (void) const
 Return an invalid Iterator indicating no more. More...
 
T & operator[] (U32 a_index)
 Return a RecordView bound to a Record. More...
 
T & at (U32 a_index)
 Return a RecordView potentially bound to a Record. More...
 
T & recordView (void)
 Return the contained RecordView. More...
 
- Public Member Functions inherited from fe::Component
const Stringname (void) const
 Return the components chosen name. More...
 
const String verboseName (void) const
 Return the annotated chosen name. More...
 
void setName (const String &name)
 Rename the component to anything you want. More...
 
hp< Registryregistry (void) const
 Get the Registry that created this component. More...
 
void adjoin (sp< Component > spComponent)
 Tie this component's lifetime to another. More...
 
sp< Componentcreate (const String &implementation, BWORD quiet=FALSE) const
 Convienience function to registry()->create() More...
 
void disjoin (void)
 Untie component from Hub, if connected. More...
 
String factoryName (void)
 
void setLibrary (sp< Library > spLibrary)
 Store a reference to the library used to instantiate this component. More...
 
sp< Librarylibrary (void)
 Get the library that created the component. More...
 
void setFactoryIndex (I32 a_factoryIndex)
 Set the library's factory index. More...
 
I32 factoryIndex (void)
 Get the library's factory index. More...
 
void setSingleton (BWORD set)
 Specify whether component is a singleton. More...
 
BWORD isSingleton (void)
 Return whether component is a singleton. More...
 
virtual void acquire (void)
 Specialized reference increment. More...
 
virtual void release (void)
 Specialized reference decrement. More...
 
- Public Member Functions inherited from fe::Handled< Component >
const hp< Component > & getHandle (void) const
 Get a safe handle to this object. More...
 
- Public Member Functions inherited from fe::Protectable
virtual I32 protection (void) const
 
virtual void protect (void)
 
virtual void unprotect (void)
 
virtual Protectableclone (Protectable *pInstance=NULL)
 
- Public Member Functions inherited from fe::Counted
virtual void acquire (int &rCount)
 Increment the reference count (and get the 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)
 
- Public Member Functions inherited from fe::Initialized
void initializeAll (void)
 
void setActive (bool a_active)
 

Private Attributes

sp< RecordArraym_spRecordArray
 
m_recordView
 

Additional Inherited Members

- Static Public Member Functions inherited from fe::Counted
static String reportTracker (void)
 
static U32 trackerCount (void)
 
- Protected Types inherited from fe::Initialized
typedef void(* InitializeFunction) (Initialized *)
 
- Protected Member Functions inherited from fe::Handled< Component >
void abandonHandle (void)
 
- Protected Member Functions inherited from fe::Counted
int releaseInternal (void)
 Decrement the reference count. More...
 
void suppressReport (void)
 
- Protected Member Functions inherited from fe::Initialized
void addInitializer (InitializeFunction function)
 

Detailed Description

template<typename T>
class fe::ext::RecordArrayView< T >

RecordView Iteration over a RecordArray.

RecordArrayView<MyRecordView> rav;
sp<RecordArray> spRA=spRG->getArray("my_layout");
rav.bind(spRA);
for(MyRecordView& rMyView: rav)
{
feLog("%d\n",rMyView.myI32());
}
The RecordView reference obtained by dereferencing an iterator is reused.
It will simply bind a new Record when stepping the iterator.
A RecordArrayView instance has its own RecordView instance,
for at() and operator[](), which is also reused.

Member Function Documentation

◆ at()

template<typename T>
T& fe::ext::RecordArrayView< T >::at ( U32  a_index)
inline

Return a RecordView potentially bound to a Record.

This Record is obtained from the RecordArray by index. If the index goes beyond the length of the RecordArray, the RecordView is unbound.

Since this RecordView instance can be reused, it should only be used for immediate access.

◆ begin()

template<typename T>
Iterator fe::ext::RecordArrayView< T >::begin ( void  ) const
inline

Return an Iterator pointing at the first index.

◆ bind() [1/2]

template<typename T>
void fe::ext::RecordArrayView< T >::bind ( const sp< RecordArray > &  rspRecordArray)
inline

Associate with a specific RecordArray.

Access a RecordView using an Iterator or the bracket operator. The RecordView will bind to an indexed Record in the RecordArray.

Binding to a RecordArray will also bind to its Scope.

◆ bind() [2/2]

template<typename T>
void fe::ext::RecordArrayView< T >::bind ( sp< Scope > &  rspScope)
inline

Associate with a specific Scope.

This will populate the functors in the local RecordView instance. This can be useful for makign Accessor check() calls before accessing individual records.

◆ end()

template<typename T>
Iterator fe::ext::RecordArrayView< T >::end ( void  ) const
inline

Return an invalid Iterator indicating no more.

◆ isBound()

template<typename T>
BWORD fe::ext::RecordArrayView< T >::isBound ( void  ) const
inline

Check if bound to a non-zero length RecordArray.

◆ operator[]()

template<typename T>
T& fe::ext::RecordArrayView< T >::operator[] ( U32  a_index)
inline

Return a RecordView bound to a Record.

This Record is obtained from the RecordArray by index. No bounds checking is done.

Since this RecordView instance can be reused, it should only be used for immediate access.

◆ recordView()

template<typename T>
T& fe::ext::RecordArrayView< T >::recordView ( void  )
inline

Return the contained RecordView.

This RecordView is the same RecordView returned by at() and the bracket operator.

It is mainly intended to be used for check() calls on its functors. This can be done without being bound to a RecordArray if a Scope has been bound.

Since this RecordView instance can be reused, it should only be used for immediate access.

◆ scope()

template<typename T>
sp<Scope> fe::ext::RecordArrayView< T >::scope ( void  )
inline

Return the bound Scope.


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