Gnash  0.8.11dev
Public Member Functions | List of all members
gnash::Property Class Reference

An abstract property. More...

#include <Property.h>

Public Member Functions

 Property (ObjectURI uri, const as_value &value, PropFlags flags)
 
 Property (ObjectURI uri, as_function *getter, as_function *setter, PropFlags flags, bool destroy=false)
 
 Property (ObjectURI uri, as_c_function_ptr getter, as_c_function_ptr setter, PropFlags flags, bool destroy=false)
 
const PropFlagsgetFlags () const
 accessor to the properties flags More...
 
void setFlags (const PropFlags &flags) const
 Set the flags of the property. More...
 
DSOTEXPORT as_value getValue (const as_object &this_ptr) const
 Get value of this property. More...
 
as_value getCache () const
 Get internal cached value of this property. More...
 
void setCache (const as_value &v)
 Set internal cached value of this property. More...
 
bool setValue (as_object &this_ptr, const as_value &value) const
 Set value of this property. More...
 
bool isGetterSetter () const
 Is this a getter/setter property? More...
 
void clearVisible (int swfVersion)
 Clear visibility flags. More...
 
const ObjectURIuri () const
 The name-namespace pair (ObjectURI) of this Property. More...
 
void setReachable () const
 Mark this property as being reachable (for the GC) More...
 

Detailed Description

An abstract property.

A Property is a holder for a value or a getter-setter. Properties have special const semantics: the value of a Property does not affect its outward state, so the value of a const Property can be changed.

Constructor & Destructor Documentation

§ Property() [1/3]

gnash::Property::Property ( ObjectURI  uri,
const as_value value,
PropFlags  flags 
)
inline

§ Property() [2/3]

gnash::Property::Property ( ObjectURI  uri,
as_function getter,
as_function setter,
PropFlags  flags,
bool  destroy = false 
)
inline

§ Property() [3/3]

gnash::Property::Property ( ObjectURI  uri,
as_c_function_ptr  getter,
as_c_function_ptr  setter,
PropFlags  flags,
bool  destroy = false 
)
inline

Member Function Documentation

§ clearVisible()

void gnash::Property::clearVisible ( int  swfVersion)
inline

Clear visibility flags.

Referenced by gnash::as_object::set_prototype().

§ getCache()

as_value gnash::Property::getCache ( ) const

Get internal cached value of this property.

For simple properties, this is the usual value; for user-defined getter-setter this is a cached value to watch for infinitely recurse on calling the getter or setter; Native getter-setter has no cache, undefined will be returned for them.

Referenced by gnash::as_object::add_property(), gnash::as_object::get_member(), and gnash::as_object::set_prototype().

§ getFlags()

const PropFlags& gnash::Property::getFlags ( ) const
inline

§ getValue()

as_value gnash::Property::getValue ( const as_object this_ptr) const

Get value of this property.

Parameters
this_ptrThe as_object used to set the 'this' pointer. for calling getter function (GetterSetterProperty); it will be unused when getting or setting SimpleProperty properties.
Returns
the value of this property

References gnash::key::a, gnash::GetterSetter::get(), and gnash::getVM().

Referenced by gnash::MovieClip::constructAsScriptObject(), gnash::constructInstance(), gnash::abc::Machine::execute(), gnash::as_object::get_member(), gnash::as_object::get_prototype(), gnash::getOwnProperty(), gnash::abc::Machine::pushGet(), and gnash::sendEvent().

§ isGetterSetter()

bool gnash::Property::isGetterSetter ( ) const
inline

§ setCache()

void gnash::Property::setCache ( const as_value v)

Set internal cached value of this property.

For simple properties, this is the usual value; for user-defined getter-setter this is a cached value to watch for infinitely recurse on calling the getter or setter; Native getter-setter has no cache, nothing would happen for them.

References gnash::key::_1.

Referenced by gnash::as_object::add_property(), and gnash::PropertyList::addGetterSetter().

§ setFlags()

void gnash::Property::setFlags ( const PropFlags flags) const
inline

§ setReachable()

void gnash::Property::setReachable ( ) const
inline

Mark this property as being reachable (for the GC)

Referenced by gnash::PropertyList::setReachable().

§ setValue()

bool gnash::Property::setValue ( as_object this_ptr,
const as_value value 
) const

Set value of this property.

Parameters
this_ptrThe as_object used to set the 'this' pointer for calling getter/setter function It will be unused when getting or setting simple properties. This parameter is non-const as nothing prevents an eventual "Setter" function from actually modifying it, so we can't promise constness.
valueThe new value for this property. It will be used as first argument of the 'setter' function if this is a Getter/Setter property.
See also
isGetterSetter().
Returns
true if the property was set, otherwise false. Read-only properties can generally not be set, but destructive properties are still allowed to be replaced, as this should be invisible to the user.

References gnash::key::a, gnash::getVM(), gnash::readOnly(), gnash::GetterSetter::set(), and gnash::GetterSetter::setCache().

Referenced by gnash::parsePath(), gnash::abc::Machine::pushSet(), gnash::as_object::set_prototype(), gnash::setLocal(), and gnash::PropertyList::setValue().

§ uri()

const ObjectURI& gnash::Property::uri ( ) const
inline

The documentation for this class was generated from the following files: