#include <coredict.h>
Public Member Functions | |
void | bless (bool b) |
Bless this dictionary. | |
void | clear () |
CoreDict * | clone () const |
CoreDict (const CoreDict &other) | |
CoreDict (ItemDict *dict) | |
bool | empty () const |
bool | find (const Item &key, Item &value) |
Item * | find (const String &key) const |
Performs a find using a static string as a key. | |
Item * | find (const Item &key) const |
bool | findIterator (const Item &key, Iterator &iter) |
virtual void | gcMark (uint32 gen) |
Applies mark to subclasses. | |
bool | getMethod (const String &name, Item &mth) |
Returns a method out of this dictionary. | |
bool | isBlessed () const |
Returns true if this dictionary is blessed. | |
ItemDict & | items () |
const ItemDict & | items () const |
uint32 | length () const |
void | merge (const CoreDict &dict) |
void | put (const Item &key, const Item &value) |
virtual void | readIndex (const Item &pos, Item &target) |
Implements the deep item interface. | |
virtual void | readProperty (const String &, Item &item) |
Implements the deep item interface. | |
bool | remove (const Item &key) |
void | smartInsert (const Iterator &iter, const Item &key, const Item &value) |
virtual void | writeIndex (const Item &pos, const Item &target) |
Implements the deep item interface. | |
virtual void | writeProperty (const String &, const Item &item) |
Implements the deep item interface. | |
virtual | ~CoreDict () |
Falcon::CoreDict::CoreDict | ( | ItemDict * | dict | ) | [inline] |
Falcon::CoreDict::CoreDict | ( | const CoreDict & | other | ) | [inline] |
virtual Falcon::CoreDict::~CoreDict | ( | ) | [inline, virtual] |
void Falcon::CoreDict::bless | ( | bool | b | ) | [inline] |
Bless this dictionary.
A blessed dictionary becomes a flessible instance.
Its elements are treated as properties; the dot accessor will act as searching for the given property, and a read dot accessor will create a mehtod; in the method, the dictionary can be accessed through "self".
void Falcon::CoreDict::clear | ( | ) | [inline] |
CoreDict* Falcon::CoreDict::clone | ( | ) | const [inline] |
bool Falcon::CoreDict::empty | ( | ) | const [inline] |
Performs a find using a static string as a key.
This wraps the string in a temporary item and calls the normal find(const Item &)
virtual void Falcon::CoreDict::gcMark | ( | uint32 | mk | ) | [virtual] |
Applies mark to subclasses.
By default, this method just changes the mark() value.
Subclasses having deep data may overload this to take care of marking it.
Reimplemented from Falcon::Garbageable.
Returns a method out of this dictionary.
This method returns true if there is a function item stored under the given key, provided that this dictionary is blessed.
name | The name of the method to be searched. | |
mth | An item that will receive a full readied method on success. |
bool Falcon::CoreDict::isBlessed | ( | ) | const [inline] |
Returns true if this dictionary is blessed.
ItemDict& Falcon::CoreDict::items | ( | ) | [inline] |
const ItemDict& Falcon::CoreDict::items | ( | ) | const [inline] |
uint32 Falcon::CoreDict::length | ( | ) | const [inline] |
Implements the deep item interface.
May throw AccessError * if the pos doesn't represents a valid item index for the current type.
Implements Falcon::DeepItem.
Implements the deep item interface.
May throw AccessError * if the property cannot be read.
Implements Falcon::DeepItem.
bool Falcon::CoreDict::remove | ( | const Item & | key | ) | [inline] |
void Falcon::CoreDict::smartInsert | ( | const Iterator & | iter, | |
const Item & | key, | |||
const Item & | value | |||
) | [inline] |
Implements the deep item interface.
May throw AccessError * if the pos doesn't represents a valid item index for the current type or if the target item can't be set into this item at the given index.
Implements Falcon::DeepItem.
Implements the deep item interface.
May throw AccessError * if the property cannot be set.
Implements Falcon::DeepItem.