Public Member Functions

gnash::Property Class Reference

An abstract property. More...

#include <Property.h>

Collaboration diagram for gnash::Property:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

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

gnash::Property::Property ( const ObjectURI uri  )  [inline]

Default constructor.

gnash::Property::Property ( const ObjectURI uri,
const as_value value,
const PropFlags flags = PropFlags() 
) [inline]
gnash::Property::Property ( const ObjectURI uri,
as_function getter,
as_function setter,
const PropFlags flags,
bool  destroy = false 
) [inline]
gnash::Property::Property ( const ObjectURI uri,
as_function getter,
as_function setter,
bool  destroy = false 
) [inline]
gnash::Property::Property ( const ObjectURI uri,
as_c_function_ptr  getter,
as_c_function_ptr  setter,
const PropFlags flags,
bool  destroy = false 
) [inline]
gnash::Property::Property ( const Property p  )  [inline]

Copy constructor.


Member Function Documentation

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

Clear visibility flags.

References gnash::PropFlags::clear_visible().

const 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.

const PropFlags& gnash::Property::getFlags (  )  const [inline]
as_value gnash::Property::getValue ( const as_object this_ptr  )  const

Get value of this property.

Parameters:
this_ptr The 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

Referenced by gnash::abc::Machine::pushSet().

bool gnash::Property::isDestructive (  )  const [inline]

is this a destructive property ?

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

bool gnash::Property::isGetterSetter (  )  const [inline]
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.

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

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

Set the flags of the property.

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

void gnash::Property::setReachable (  )  const

Mark this property as being reachable (for the GC).

References gnash::GetterSetter::markReachableResources().

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

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

Set value of this property.

Parameters:
this_ptr The as_object used to set the 'this' pointer. for calling getter/setter function (GetterSetterProperty); it will be unused when getting or setting SimpleProperty properties. This parameter is non-const as nothing prevents an eventual "Setter" function from actually modifying it, so we can't promise constness.
value The 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().

Referenced by gnash::as_environment::as_environment(), gnash::abc::Machine::pushCall(), and gnash::PropertyList::setValue().

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

The name-namespace pair (ObjectURI) of this Property.


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