Ion
|
StaticDeleterDeleter is an internal class that holds and deletes StaticDeleters; it should not be used directly. More...
#include "staticsafedeclare.h"
Public Member Functions | |
StaticDeleterDeleter () | |
~StaticDeleterDeleter () override | |
template<typename T > | |
void | AddPointerToDelete (const std::string &name, T *ptr) |
Adds a regular pointer to be deleted when this class is destroyed. More... | |
template<typename T > | |
void | AddArrayToDelete (const std::string &name, T *ptr) |
Adds an array pointer to be deleted when this class is destroyed. More... | |
template<typename T > | |
void | IgnoreInstance (const std::string &name, const T &ptr) |
Does nothing, but simplifies the above macros for static non-pointer instances. More... | |
const StaticDeleterBase * | GetDeleterAt (size_t index) const |
Returns the deleter at the passed index. More... | |
size_t | GetDeleterCount () const |
Returns the number of deleters in this. More... | |
int | GetRefCount () const |
GetRefCount() is part of the interface necessary for SharedPtr. More... | |
Static Public Member Functions | |
static StaticDeleterDeleter * | GetInstance () |
Returns a pointer to the global instance. More... | |
static void | DestroyInstance () |
Call this function once, and only once, at the end of a program, to explicitly destroy all StaticDeleters (including the StaticDeleterDeleter instance). More... | |
StaticDeleterDeleter is an internal class that holds and deletes StaticDeleters; it should not be used directly.
Though it is an internal class, it must be decorated since it is required by StaticDeleters that may be instantiated in other translation units. The single StaticDeleterDeleter is destroyed at program shutdown, and destroys all StaticDeleters in the reverse order they were created with the above macros.
Definition at line 192 of file staticsafedeclare.h.
ion::base::StaticDeleterDeleter::StaticDeleterDeleter | ( | ) |
Definition at line 25 of file staticsafedeclare.cc.
References ion::base::GetDefaultLogEntryWriter().
|
override |
Definition at line 33 of file staticsafedeclare.cc.
|
inline |
Adds an array pointer to be deleted when this class is destroyed.
Definition at line 205 of file staticsafedeclare.h.
References mutex_.
|
inline |
Adds a regular pointer to be deleted when this class is destroyed.
Definition at line 199 of file staticsafedeclare.h.
References mutex_.
|
static |
Call this function once, and only once, at the end of a program, to explicitly destroy all StaticDeleters (including the StaticDeleterDeleter instance).
Any attempt to access pointers declared with the macros in this file will fail after this call. Even if this function is never called, however, the static instance will still be destroyed at program shutdown, it will just probably happen after any memory trackers are destroyed, causing them to report erroneous leaks.
Definition at line 61 of file staticsafedeclare.cc.
|
inline |
Returns the deleter at the passed index.
Returns NULL if the index is invalid.
Definition at line 219 of file staticsafedeclare.h.
|
inline |
Returns the number of deleters in this.
Definition at line 224 of file staticsafedeclare.h.
|
static |
Returns a pointer to the global instance.
Definition at line 54 of file staticsafedeclare.cc.
References ION_DECLARE_SAFE_STATIC.
|
inlineinherited |
GetRefCount() is part of the interface necessary for SharedPtr.
Definition at line 34 of file shareable.h.
Referenced by ion::base::Notifier::RemoveReceiver().
|
inline |
Does nothing, but simplifies the above macros for static non-pointer instances.
Definition at line 212 of file staticsafedeclare.h.