ITK  4.6.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
itk::SmartPointer< TObjectType > Class Template Reference

#include <itkSmartPointer.h>

+ Inheritance diagram for itk::SmartPointer< TObjectType >:

Detailed Description

template<typename TObjectType>
class itk::SmartPointer< TObjectType >

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

Examples:
RegistrationITKv3/DeformableRegistration10.cxx, RegistrationITKv3/DeformableRegistration2.cxx, RegistrationITKv3/DeformableRegistration3.cxx, RegistrationITKv3/DeformableRegistration5.cxx, RegistrationITKv3/DeformableRegistration9.cxx, RegistrationITKv4/DeformableRegistration10.cxx, RegistrationITKv4/DeformableRegistration2.cxx, RegistrationITKv4/DeformableRegistration3.cxx, RegistrationITKv4/DeformableRegistration5.cxx, and RegistrationITKv4/DeformableRegistration9.cxx.

Definition at line 53 of file itkSmartPointer.h.

Public Types

typedef TObjectType ObjectType
 

Public Member Functions

ObjectTypeGetPointer () const
 
 operator ObjectType * () const
 
template<typename TR >
bool operator!= (TR r) const
 
ObjectTypeoperator-> () const
 
bool operator< (const SmartPointer &r) const
 
bool operator<= (const SmartPointer &r) const
 
SmartPointeroperator= (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)
 
 ~SmartPointer ()
 
bool IsNotNull () const
 
bool IsNull () const
 
SmartPointeroperator= (ObjectType *r)
 
ObjectTypePrint (std::ostream &os) const
 

Private Member Functions

void Register ()
 
void UnRegister ()
 

Private Attributes

ObjectTypem_Pointer
 

Member Typedef Documentation

template<typename TObjectType>
typedef TObjectType itk::SmartPointer< TObjectType >::ObjectType

Definition at line 56 of file itkSmartPointer.h.

Constructor & Destructor Documentation

template<typename TObjectType>
itk::SmartPointer< TObjectType >::SmartPointer ( )
inline

Constructor

Definition at line 59 of file itkSmartPointer.h.

template<typename TObjectType>
itk::SmartPointer< TObjectType >::SmartPointer ( const SmartPointer< ObjectType > &  p)
inline

Copy constructor

Definition at line 63 of file itkSmartPointer.h.

template<typename TObjectType>
itk::SmartPointer< TObjectType >::SmartPointer ( ObjectType p)
inline

Constructor to pointer p

Definition at line 68 of file itkSmartPointer.h.

template<typename TObjectType>
itk::SmartPointer< TObjectType >::~SmartPointer ( )
inline

Destructor

Definition at line 73 of file itkSmartPointer.h.

Member Function Documentation

template<typename TObjectType>
ObjectType* itk::SmartPointer< TObjectType >::GetPointer ( ) const
inline

Access function to pointer.

Definition at line 105 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< TScalar, 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::TransformFactoryBase::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< TScalar >::GetInverseTransform(), itk::IdentityTransform< TScalar, NDimensions >::GetInverseTransform(), itk::fem::Element3DMembrane1DOF< Element3DC0LinearTriangular >::GetMaterial(), itk::testhelper::ImageRegistrationMethodImageSource< TFixedPixelType, TMovingPixelType, NDimension >::GetMovingImage(), itk::SpecialCoordinatesImage< TPixel, 3 >::GetPixelContainer(), itk::Image< TNode *, VImageDimension >::GetPixelContainer(), itk::VectorImage< TPixelType, Dimension >::GetPixelContainer(), itk::TreeContainer< itk::SpatialObject< TDimension > * >::GetRoot(), itk::HistogramThresholdCalculator< THistogram, TOutput >::MakeOutput(), itk::ImageRegistrationMethodv4< TFixedImage, TMovingImage, TOutputTransform >::MakeOutputTransform(), itk::fem::CompareLandmarkDisplacementError::operator()(), itk::SmartPointer< const Self >::operator=(), itk::watershed::BoundaryResolver< TPixelType, TDimension >::SetEquivalencyTable(), itk::fem::Element3DStrain< Element3DC0LinearTetrahedron >::SetMaterial(), itk::fem::Element2DStress< Element2DC0LinearTriangular >::SetMaterial(), itk::fem::Element3DMembrane1DOF< Element3DC0LinearTriangular >::SetMaterial(), itk::fem::Element3DMembrane< Element3DC0LinearTriangular >::SetMaterial(), itk::fem::Element1DStress< Element2DC0LinearLine >::SetMaterial(), itk::fem::Element2DStrain< Element2DC0LinearTriangular >::SetMaterial(), itk::fem::Element2DMembrane< Element2DC0LinearTriangular >::SetMaterial(), itk::fem::FiniteDifferenceFunctionLoad< TMoving, TFixed >::SetMetric(), itk::fem::Element::SetNode(), and itk::MetaSceneConverter< NDimensions, PixelType, TMeshTraits >::SpatialObjectToMetaObject().

template<typename TObjectType>
bool itk::SmartPointer< TObjectType >::IsNotNull ( ) const
inline
template<typename TObjectType>
bool itk::SmartPointer< TObjectType >::IsNull ( ) const
inline
template<typename TObjectType>
itk::SmartPointer< TObjectType >::operator ObjectType * ( ) const
inline

Return pointer to object.

Definition at line 85 of file itkSmartPointer.h.

template<typename TObjectType>
template<typename TR >
bool itk::SmartPointer< TObjectType >::operator!= ( TR  r) const
inline

Definition at line 101 of file itkSmartPointer.h.

template<typename TObjectType>
ObjectType* itk::SmartPointer< TObjectType >::operator-> ( ) const
inline

Overload operator ->

Definition at line 81 of file itkSmartPointer.h.

template<typename TObjectType>
bool itk::SmartPointer< TObjectType >::operator< ( const SmartPointer< TObjectType > &  r) const
inline

Comparison of pointers. Less than comparison.

Definition at line 109 of file itkSmartPointer.h.

template<typename TObjectType>
bool itk::SmartPointer< TObjectType >::operator<= ( const SmartPointer< TObjectType > &  r) const
inline

Comparison of pointers. Less than or equal to comparison.

Definition at line 117 of file itkSmartPointer.h.

template<typename TObjectType>
SmartPointer& itk::SmartPointer< TObjectType >::operator= ( const SmartPointer< TObjectType > &  r)
inline

Overload operator assignment.

Definition at line 126 of file itkSmartPointer.h.

Referenced by itk::SmartPointer< const Self >::operator=().

template<typename TObjectType>
SmartPointer& itk::SmartPointer< TObjectType >::operator= ( ObjectType r)
inline

Overload operator assignment.

Definition at line 130 of file itkSmartPointer.h.

template<typename TObjectType>
template<typename TR >
bool itk::SmartPointer< TObjectType >::operator== ( TR  r) const
inline

Template comparison operators.

Definition at line 97 of file itkSmartPointer.h.

template<typename TObjectType>
bool itk::SmartPointer< TObjectType >::operator> ( const SmartPointer< TObjectType > &  r) const
inline

Comparison of pointers. Greater than comparison.

Definition at line 113 of file itkSmartPointer.h.

template<typename TObjectType>
bool itk::SmartPointer< TObjectType >::operator>= ( const SmartPointer< TObjectType > &  r) const
inline

Comparison of pointers. Greater than or equal to comparison.

Definition at line 121 of file itkSmartPointer.h.

template<typename TObjectType>
ObjectType* itk::SmartPointer< TObjectType >::Print ( std::ostream &  os) const
inline

Function to print object pointed to

Definition at line 140 of file itkSmartPointer.h.

template<typename TObjectType>
void itk::SmartPointer< TObjectType >::Register ( )
inlineprivate

Definition at line 166 of file itkSmartPointer.h.

Referenced by itk::SmartPointer< const Self >::SmartPointer().

template<typename TObjectType>
void itk::SmartPointer< TObjectType >::swap ( SmartPointer< TObjectType > &  other)
inline

Definition at line 155 of file itkSmartPointer.h.

Referenced by itk::SmartPointer< const Self >::operator=(), and itk::swap().

template<typename TObjectType>
void itk::SmartPointer< TObjectType >::UnRegister ( )
inlineprivate

Member Data Documentation

template<typename TObjectType>
ObjectType* itk::SmartPointer< TObjectType >::m_Pointer
private

The documentation for this class was generated from the following file: