Medical Imaging Interaction Toolkit
2024.06.00
Medical Imaging Interaction Toolkit
|
Go to the documentation of this file.
13 #ifndef mitkReferenceCountWatcher_h
14 #define mitkReferenceCountWatcher_h
16 #include "itkCommand.h"
29 typedef itk::SimpleMemberCommand<ReferenceCountWatcher>
CommandType;
83 return m_Object->GetReferenceCount();
88 itkGetStringMacro(Comment);
~ReferenceCountWatcher() override
Destructor: remove observer.
#define mitkClassMacroItkParent(className, SuperClassName)
Find image slices visible on a given plane.
int GetReferenceCount() const override
Return the reference count of the watched object or 0 if it has been destroyed.
itk::Object * m_Object
Object to be watched.
void DeleteObserver()
Callback called on itk::DeleteEvent() of wathched object.
ReferenceCountWatcher(itk::Object *o, const char *comment="")
Constructor requiring object to be watched and allowing an optional comment.
itk::SimpleMemberCommand< ReferenceCountWatcher > CommandType
unsigned long m_ObserverTag
std::string m_Comment
Optional comment, e.g. for debugging output.
bool m_Deleted
If true, m_Object is no longer valid and the returned reference count will be 0.
CommandType::Pointer m_DeleteCommand
itk::Command to get a notification when the object is deleted.
Keeps track of the reference count of an object even if it is destroyed.