Raul::Maid Class Reference

Explicitly driven garbage collector. More...

#include <Maid.hpp>

List of all members.

Public Member Functions

 Maid (size_t size)
void push (Raul::Deletable *obj)
 Push a raw pointer to be deleted when cleanup() is called next.
void manage (SharedPtr< Raul::Deletable > ptr)
void cleanup ()


Detailed Description

Explicitly driven garbage collector.

This is used by realtime threads to allow hard realtime deletion of objects (push() is realtime safe).

You can also manage a SharedPtr, so cleanup() will delete it when all references are dropped (except the one held by the Maid itself). This allows using a SharedPtr freely in hard realtime threads without having to worry about deletion accidentally occuring in the realtime thread.

cleanup() should be called periodically to free memory, often enough to prevent the queue from overflowing. This is probably best done by the main thread to avoid the overhead of having a thread just to delete things.


Member Function Documentation

void Raul::Maid::push ( Raul::Deletable obj  )  [inline]

Push a raw pointer to be deleted when cleanup() is called next.

Realtime safe.


The documentation for this class was generated from the following file:
Generated on Wed Apr 9 08:14:41 2008 for RAUL by  doxygen 1.5.1