Implements transparent reference counting. More...
#include <itkSmartPointer.h>
Public Types | |
typedef TObjectType | ObjectType |
Public Member Functions | |
ObjectType * | GetPointer () const |
operator ObjectType * () const | |
template<typename TR > | |
bool | operator!= (TR r) const |
ObjectType * | operator-> () const |
bool | operator< (const SmartPointer &r) const |
bool | operator<= (const SmartPointer &r) const |
SmartPointer & | operator= (const SmartPointer &r) |
template<typename TR > | |
bool | operator== (TR r) const |
bool | operator> (const SmartPointer &r) const |
bool | operator>= (const SmartPointer &r) const |
SmartPointer (ObjectType *p) | |
SmartPointer (const SmartPointer< ObjectType > &p) | |
SmartPointer () | |
bool | IsNotNull () const |
bool | IsNull () const |
SmartPointer & | operator= (ObjectType *r) |
ObjectType * | Print (std::ostream &os) const |
~SmartPointer () |
Implements transparent reference counting.
SmartPointer implements reference counting by overloading operator -> (and *) among others. This allows natural interface to the class referred to by the pointer without having to invoke special Register()/UnRegister() methods directly.
To compile / test this class Windows: cl SmartPointerTest.cxx; ..exe linux: c++ SmartPointerTest.cxx ./a.out other: CCcompiler SmartPointerTest.cxx ./a.out
Definition at line 42 of file itkSmartPointer.h.
typedef TObjectType itk::SmartPointer< TObjectType >::ObjectType |
Definition at line 45 of file itkSmartPointer.h.
itk::SmartPointer< TObjectType >::SmartPointer | ( | ) | [inline] |
Constructor
Definition at line 48 of file itkSmartPointer.h.
itk::SmartPointer< TObjectType >::SmartPointer | ( | const SmartPointer< ObjectType > & | p | ) | [inline] |
Copy constructor
Definition at line 52 of file itkSmartPointer.h.
itk::SmartPointer< TObjectType >::SmartPointer | ( | ObjectType * | p | ) | [inline] |
Constructor to pointer p
Definition at line 57 of file itkSmartPointer.h.
itk::SmartPointer< TObjectType >::~SmartPointer | ( | ) | [inline] |
Destructor
Definition at line 62 of file itkSmartPointer.h.
ObjectType* itk::SmartPointer< TObjectType >::GetPointer | ( | ) | const [inline] |
Access function to pointer.
Definition at line 94 of file itkSmartPointer.h.
Referenced by itk::watershed::BoundaryResolver< TPixelType, TDimension >::BoundaryResolver(), itk::ObjectFactory< T >::Create(), itk::CreateObjectFunction< T >::CreateObject(), itk::watershed::EquivalenceRelabeler< TScalarType, TImageDimension >::EquivalenceRelabeler(), itk::Statistics::MeanShiftModeSeekerBase< TSample >::GetCacheMethod(), itk::TransformFactoryBase::GetFactory(), itk::SpatialObjectFactoryBase::GetFactory(), itk::fem::Solver::GetInterpolationGrid(), itk::IdentityTransform< TScalarType, NDimensions >::GetInverseTransform(), itk::TreeContainer< itk::SpatialObject< TDimension > * >::GetRoot(), itk::SmartPointer< const Self >::operator=(), itk::watershed::BoundaryResolver< TPixelType, TDimension >::SetEquivalencyTable(), and itk::fem::FiniteDifferenceFunctionLoad< TMoving, TFixed >::SetMetric().
bool itk::SmartPointer< TObjectType >::IsNotNull | ( | ) | const [inline] |
Test if the pointer has been initialized
Definition at line 78 of file itkSmartPointer.h.
Referenced by itk::ConstrainedRegionBasedLevelSetFunctionSharedData< TInputImage, TFeatureImage, TSingleData >::PopulateListImage().
bool itk::SmartPointer< TObjectType >::IsNull | ( | ) | const [inline] |
Test if the pointer has been initialized
Definition at line 80 of file itkSmartPointer.h.
itk::SmartPointer< TObjectType >::operator ObjectType * | ( | ) | const [inline] |
Return pointer to object.
Definition at line 74 of file itkSmartPointer.h.
bool itk::SmartPointer< TObjectType >::operator!= | ( | TR | r | ) | const [inline] |
Definition at line 90 of file itkSmartPointer.h.
ObjectType* itk::SmartPointer< TObjectType >::operator-> | ( | ) | const [inline] |
Overload operator ->
Definition at line 70 of file itkSmartPointer.h.
bool itk::SmartPointer< TObjectType >::operator< | ( | const SmartPointer< TObjectType > & | r | ) | const [inline] |
Comparison of pointers. Less than comparison.
Definition at line 98 of file itkSmartPointer.h.
bool itk::SmartPointer< TObjectType >::operator<= | ( | const SmartPointer< TObjectType > & | r | ) | const [inline] |
Comparison of pointers. Less than or equal to comparison.
Definition at line 106 of file itkSmartPointer.h.
SmartPointer& itk::SmartPointer< TObjectType >::operator= | ( | ObjectType * | r | ) | [inline] |
Overload operator assignment.
Definition at line 118 of file itkSmartPointer.h.
SmartPointer& itk::SmartPointer< TObjectType >::operator= | ( | const SmartPointer< TObjectType > & | r | ) | [inline] |
Overload operator assignment.
Definition at line 114 of file itkSmartPointer.h.
Referenced by itk::SmartPointer< const Self >::operator=().
bool itk::SmartPointer< TObjectType >::operator== | ( | TR | r | ) | const [inline] |
Template comparison operators.
Definition at line 86 of file itkSmartPointer.h.
bool itk::SmartPointer< TObjectType >::operator> | ( | const SmartPointer< TObjectType > & | r | ) | const [inline] |
Comparison of pointers. Greater than comparison.
Definition at line 102 of file itkSmartPointer.h.
bool itk::SmartPointer< TObjectType >::operator>= | ( | const SmartPointer< TObjectType > & | r | ) | const [inline] |
Comparison of pointers. Greater than or equal to comparison.
Definition at line 110 of file itkSmartPointer.h.
ObjectType* itk::SmartPointer< TObjectType >::Print | ( | std::ostream & | os | ) | const [inline] |
Function to print object pointed to
Definition at line 132 of file itkSmartPointer.h.