MADNESS  version 0.9
Public Types | Public Member Functions | Friends | List of all members
madness::detail::DeferredCleanup Class Reference

Deferred cleanup of shared_ptr's. More...

#include <deferred_cleanup.h>

Public Types

typedef std::shared_ptr< void > void_ptr
 input pointer type More...
 

Public Member Functions

 DeferredCleanup ()
 Construct a deferred deleter object. More...
 
void destroy (bool mode)
 Set the destruction mode. More...
 
bool destroy () const
 Get the current destruction mode mode. More...
 
void add (const void_ptr &obj)
 Adds item to cleanup list. More...
 
void do_cleanup ()
 Deletes/frees any pointers that are in the list. More...
 

Friends

template<typename , typename >
class ::madness::DeferredDeleter
 

Detailed Description

Deferred cleanup of shared_ptr's.

Holds dynamically allocated pointers until it is ready for cleanup.

Note
This object is considered an implementation detail and should not be used directly, instead use DeferredDeleter with a std::shared_ptr.

Member Typedef Documentation

input pointer type

Constructor & Destructor Documentation

madness::detail::DeferredCleanup::DeferredCleanup ( )
inline

Construct a deferred deleter object.

Member Function Documentation

void madness::detail::DeferredCleanup::add ( const void_ptr obj)

Adds item to cleanup list.

If destroy mode is true then the pointer is destroyed immediately. Otherwise it is stored until do_cleanup() is called.

Parameters
objObject that is ready for destruction

Referenced by madness::DeferredDeleter< ptrT, deleterT >::operator()().

void madness::detail::DeferredCleanup::destroy ( bool  mode)

Set the destruction mode.

Parameters
modetrue for immediate destruction, false for deferred destruction.

References madness::RecursiveMutex::lock(), and madness::RecursiveMutex::unlock().

Referenced by madness::WorldGopInterface::~WorldGopInterface().

bool madness::detail::DeferredCleanup::destroy ( ) const

Get the current destruction mode mode.

Returns
true for immediate destruction and false for deferred destruction.

References madness::RecursiveMutex::lock(), and madness::RecursiveMutex::unlock().

void madness::detail::DeferredCleanup::do_cleanup ( )

Friends And Related Function Documentation

template<typename , typename >
friend class ::madness::DeferredDeleter
friend

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