Public Member Functions

gnash::CharacterProxy Class Reference

A proxy for DisplayObject pointers. More...

#include <CharacterProxy.h>

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

List of all members.

Public Member Functions

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

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

gnash::CharacterProxy::CharacterProxy ( DisplayObject sp  )  [inline]

Construct a CharacterProxy pointing to the given sprite.

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

Construct a copy of the given CharacterProxy.

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

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

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

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

bound one.

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

References gnash::DisplayObject::getTarget().

Referenced by gnash::as_value::to_string(), and gnash::as_value::toDebugString().

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::as_value::toDebugString().

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

Make this proxy a copy of the given one.

Parameters:
sp The 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())
bool gnash::CharacterProxy::operator== ( const CharacterProxy sp  )  const [inline]

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

References get().

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 gnash::as_value::setReachable().


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