Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
Keeps track of the reference count of an object even if it is destroyed. More...
#include <mitkReferenceCountWatcher.h>
Public Types | |
typedef itk::SimpleMemberCommand< ReferenceCountWatcher > | CommandType |
typedef ReferenceCountWatcher | Self |
typedef itk::Object | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
Public Member Functions | |
virtual std::vector< std::string > | GetClassHierarchy () const |
virtual const char * | GetClassName () const |
ReferenceCountWatcher (itk::Object *o, const char *comment="") | |
Constructor requiring object to be watched and allowing an optional comment. More... | |
~ReferenceCountWatcher () | |
Destructor: remove observer. More... | |
int | GetReferenceCount () const override |
Return the reference count of the watched object or 0 if it has been destroyed. More... | |
virtual const char * | GetComment () const |
Return the optional string comment. More... | |
Static Public Member Functions | |
static const char * | GetStaticNameOfClass () |
Protected Member Functions | |
void | DeleteObserver () |
Callback called on itk::DeleteEvent() of wathched object. More... | |
Protected Attributes | |
itk::Object * | m_Object |
Object to be watched. More... | |
std::string | m_Comment |
Optional comment, e.g. for debugging output. More... | |
bool | m_Deleted |
If true, m_Object is no longer valid and the returned reference count will be 0. More... | |
CommandType::Pointer | m_DeleteCommand |
itk::Command to get a notification when the object is deleted. More... | |
unsigned long | m_ObserverTag |
Keeps track of the reference count of an object even if it is destroyed.
Example usage:
Definition at line 35 of file mitkReferenceCountWatcher.h.
typedef itk::SimpleMemberCommand<ReferenceCountWatcher> mitk::ReferenceCountWatcher::CommandType |
Definition at line 38 of file mitkReferenceCountWatcher.h.
typedef itk::SmartPointer<const Self> mitk::ReferenceCountWatcher::ConstPointer |
Definition at line 40 of file mitkReferenceCountWatcher.h.
Definition at line 40 of file mitkReferenceCountWatcher.h.
Definition at line 40 of file mitkReferenceCountWatcher.h.
typedef itk::Object mitk::ReferenceCountWatcher::Superclass |
Definition at line 40 of file mitkReferenceCountWatcher.h.
|
inline |
Constructor requiring object to be watched and allowing an optional comment.
Definition at line 65 of file mitkReferenceCountWatcher.h.
References DeleteObserver(), m_ObserverTag, and mitk::New().
|
inline |
Destructor: remove observer.
Definition at line 76 of file mitkReferenceCountWatcher.h.
References m_ObserverTag.
|
inlineprotected |
Callback called on itk::DeleteEvent() of wathched object.
Definition at line 102 of file mitkReferenceCountWatcher.h.
Referenced by ReferenceCountWatcher().
|
inlinevirtual |
Definition at line 40 of file mitkReferenceCountWatcher.h.
|
virtual |
|
virtual |
Return the optional string comment.
|
inlineoverride |
Return the reference count of the watched object or 0 if it has been destroyed.
Definition at line 86 of file mitkReferenceCountWatcher.h.
|
inlinestatic |
Definition at line 40 of file mitkReferenceCountWatcher.h.
|
protected |
Optional comment, e.g. for debugging output.
Definition at line 49 of file mitkReferenceCountWatcher.h.
|
protected |
itk::Command to get a notification when the object is deleted.
Definition at line 59 of file mitkReferenceCountWatcher.h.
|
protected |
If true, m_Object is no longer valid and the returned reference count will be 0.
Definition at line 54 of file mitkReferenceCountWatcher.h.
|
protected |
Object to be watched.
Definition at line 40 of file mitkReferenceCountWatcher.h.
|
protected |
Definition at line 103 of file mitkReferenceCountWatcher.h.
Referenced by ReferenceCountWatcher(), and ~ReferenceCountWatcher().