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

A proxy for DisplayObject pointers. More...

#include <CharacterProxy.h>

Public Member Functions

 CharacterProxy (DisplayObject *sp, movie_root &mr)
 Construct a CharacterProxy pointing to the given sprite. More...
 
 CharacterProxy (const CharacterProxy &sp)
 Construct a copy of the given CharacterProxy. More...
 
CharacterProxyoperator= (const CharacterProxy &sp)
 Make this proxy a copy of the given one. More...
 
DisplayObjectget (bool skipRebinding=false) const
 Get the pointed sprite, either original or rebound. More...
 
std::string getTarget () const
 bound one. More...
 
bool isDangling () const
 Return true if this sprite is dangling. More...
 
bool operator== (const CharacterProxy &sp) const
 Two sprite_proxies are equal if they point to the same sprite. More...
 
void setReachable () const
 Set the original sprite (if any) as reachable. More...
 

Detailed Description

A proxy for DisplayObject pointers.

The proxy will store a pointer to a DisplayObject until the DisplayObject is destroyed, in which case it will only store the original target path of it and always use that for rebinding when needed.

Constructor & Destructor Documentation

§ CharacterProxy() [1/2]

gnash::CharacterProxy::CharacterProxy ( DisplayObject sp,
movie_root mr 
)
inline

Construct a CharacterProxy pointing to the given sprite.

§ CharacterProxy() [2/2]

gnash::CharacterProxy::CharacterProxy ( const CharacterProxy sp)
inline

Construct a copy of the given CharacterProxy.

Parameters
spThe CharacterProxy to make a copy of. NOTE: if the given proxy is dangling, this proxy will also be dangling. If you want to create a non-dangling proxy you can use the constructor taking a DisplayObject as in CharacterProxy newProxy(oldProxy.get())

Member Function Documentation

§ get()

DisplayObject* gnash::CharacterProxy::get ( bool  skipRebinding = false) const
inline

Get the pointed sprite, either original or rebound.

Returns
the currently bound sprite, NULL if none

References gnash::findDisplayObjectByTarget(), and getTarget().

Referenced by gnash::operator<<(), operator==(), gnash::as_value::setReachable(), and gnash::as_value::to_string().

§ getTarget()

std::string gnash::CharacterProxy::getTarget ( ) const

bound one.

Get the sprite target, either current (if not dangling) or

References gnash::DisplayObject::getTarget().

Referenced by get(), gnash::operator<<(), and gnash::as_value::to_string().

§ isDangling()

bool gnash::CharacterProxy::isDangling ( ) const
inline

Return true if this sprite is dangling.

Dangling means that it doesn't have a pointer to the original sprite anymore, not that it doesn't point to anything. To know if it points to something or not use get(), which will return NULL if it doesn't point to anyhing.

Referenced by gnash::operator<<().

§ operator=()

CharacterProxy& gnash::CharacterProxy::operator= ( const CharacterProxy sp)
inline

Make this proxy a copy of the given one.

Parameters
spThe CharacterProxy to make a copy of. NOTE: if the given proxy is dangling, this proxy will also be dangling. If you want to create a non-dangling proxy you can use the constructor taking a DisplayObject as in CharacterProxy newProxy(oldProxy.get())

§ operator==()

bool gnash::CharacterProxy::operator== ( const CharacterProxy sp) const
inline

Two sprite_proxies are equal if they point to the same sprite.

References DSOEXPORT, get(), and setReachable().

§ setReachable()

void gnash::CharacterProxy::setReachable ( ) const

Set the original sprite (if any) as reachable.

NOTE: if this value is dangling, we won't keep anything alive.

References gnash::GcResource::setReachable().

Referenced by operator==(), and gnash::as_value::setReachable().


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