#include <cacheobject.h>
Public Member Functions | |
Item * | cachedProperty (const String &name) const |
Item * | cachedPropertyAt (uint32 pos) const |
virtual bool | deserialize (Stream *stream, bool bLive) |
Deserializes the object from a stream. | |
virtual void | gcMark (uint32 mark) |
Mark the items in the cache and the inner data, if it's garbageable. | |
virtual bool | getProperty (const String &key, Item &ret) const |
Returns the a shallow item copy of required property. | |
virtual void | reflectFrom (void *user_data) |
Reflect an external data into this object. | |
virtual void | reflectTo (void *user_data) const |
Reflect this object into external data. | |
virtual bool | serialize (Stream *stream, bool bLive) const |
Serializes this instance on a stream. | |
virtual bool | setProperty (const String &prop, const Item &value) |
Sets a property in the object. | |
virtual | ~CacheObject () |
Protected Member Functions | |
CacheObject (const CacheObject &other) | |
CacheObject (const CoreClass *generator, bool bSeralizing=false) | |
Protected Attributes | |
Item * | m_cache |
Falcon::CacheObject::CacheObject | ( | const CoreClass * | generator, | |
bool | bSeralizing = false | |||
) | [protected] |
Falcon::CacheObject::CacheObject | ( | const CacheObject & | other | ) | [protected] |
virtual Falcon::CacheObject::~CacheObject | ( | ) | [virtual] |
virtual bool Falcon::CacheObject::deserialize | ( | Stream * | stream, | |
bool | bLive | |||
) | [virtual] |
Deserializes the object from a stream.
The object should be created shortly before this call, giving instruction to the constructor not to perform a full initialization, as the content of the object will be soon overwritten.
Will throw in case of error.
IOError | in case of stream error. |
stream | The stream from which to read the object. | |
bLive | If true, |
Reimplemented from Falcon::CoreObject.
virtual void Falcon::CacheObject::gcMark | ( | uint32 | mark | ) | [virtual] |
Mark the items in the cache and the inner data, if it's garbageable.
If this object contains an external FalconData instance, it gets marked; anyhow, this function marks the cache items.
Reimplemented from Falcon::CoreObject.
Reimplemented in Falcon::core::ErrorObject.
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.
Reimplemented in Falcon::CRObject.
virtual void Falcon::CacheObject::reflectFrom | ( | void * | user_data | ) | [virtual] |
Reflect an external data into this object.
This method uses the reflection informations in the generator class property table to load the data stored in the user_data parameter into the local item vector cache.
As this is an optional operation, the base class implementation does nothing.
virtual void Falcon::CacheObject::reflectTo | ( | void * | user_data | ) | const [virtual] |
Reflect this object into external data.
This method uses the reflection informations in the generator class property table to store a C/C++ copy of the data stored in the local cache of this object into an external data.
As this is an optional operation, the base class implementation does nothing.
virtual bool Falcon::CacheObject::serialize | ( | Stream * | stream, | |
bool | bLive | |||
) | const [virtual] |
Serializes this instance on a stream.
IOError | in case of stream error. |
Reimplemented from Falcon::CoreObject.
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.
Reimplemented in Falcon::CRObject.
Item* Falcon::CacheObject::m_cache [mutable, protected] |