#include <proptable.h>
Public Member Functions | |
uint32 | added () const |
bool | append (const String *key, const Item &itm, reflectionFunc func_from, reflectionFunc func_to=0) |
bool | append (const String *key, const Item &itm, t_reflection mode, uint32 offset, bool bReadOnly=false) |
bool | append (const String *key, const Item &itm, bool bReadOnly=false) |
PropEntry & | append (const String *name) |
void | appendSafe (const String *key, const Item &itm, reflectionFunc func_from, reflectionFunc func_to=0) |
void | appendSafe (const String *key, const Item &itm, t_reflection mode, uint32 offset, bool bReadOnly=false) |
void | appendSafe (const String *key, const Item &itm, bool bReadOnly=false) |
PropEntry & | appendSafe (const String *key) |
void | checkProperties () |
Analyzes the table and sets its properties. | |
bool | findKey (const String &key, uint32 &pos) const |
const PropEntry & | getEntry (uint32 pos) const |
PropEntry & | getEntry (uint32 pos) |
const String * | getKey (uint32 pos) const |
const Item * | getValue (uint32 pos) const |
Item * | getValue (uint32 pos) |
const Item * | getValue (const String &key) const |
bool | isReflective () const |
bool | isStatic () const |
PropertyTable (const PropertyTable &) | |
PropertyTable (uint32 size) | |
uint32 | size () const |
~PropertyTable () | |
Public Attributes | |
uint32 | m_added |
bool | m_bReflective |
bool | m_bStatic |
PropEntry * | m_entries |
uint32 | m_size |
Property tables are a convenient way to store efficiently and search at the fastest possible speed a set of pre-defined pure Falcon strings stored in a safe memory area that does not need procetion, collecting or reference counting.
Unluckily, this is a quite rare situation. Luckily, this is exactly the situation of Falcon objects (and classes), whose property names are allocated as Falcon Strings in the same Module that declares them.
The property table stores also informations about the class that declared the property. In fact, in case of inheritance, the property may come from an inner class, that needs to be managed through a different handler.
The needed information is the ID of the class in the inheritance list, which is used to pick the correct user_data in the object instance, and the user_data handler (ObjectHandler).
Actually, the ObjectHandler information would not be needed, but it is kept here for caching. There is only one property table per class in each program, so it's an affordable cost.
Once created, the m_value field of each entry is read-only. It stores enumeration and constant initialization values for properties and method/class entries for methods/class accessors.
A property table has two characteristics that are accounted at its creation:
Falcon::PropertyTable::PropertyTable | ( | uint32 | size | ) |
Falcon::PropertyTable::PropertyTable | ( | const PropertyTable & | ) |
Falcon::PropertyTable::~PropertyTable | ( | ) |
uint32 Falcon::PropertyTable::added | ( | ) | const [inline] |
bool Falcon::PropertyTable::append | ( | const String * | key, | |
const Item & | itm, | |||
reflectionFunc | func_from, | |||
reflectionFunc | func_to = 0 | |||
) | [inline] |
bool Falcon::PropertyTable::append | ( | const String * | key, | |
const Item & | itm, | |||
t_reflection | mode, | |||
uint32 | offset, | |||
bool | bReadOnly = false | |||
) | [inline] |
void Falcon::PropertyTable::appendSafe | ( | const String * | key, | |
const Item & | itm, | |||
reflectionFunc | func_from, | |||
reflectionFunc | func_to = 0 | |||
) | [inline] |
References Falcon::e_reflectFunc.
void Falcon::PropertyTable::appendSafe | ( | const String * | key, | |
const Item & | itm, | |||
t_reflection | mode, | |||
uint32 | offset, | |||
bool | bReadOnly = false | |||
) | [inline] |
void Falcon::PropertyTable::appendSafe | ( | const String * | key, | |
const Item & | itm, | |||
bool | bReadOnly = false | |||
) | [inline] |
References Falcon::e_reflectNone, and Falcon::PropEntry::m_name.
void Falcon::PropertyTable::checkProperties | ( | ) |
Analyzes the table and sets its properties.
Referenced by Falcon::CoreCarrier< _T >::hasProperty().
bool Falcon::PropertyTable::isReflective | ( | ) | const [inline] |
bool Falcon::PropertyTable::isStatic | ( | ) | const [inline] |
uint32 Falcon::PropertyTable::size | ( | ) | const [inline] |