Free Electron
|
Collection of accessors for a Record. More...
#include <Relay.h>
Public Types | |
enum | { e_totalSize =BASE::e_size+SIZE } |
Public Member Functions | |
WeakRecord | bind (WeakRecord record) |
Bind all accessors to a given record. More... | |
virtual void | bind (sp< Scope > spScope) |
BWORD | check (U32 index) const |
Check if the bound Record supports the attribute. More... | |
template<typename T > | |
BWORD | checkType (U32 index) const |
Verify that the attribute is the given type. More... | |
template<typename T > | |
T & | access (U32 index) const |
Return a reference to the entry without checking. More... | |
template<typename T > | |
T | safeGet (U32 index) const |
Return the value of an entry, if supported. More... | |
template<typename T > | |
T | get (U32 index) const |
Return the value of an entry, bypassing checks. More... | |
template<typename T > | |
void | safeSet (U32 index, T value) |
Set the value of an entry, if supported. More... | |
template<typename T > | |
void | set (U32 index, T value) |
Set the value of an entry, bypassing checks. More... | |
String | print (U32 index) const |
Returns a string representation of the entry's state. More... | |
void | dump (void) const |
Logs all entries with state. More... | |
virtual Record | createRecord (void) |
Create a new Record. More... | |
virtual Record | createRecordAndBind (void) |
(convenience) Create and bind a new Record More... | |
sp< Scope > | scope (void) |
Returns the currently bound scope. More... | |
sp< Layout > | layout (void) |
Returns a Layout with the attributes of this relay. More... | |
WeakRecord & | record (void) |
Returns the currently bound record. More... | |
void | initializeRecursively (Record &rRecord) |
Static Public Member Functions | |
static void | populate (sp< Layout > &rspLayout) |
Populate the given Layout with this Relay's attributes. More... | |
static const char * | typeAt (U32 index) |
Returns the attribute's type. More... | |
static const char * | nameAt (U32 index) |
Returns the attribute's name. More... | |
Protected Member Functions | |
void | createAndSetComponent (U32 index, String componentName) |
Construct and insert a Component into the given slot. More... | |
void | createAndSetRecordGroup (U32 index) |
Construct and insert a RecordGroup Component into the given slot. More... | |
Private Member Functions | |
void | prepare (void) |
sp< Layout > | createLayout (void) |
Create or extend a layout. More... | |
virtual void | initialize (void) |
Private Attributes | |
WeakRecord | m_record |
Accessor< I32 > | m_pAccessorArray [e_totalSize] |
hp< Scope > | m_hpScope |
hp< Layout > | m_hpLayout |
Collection of accessors for a Record.
A Relay is somewhat like a C++ class with only virtual data members.
A Relay can inherit attributes from one other Relay through the optional BASE template parameter. Any number of Relays can be chained together in this manner.
Usage is usually done by deriving from Relay into a simple subclass:
Because of the anonymous namespace, this can be defined as such in a shared header.
The enumeration is purely for the convenience of users of your relay. The enumeration's entries should be aligned with the rows in the attribute array.
|
inline |
Return a reference to the entry without checking.
|
inline |
|
inline |
Check if the bound Record supports the attribute.
|
inline |
Verify that the attribute is the given type.
|
inlineprotected |
Construct and insert a Component into the given slot.
The componentName is passed to Registry::create().
|
inlineprotected |
Construct and insert a RecordGroup Component into the given slot.
|
inlineprivate |
Create or extend a layout.
The layout is populated by attributes of this relay.
|
inlinevirtual |
Create a new Record.
In addition to creating the record in the scope, this calls any Relay-based initialization.
Implements fe::ext::CoreRelay.
|
inlinevirtual |
(convenience) Create and bind a new Record
Implements fe::ext::CoreRelay.
|
inline |
Logs all entries with state.
|
inline |
Return the value of an entry, bypassing checks.
Since there is no function argument that uses the typename, you have to supply the template argument explicitly.
|
inline |
Returns a Layout with the attributes of this relay.
|
inlinestatic |
Returns the attribute's name.
|
inlinestatic |
Populate the given Layout with this Relay's attributes.
|
inline |
Returns a string representation of the entry's state.
References fe::Accessor< T >::queryAttribute().
|
inline |
Returns the currently bound record.
|
inline |
Return the value of an entry, if supported.
Since there is no function argument that uses the typename, you have to supply the template argument explicitly.
|
inline |
Set the value of an entry, if supported.
|
inline |
Returns the currently bound scope.
|
inline |
Set the value of an entry, bypassing checks.
|
inlinestatic |
Returns the attribute's type.