Falcon::GarbageLock Class Reference

Protects an item from garbage collecting. More...

#include <garbagelock.h>

Inheritance diagram for Falcon::GarbageLock:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 GarbageLock (const Item &itm)
 Creates a garbage lock protecting an item.
 GarbageLock ()
 Creates an empty garbage lock.
Itemitem ()
 Return the guarded item.
const Itemitem () const
 Return the guarded item (const version).
 ~GarbageLock ()
 Releases the item that can now be collected.

Friends

class MemPool


Detailed Description

Protects an item from garbage collecting.

This class safely store an item, and all its contents in case it is a sort of container, from being collected. The garbage locked items are marked as soon as they reach the lowest possible value in the live generation count. Extensions are granted to have their gcMark() method called when this happens, so any kind of item can be safely stored as the item() element.

Once destroyed, the garbage lock releases the item, that can then be immediately collected.


Constructor & Destructor Documentation

Falcon::GarbageLock::GarbageLock (  ) 

Creates an empty garbage lock.

The item inside this garbage lock is nil.

Falcon::GarbageLock::GarbageLock ( const Item itm  ) 

Creates a garbage lock protecting an item.

Falcon::GarbageLock::~GarbageLock (  ) 

Releases the item that can now be collected.


Member Function Documentation

Item& Falcon::GarbageLock::item (  )  [inline]

Return the guarded item.

The returned value can be modified. For example, setting it to nil or to another flat value will cause the previously guarded value to be released, and collectible for garbage.

const Item& Falcon::GarbageLock::item (  )  const [inline]

Return the guarded item (const version).


Friends And Related Function Documentation

friend class MemPool [friend]


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

Generated on Mon Oct 19 10:11:35 2009 for Falcon_Core by  doxygen 1.5.8