SimpleITK
|
An abstract base class to connect this object with the lifetime of another. More...
#include <sitkObjectOwnedBase.h>
An abstract base class to connect this object with the lifetime of another.
This class maintains a list of Objects and callbacks to call when this object is deleted.
Optionally, "OwnedByObjects" property can be enabled so that when the last referenced object is removed this object will be deleted.
Definition at line 47 of file sitkObjectOwnedBase.h.
Public Member Functions | |
virtual std::string | GetName () const |
ObjectOwnedBase ()=default | |
virtual void | SetName (const std::string &name) |
virtual | ~ObjectOwnedBase ()=0 |
Public Member Functions inherited from itk::simple::NonCopyable | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
Protected Member Functions | |
virtual size_t | AddObjectCallback (itk::Object *o, std::function< void()> onDelete) |
Register an Object and a method to call on this object's destructor. More... | |
ObjectOwnedBase (const ObjectOwnedBase &o) | |
Copy Constructor. More... | |
virtual size_t | RemoveObject (const itk::Object *) |
virtual void | SetOwnedByObjects (bool o) |
virtual bool | GetOwnedByObjects () const |
virtual void | OwnedByObjectsOn () |
virtual void | OwnedByObjectsOff () |
Protected Member Functions inherited from itk::simple::NonCopyable | |
NonCopyable ()=default | |
Private Member Functions | |
void | ExecuteCallbacks (void) |
Private Attributes | |
std::string | m_Name |
bool | m_OwnedByObjects { false } |
std::multimap< itk::Object *, std::function< void()> > | m_ReferencedObjectsCallbacks |
|
pure virtual |
|
default |
|
protected |
Copy Constructor.
Only copiable if o does not have OwnedByObjects enabled. If OwnedByObjects is enabled in o, than an exception will be thrown.
The object callbacks are copied to the new object.
|
protectedvirtual |
Register an Object and a method to call on this object's destructor.
o | |
onDelete | A function object to be called |
|
private |
|
virtual |
Set object name.
Reimplemented in itk::simple::LoggerBase, and itk::simple::Command.
|
protectedvirtual |
Set/Get the OwnedByObject attribute.
Indicates that ownership of this object is by object's in the ObjectCallbacks and that this object was dynamically allocated on the heap.
If true, when all objects have been removed by "RemovedObject", then this will be deleted.
|
protectedvirtual |
Set/Get the OwnedByObject attribute.
Indicates that ownership of this object is by object's in the ObjectCallbacks and that this object was dynamically allocated on the heap.
If true, when all objects have been removed by "RemovedObject", then this will be deleted.
|
protectedvirtual |
Set/Get the OwnedByObject attribute.
Indicates that ownership of this object is by object's in the ObjectCallbacks and that this object was dynamically allocated on the heap.
If true, when all objects have been removed by "RemovedObject", then this will be deleted.
|
protectedvirtual |
|
virtual |
Get object name.
Reimplemented in itk::simple::LoggerBase, and itk::simple::Command.
|
protectedvirtual |
Set/Get the OwnedByObject attribute.
Indicates that ownership of this object is by object's in the ObjectCallbacks and that this object was dynamically allocated on the heap.
If true, when all objects have been removed by "RemovedObject", then this will be deleted.
|
private |
Definition at line 117 of file sitkObjectOwnedBase.h.
|
private |
Definition at line 115 of file sitkObjectOwnedBase.h.
|
private |
Definition at line 116 of file sitkObjectOwnedBase.h.