Gnash  0.8.10
Public Member Functions | Protected Member Functions | Friends
gnash::GcResource Class Reference

Collectable resource. More...

#include <GC.h>

Inheritance diagram for gnash::GcResource:
gnash::as_object gnash::DisplayObject gnash::abc::as_class gnash::as_function gnash::Global_as gnash::GtkExt gnash::Bitmap gnash::InteractiveObject gnash::MorphShape gnash::Shape gnash::StaticText gnash::Video

List of all members.

Public Member Functions

 GcResource (GC &gc)
 Create a Garbage-collected resource associated with a GC.
void setReachable () const
 Mark this resource as being reachable.
bool isReachable () const
 Return true if this object is marked as reachable.
void clearReachable () const
 Clear the reachable flag.

Protected Member Functions

virtual void markReachableResources () const
 Scan all GC resources reachable by this instance.
virtual ~GcResource ()
 Delete this resource.

Friends

class GC

Detailed Description

Collectable resource.

Instances of this class can be managed by a GC object.


Constructor & Destructor Documentation

gnash::GcResource::GcResource ( GC gc) [inline]

Create a Garbage-collected resource associated with a GC.

Parameters:
gcThe GC to register the resource with.

References gnash::GC::addCollectable().

virtual gnash::GcResource::~GcResource ( ) [inline, protected, virtual]

Delete this resource.

This is protected to allow subclassing, but ideally it sould be private, so only the GC is allowed to delete us.


Member Function Documentation

void gnash::GcResource::clearReachable ( ) const [inline]

Clear the reachable flag.

bool gnash::GcResource::isReachable ( ) const [inline]

Return true if this object is marked as reachable.

virtual void gnash::GcResource::markReachableResources ( ) const [inline, protected, virtual]

Scan all GC resources reachable by this instance.

This function is invoked everytime this object switches from unreachable to reachable, and is used to recursively mark all contained resources as reachable.

See setReachable(), which is the function to invoke against all reachable methods.

Feel free to assert(_reachable) in your implementation.

The default implementation doesn't mark anything.

Reimplemented in gnash::DisplayObject, gnash::as_object, gnash::Function, and gnash::Global_as.

References assert, _, and gnash::typeName().

Referenced by setReachable().

void gnash::GcResource::setReachable ( ) const [inline]

Friends And Related Function Documentation

friend class GC [friend]

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