|typedef std::pair< int, const |
osg::Referenced * >
< FrameNumberObjectPair >
Public Member Functions
|DeleteHandler (int numberOfFramesToRetainObjects=0)|
|void||setNumFramesToRetainObjects (int numberOfFramesToRetainObjects)|
|Set the number of frames to retain objects that are have been requested for deletion. |
|int||getNumFramesToRetainObjects () const|
|void||setFrameNumber (int frameNumber)|
|Set the current frame number so that subsequent deletes get tagged as associated with this frame. |
|int||getFrameNumber () const|
|Get the current frame number. |
|void||doDelete (const Referenced *object)|
|virtual void||flush ()|
|Flush objects that ready to be fully deleted. |
|virtual void||flushAll ()|
|Flush all objects that the DeleteHandler holds. |
|virtual void||requestDelete (const osg::Referenced *object)|
|Request the deletion of an object. |
Protected Member Functions
|DeleteHandler (const DeleteHandler &)|
|DeleteHandler||operator= (const DeleteHandler &)|
This might be done to help implement protection of multiple threads from deleting objects unintentionally. Note, the DeleteHandler cannot itself be reference counted, otherwise it would be responsible for deleting itself! An static auto_ptr<> is used internally in Referenced.cpp to manage the DeleteHandler's memory.
|osg::DeleteHandler::DeleteHandler||(||int|| numberOfFramesToRetainObjects =
|osg::DeleteHandler::DeleteHandler||(||const DeleteHandler &||)||
|void osg::DeleteHandler::doDelete||(||const Referenced *||object||)||
|virtual void osg::DeleteHandler::flush||(||)||
Flush objects that ready to be fully deleted.
|virtual void osg::DeleteHandler::flushAll||(||)||
Flush all objects that the DeleteHandler holds.
Note, this should only be called if there are no threads running with non ref_ptr<> pointers, such as graphics threads.
|int osg::DeleteHandler::getFrameNumber||(||)|| const
Get the current frame number.
|int osg::DeleteHandler::getNumFramesToRetainObjects||(||)|| const
|virtual void osg::DeleteHandler::requestDelete||(||const osg::Referenced *||object||)||
Request the deletion of an object.
Depending on users implementation of DeleteHandler, the delete of the object may occur straight away or be delayed until doDelete is called. The default implementation does a delete straight away.
Set the current frame number so that subsequent deletes get tagged as associated with this frame.
Set the number of frames to retain objects that are have been requested for deletion.
When set to zero objects are deleted immediately, by set to 1 there are kept around for an extra frame etc. The ability to retain objects for several frames is useful to prevent premature deletion when objects are still be used the graphics threads that are using double buffering of rendering data structures with non ref_ptr<> pointers to scene graph elements.
|Generated at Tue Feb 10 20:34:08 2009 for the OpenSceneGraph by doxygen 1.5.8.|