ITK
4.13.0
Insight Segmentation and Registration Toolkit
|
#include <itkSmartPointer.h>
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; .\SmartPointerTest.exe linux: c++ SmartPointerTest.cxx ./a.out other: CCcompiler SmartPointerTest.cxx ./a.out
Definition at line 44 of file itkSmartPointer.h.
Public Types | |
typedef TObjectType | ObjectType |
Public Member Functions | |
ObjectType * | GetPointer () const |
bool | IsNotNull () const |
bool | IsNull () 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 () | |
SmartPointer (const SmartPointer< ObjectType > &p) | |
SmartPointer (ObjectType *p) | |
void | swap (SmartPointer &other) |
void | Swap (SmartPointer &other) |
~SmartPointer () | |
SmartPointer & | operator= (ObjectType *r) |
ObjectType * | Print (std::ostream &os) const |
Private Member Functions | |
void | Register () |
void | UnRegister () noexcept |
Private Attributes | |
ObjectType * | m_Pointer |
typedef TObjectType itk::SmartPointer< TObjectType >::ObjectType |
Definition at line 47 of file itkSmartPointer.h.
|
inline |
Constructor
Definition at line 50 of file itkSmartPointer.h.
|
inline |
Copy constructor
Definition at line 54 of file itkSmartPointer.h.
|
inline |
Constructor to pointer p
Definition at line 59 of file itkSmartPointer.h.
|
inline |
Destructor
Definition at line 64 of file itkSmartPointer.h.
|
inline |
Access function to pointer.
Definition at line 97 of file itkSmartPointer.h.
Referenced by itk::fem::LoadElement::AddNextElement(), itk::fem::FEMObject< VDimension >::AddNextLoad(), itk::fem::FEMObject< VDimension >::AddNextMaterial(), itk::watershed::BoundaryResolver< TPixelType, TDimension >::BoundaryResolver(), itk::ObjectFactory< T >::Create(), itk::BSplineDeformableTransform< TParametersValueType, NDimensions, VSplineOrder >::CreateAnother(), itk::CreateObjectFunction< T >::CreateObject(), itk::watershed::EquivalenceRelabeler< TScalar, TImageDimension >::EquivalenceRelabeler(), itk::ExposeMetaData(), itk::SpatialObjectFactoryBase::GetFactory(), itk::FEMFactoryBase::GetFactory(), itk::testhelper::ImageRegistrationMethodImageSource< TFixedPixelType, TMovingPixelType, NDimension >::GetFixedImage(), itk::GPUImageDataManager< itk::GPUImage >::GetImagePointer(), itkv3::Rigid3DTransform< TParametersValueType >::GetInverseTransform(), itk::testhelper::ImageRegistrationMethodImageSource< TFixedPixelType, TMovingPixelType, NDimension >::GetMovingImage(), itk::HistogramThresholdCalculator< THistogram, TOutput >::MakeOutput(), itk::ImageRegistrationMethodv4< TFixedImage, TMovingImage, TOutputTransform, TVirtualImage, TPointSet >::MakeOutputTransform(), itk::fem::CompareLandmarkDisplacementError::operator()(), itk::SmartPointer< const Self >::operator=(), itk::watershed::BoundaryResolver< TPixelType, TDimension >::SetEquivalencyTable(), itk::fem::Element2DStress< Element2DC0LinearTriangular >::SetMaterial(), itk::fem::FiniteDifferenceFunctionLoad< TMoving, TFixed >::SetMetric(), and itk::MetaSceneConverter< NDimensions, PixelType, TMeshTraits >::SpatialObjectToMetaObject().
|
inline |
Test if the pointer is not NULL.
Definition at line 80 of file itkSmartPointer.h.
Referenced by itk::ConstrainedRegionBasedLevelSetFunctionSharedData< TInputImage, TFeatureImage, TSingleData >::PopulateListImage(), itk::TransformFactoryBase::RegisterTransform(), and itk::BSplineResampleImageFunction< TImageType, TCoordRep >::SetInputImage().
|
inline |
Test if the pointer is NULL.
Definition at line 84 of file itkSmartPointer.h.
Referenced by itk::FEMFactoryBase::GetFactory(), HashTestImage(), itk::fem::Element::Node::New(), and itk::SmartPointer< const Self >::Print().
|
inline |
Return pointer to object.
Definition at line 76 of file itkSmartPointer.h.
|
inline |
Definition at line 93 of file itkSmartPointer.h.
|
inline |
Overload operator ->
Definition at line 72 of file itkSmartPointer.h.
|
inline |
Comparison of pointers. Less than comparison.
Definition at line 101 of file itkSmartPointer.h.
|
inline |
Comparison of pointers. Less than or equal to comparison.
Definition at line 109 of file itkSmartPointer.h.
|
inline |
Overload operator assignment.
Definition at line 118 of file itkSmartPointer.h.
Referenced by itk::SmartPointer< const Self >::operator=().
|
inline |
Overload operator assignment.
Definition at line 122 of file itkSmartPointer.h.
|
inline |
Template comparison operators.
Definition at line 89 of file itkSmartPointer.h.
|
inline |
Comparison of pointers. Greater than comparison.
Definition at line 105 of file itkSmartPointer.h.
|
inline |
Comparison of pointers. Greater than or equal to comparison.
Definition at line 113 of file itkSmartPointer.h.
|
inline |
Function to print object pointed to
Definition at line 132 of file itkSmartPointer.h.
|
inlineprivate |
Definition at line 165 of file itkSmartPointer.h.
Referenced by itk::SmartPointer< const Self >::SmartPointer().
|
inline |
Definition at line 148 of file itkSmartPointer.h.
|
inline |
Definition at line 154 of file itkSmartPointer.h.
Referenced by itk::SmartPointer< const Self >::operator=(), itk::SmartPointer< const Self >::swap(), and itk::swap().
|
inlineprivatenoexcept |
|
private |
The pointer to the object referred to by this smart pointer.
Definition at line 163 of file itkSmartPointer.h.
Referenced by itk::SmartPointer< const Self >::GetPointer(), itk::SmartPointer< const Self >::IsNotNull(), itk::SmartPointer< const Self >::IsNull(), itk::SmartPointer< const Self >::operator ObjectType *(), itk::SmartPointer< const Self >::operator!=(), itk::SmartPointer< const Self >::operator->(), itk::SmartPointer< const Self >::operator<(), itk::SmartPointer< const Self >::operator<=(), itk::SmartPointer< const Self >::operator==(), itk::SmartPointer< const Self >::operator>(), itk::SmartPointer< const Self >::operator>=(), itk::SmartPointer< const Self >::Print(), itk::SmartPointer< const Self >::Register(), itk::SmartPointer< const Self >::SmartPointer(), itk::SmartPointer< const Self >::Swap(), itk::SmartPointer< const Self >::UnRegister(), and itk::SmartPointer< const Self >::~SmartPointer().