MADNESS
version 0.9
|
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 |
Deferred cleanup of shared_ptr's.
Holds dynamically allocated pointers until it is ready for cleanup.
DeferredDeleter
with a std::shared_ptr
. typedef std::shared_ptr<void> madness::detail::DeferredCleanup::void_ptr |
input pointer type
|
inline |
Construct a deferred deleter object.
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.
obj | Object that is ready for destruction |
Referenced by madness::DeferredDeleter< ptrT, deleterT >::operator()().
void madness::detail::DeferredCleanup::destroy | ( | bool | mode | ) |
Set the destruction mode.
mode | true 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.
References madness::RecursiveMutex::lock(), and madness::RecursiveMutex::unlock().
void madness::detail::DeferredCleanup::do_cleanup | ( | ) |
Deletes/frees any pointers that are in the list.
References madness::RecursiveMutex::lock(), and madness::RecursiveMutex::unlock().
Referenced by madness::WorldGopInterface::fence(), and madness::WorldGopInterface::~WorldGopInterface().
|
friend |