#include <itkAutoPointer.h>
Public Types | |
typedef TObjectType | ObjectType |
typedef AutoPointer | Self |
Public Member Functions | |
AutoPointer () | |
AutoPointer (ObjectType *p, bool takeOwnership) | |
ObjectType * | operator-> () const |
void | TakeOwnership (void) |
bool | IsOwner (void) const |
ObjectType * | ReleaseOwnership (void) |
ObjectType * | GetPointer () const |
bool | operator== (const AutoPointer &r) const |
bool | operator!= (const AutoPointer &r) const |
bool | operator< (const AutoPointer &r) const |
bool | operator> (const AutoPointer &r) const |
bool | operator<= (const AutoPointer &r) const |
bool | operator>= (const AutoPointer &r) const |
operator bool () const | |
AutoPointer (AutoPointer &p) | |
~AutoPointer () | |
void | Reset (void) |
void | TakeOwnership (ObjectType *objectptr) |
void | TakeNoOwnership (ObjectType *objectptr) |
AutoPointer & | operator= (AutoPointer &r) const |
ObjectType * | Print (std::ostream &os) const |
AutoPointer is intended to facilitate the construction of objects on the fly for those objects that are not to be shared. An AutoPointer destroys its object when it goes out of scope. Ownership of the object is transferred from one AutoPointer to another AutoPointer when the assignement operator is used. An AutoPointer can release ownership of the object it holds.
This class follows the design of the std::auto_ptr class. The main reason for not using the std version is to avoid templated methods, which greatly increase the difficulty of wrapping for Tcl, Python and Java.
Definition at line 45 of file itkAutoPointer.h.
|
Extract information from template parameter. Definition at line 49 of file itkAutoPointer.h. Referenced by itk::AutoPointer< TObjectType >::ReleaseOwnership(). |
|
Definition at line 50 of file itkAutoPointer.h. |
|
Constructor. Definition at line 53 of file itkAutoPointer.h. |
|
Copy constructor. Definition at line 59 of file itkAutoPointer.h. References itk::AutoPointer< TObjectType >::IsOwner(), and itk::AutoPointer< TObjectType >::ReleaseOwnership(). |
|
Constructor to pointer p. Definition at line 68 of file itkAutoPointer.h. |
|
Destructor. Definition at line 75 of file itkAutoPointer.h. |
|
Access function to pointer. Definition at line 157 of file itkAutoPointer.h. References itk::AutoPointer< TObjectType >::m_Pointer. |
|
Query for the ownership Definition at line 133 of file itkAutoPointer.h. Referenced by itk::AutoPointer< TObjectType >::AutoPointer(). |
|
Casting operator to boolean. This is used in conditional statments to check the content of the pointer against null Definition at line 194 of file itkAutoPointer.h. |
|
Comparison of pointers. NonEqual comparison. Definition at line 165 of file itkAutoPointer.h. References itk::AutoPointer< TObjectType >::m_Pointer. |
|
Overload operator ->. Definition at line 87 of file itkAutoPointer.h. |
|
Comparison of pointers. Less than comparison. Definition at line 169 of file itkAutoPointer.h. References itk::AutoPointer< TObjectType >::m_Pointer. |
|
Comparison of pointers. Less than or equal to comparison. Definition at line 177 of file itkAutoPointer.h. References itk::AutoPointer< TObjectType >::m_Pointer. |
|
Overload operator assignment. Definition at line 185 of file itkAutoPointer.h. References NULL. |
|
Comparison of pointers. Equal comparison. Definition at line 161 of file itkAutoPointer.h. References itk::AutoPointer< TObjectType >::m_Pointer. |
|
Comparison of pointers. Greater than comparison. Definition at line 173 of file itkAutoPointer.h. References itk::AutoPointer< TObjectType >::m_Pointer. |
|
Comparison of pointers. Greater than or equal to comparison. Definition at line 181 of file itkAutoPointer.h. |
|
Function to print object pointed to. Definition at line 198 of file itkAutoPointer.h. |
|
Release the pointer hold by the current AutoPointer and return the raw pointer so it can be hold by another AutoPointer. This operation is intended to be used for facilitating polymorphism. Example: if class Cow derives from Mammal, AutoPointer<Cow> onecow = new Cow; AutoPointer<Mammal> onemammal = onecow.ReleaseOwnership(); Note that the AutoPointer still points to the object after the ReleaseOwnership operation, but it doesn't own the object any more. Definition at line 150 of file itkAutoPointer.h. References itk::AutoPointer< TObjectType >::ObjectType. Referenced by itk::AutoPointer< TObjectType >::AutoPointer(). |
|
Clear the AutoPointer. If it had a pointer the object is deleted and the pointer is set to null. Definition at line 92 of file itkAutoPointer.h. |
|
Explicitly reject ownership Definition at line 121 of file itkAutoPointer.h. |
|
Explicitly set the ownership Definition at line 109 of file itkAutoPointer.h. |
|
Explicitly set the ownership Definition at line 105 of file itkAutoPointer.h. |