ITK
4.9.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 55 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 () ITK_SP_NOEXCEPT |
Private Attributes | |
ObjectType * | m_Pointer |
typedef TObjectType itk::SmartPointer< TObjectType >::ObjectType |
Definition at line 58 of file itkSmartPointer.h.
|
inline |
Constructor
Definition at line 61 of file itkSmartPointer.h.
|
inline |
Copy constructor
Definition at line 65 of file itkSmartPointer.h.
|
inline |
Constructor to pointer p
Definition at line 70 of file itkSmartPointer.h.
|
inline |
Destructor
Definition at line 75 of file itkSmartPointer.h.
|
inline |
Access function to pointer.
Definition at line 108 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::SegmentationLevelSetFunction< TImageType, TFeatureImageType >::GetAdvectionImage(), itk::FastMarchingExtensionImageFilter< TLevelSet, TAuxValue, VAuxDimension, TSpeedImage >::GetAuxiliaryAliveValues(), itk::ClassifierBase< TInputImage >::GetDecisionRule(), itk::Statistics::KdTree< TSample >::GetDistanceMetric(), itk::SpatialObjectFactoryBase::GetFactory(), itk::FEMFactoryBase::GetFactory(), itk::FEMObjectSpatialObject< TDimension >::GetFEMObject(), itk::testhelper::ImageRegistrationMethodImageSource< TFixedPixelType, TMovingPixelType, NDimension >::GetFixedImage(), itk::VideoStream< TFrameType >::GetFrameBuffer(), itk::fem::Solver< TDimension >::GetInterpolationGrid(), itkv3::Rigid3DTransform< TParametersValueType >::GetInverseTransform(), itk::IdentityTransform< TParametersValueType, NDimensions >::GetInverseTransform(), itk::fem::Element3DMembrane1DOF< Element3DC0LinearTriangular >::GetMaterial(), itk::testhelper::ImageRegistrationMethodImageSource< TFixedPixelType, TMovingPixelType, NDimension >::GetMovingImage(), itk::Image< TNode *, VImageDimension >::GetPixelContainer(), itk::SpecialCoordinatesImage< TPixel, 3 >::GetPixelContainer(), itk::VectorImage< TPixelType, Dimension >::GetPixelContainer(), itk::TreeContainer< itk::SpatialObject< TDimension > * >::GetRoot(), 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 91 of file itkSmartPointer.h.
Referenced by itk::AffineGeometryFrame< TScalar, NDimensions >::GetBounds(), itk::AffineGeometryFrame< TScalar, NDimensions >::GetExtent(), itk::ConstrainedRegionBasedLevelSetFunctionSharedData< TInputImage, TFeatureImage, TSingleData >::PopulateListImage(), and itk::BSplineResampleImageFunction< TImageType, TCoordRep >::SetInputImage().
|
inline |
Test if the pointer is NULL.
Definition at line 95 of file itkSmartPointer.h.
Referenced by itk::FEMFactoryBase::GetFactory(), HashTestImage(), itk::fem::Element::Node::New(), itk::SmartPointer< const Self >::Print(), itk::ComposeDisplacementFieldsImageFilter< TInputImage, TOutputImage >::SetDisplacementField(), itk::InvertDisplacementFieldImageFilter< TInputImage, TOutputImage >::SetDisplacementField(), and itk::VoronoiDiagram2D< TCoordType >::VertexListClear().
|
inline |
Return pointer to object.
Definition at line 87 of file itkSmartPointer.h.
|
inline |
Definition at line 104 of file itkSmartPointer.h.
|
inline |
Overload operator ->
Definition at line 83 of file itkSmartPointer.h.
|
inline |
Comparison of pointers. Less than comparison.
Definition at line 112 of file itkSmartPointer.h.
|
inline |
Comparison of pointers. Less than or equal to comparison.
Definition at line 120 of file itkSmartPointer.h.
|
inline |
Overload operator assignment.
Definition at line 129 of file itkSmartPointer.h.
Referenced by itk::SmartPointer< const Self >::operator=().
|
inline |
Overload operator assignment.
Definition at line 133 of file itkSmartPointer.h.
|
inline |
Template comparison operators.
Definition at line 100 of file itkSmartPointer.h.
|
inline |
Comparison of pointers. Greater than comparison.
Definition at line 116 of file itkSmartPointer.h.
|
inline |
Comparison of pointers. Greater than or equal to comparison.
Definition at line 124 of file itkSmartPointer.h.
|
inline |
Function to print object pointed to
Definition at line 143 of file itkSmartPointer.h.
|
inlineprivate |
Definition at line 176 of file itkSmartPointer.h.
Referenced by itk::SmartPointer< const Self >::SmartPointer().
|
inline |
Definition at line 159 of file itkSmartPointer.h.
|
inline |
Definition at line 165 of file itkSmartPointer.h.
Referenced by itk::SmartPointer< const Self >::operator=(), itk::SmartPointer< const Self >::swap(), and itk::swap().
|
inlineprivate |
Definition at line 181 of file itkSmartPointer.h.
Referenced by itk::Directory::New(), itk::fem::Element::Node::New(), itk::CellInterface< TPixelType, TCellTraits >::MultiVisitor::New(), and itk::SmartPointer< const Self >::~SmartPointer().
|
private |
The pointer to the object referred to by this smart pointer.
Definition at line 174 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().