#include <reflectobject.h>
Public Member Functions | |
virtual CoreObject * | clone () const |
Creates a shallow copy of this item. | |
virtual bool | getProperty (const String &key, Item &ret) const |
Returns the a shallow item copy of required property. | |
ReflectObject (const ReflectObject &other) | |
ReflectObject (const CoreClass *generator, Sequence *seq) | |
ReflectObject (const CoreClass *generator, FalconData *fdata) | |
ReflectObject (const CoreClass *generator, void *userData) | |
virtual bool | setProperty (const String &prop, const Item &value) |
Sets a property in the object. | |
virtual | ~ReflectObject () |
Falcon::ReflectObject::ReflectObject | ( | const CoreClass * | generator, | |
void * | userData | |||
) |
Falcon::ReflectObject::ReflectObject | ( | const CoreClass * | generator, | |
FalconData * | fdata | |||
) |
Falcon::ReflectObject::ReflectObject | ( | const ReflectObject & | other | ) |
virtual Falcon::ReflectObject::~ReflectObject | ( | ) | [virtual] |
virtual CoreObject* Falcon::ReflectObject::clone | ( | ) | const [virtual] |
Creates a shallow copy of this item.
Will return zero if this item has a non-cloneable user-defined data, that is, it's not fully manageable by the language.
Clone operation requests the class ObjectManager to clone the user_data stored in this object, if any. In turn, the ObjectManager may ask the user_data, properly cast, to clone itself. If one of this operation fails or is not possible, then the method returns 0. The VM will eventually raise a CloneError to signal that the operation tried to clone a non manageable user-data object.
If this object has not a user_data, then the cloneing will automatically succeed.
Implements Falcon::CoreObject.
virtual bool Falcon::ReflectObject::getProperty | ( | const String & | prop, | |
Item & | value | |||
) | const [virtual] |
Returns the a shallow item copy of required property.
The copy is shallow; strings, arrays and complex data inside the original property are shared.
prop | the property to be found | |
value | an item containing the object proerty copy. |
Implements Falcon::CoreObject.
virtual bool Falcon::ReflectObject::setProperty | ( | const String & | prop, | |
const Item & | value | |||
) | [virtual] |
Sets a property in the object.
If the property is found, the value in the item is copied, otherwise the object is untouched and false is returned.
In case of reflected objects, it may be impossible to set the property. In that case, the owning vm gets an error, and false is returned.
prop | The property to be set. | |
value | The item to be set in the property. |
Implements Falcon::CoreObject.