ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
#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 () | |
SmartPointer (const SmartPointer< ObjectType > &p) | |
SmartPointer (ObjectType *p) | |
~SmartPointer () | |
bool | IsNotNull () const |
bool | IsNull () const |
SmartPointer & | operator= (ObjectType *r) |
ObjectType * | Print (std::ostream &os) const |
Private Member Functions | |
void | Register () |
void | UnRegister () |
Private Attributes | |
ObjectType * | m_Pointer |
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 43 of file itkSmartPointer.h.
typedef TObjectType itk::SmartPointer< TObjectType >::ObjectType |
Definition at line 46 of file itkSmartPointer.h.
itk::SmartPointer< TObjectType >::SmartPointer | ( | ) | [inline] |
Constructor
Definition at line 49 of file itkSmartPointer.h.
itk::SmartPointer< TObjectType >::SmartPointer | ( | const SmartPointer< ObjectType > & | p | ) | [inline] |
Copy constructor
Definition at line 53 of file itkSmartPointer.h.
itk::SmartPointer< TObjectType >::SmartPointer | ( | ObjectType * | p | ) | [inline] |
Constructor to pointer p
Definition at line 58 of file itkSmartPointer.h.
itk::SmartPointer< TObjectType >::~SmartPointer | ( | ) | [inline] |
Destructor
Definition at line 63 of file itkSmartPointer.h.
ObjectType* itk::SmartPointer< TObjectType >::GetPointer | ( | ) | const [inline] |
Access function to pointer.
Definition at line 95 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< TScalarType, NDimensions, VSplineOrder >::CreateAnother(), itk::CreateObjectFunction< T >::CreateObject(), itk::watershed::EquivalenceRelabeler< TScalarType, TImageDimension >::EquivalenceRelabeler(), itk::TransformFactoryBase::GetFactory(), itk::SpatialObjectFactoryBase::GetFactory(), itk::FEMFactoryBase::GetFactory(), itk::testhelper::ImageRegistrationMethodImageSource< TFixedPixelType, TMovingPixelType, NDimension >::GetFixedImage(), itkv3::Rigid3DTransform< TScalarType >::GetInverseTransform(), itk::fem::Element3DMembrane1DOF< Element3DC0LinearTriangular >::GetMaterial(), itk::testhelper::ImageRegistrationMethodImageSource< TFixedPixelType, TMovingPixelType, NDimension >::GetMovingImage(), itk::TreeContainer< itk::SpatialObject< TDimension > * >::GetRoot(), itk::HistogramThresholdCalculator< THistogram, TOutput >::MakeOutput(), itk::SmartPointer< const Self >::operator=(), itk::fem::Load::SetElement(), 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::Element2DStrain< Element2DC0LinearTriangular >::SetMaterial(), itk::fem::Element1DStress< Element2DC0LinearLine >::SetMaterial(), itk::fem::Element2DMembrane< Element2DC0LinearTriangular >::SetMaterial(), itk::fem::Element2DC1Beam::SetMaterial(), itk::fem::FiniteDifferenceFunctionLoad< TMoving, TFixed >::SetMetric(), itk::fem::Element::SetNode(), and itk::MetaSceneConverter< NDimensions, PixelType, TMeshTraits >::SpatialObjectToMetaObject().
bool itk::SmartPointer< TObjectType >::IsNotNull | ( | ) | const [inline] |
Test if the pointer has been initialized
Definition at line 79 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 81 of file itkSmartPointer.h.
Referenced by itk::FEMFactoryBase::GetFactory(), HashTestImage(), itk::fem::Element::Node::New(), itk::ComposeDisplacementFieldsImageFilter< TInputImage, TOutputImage >::SetDisplacementField(), and itk::InvertDisplacementFieldImageFilter< TInputImage, TOutputImage >::SetDisplacementField().
itk::SmartPointer< TObjectType >::operator ObjectType * | ( | ) | const [inline] |
Return pointer to object.
Definition at line 75 of file itkSmartPointer.h.
bool itk::SmartPointer< TObjectType >::operator!= | ( | TR | r | ) | const [inline] |
Definition at line 91 of file itkSmartPointer.h.
ObjectType* itk::SmartPointer< TObjectType >::operator-> | ( | ) | const [inline] |
Overload operator ->
Definition at line 71 of file itkSmartPointer.h.
bool itk::SmartPointer< TObjectType >::operator< | ( | const SmartPointer< TObjectType > & | r | ) | const [inline] |
Comparison of pointers. Less than comparison.
Definition at line 99 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 107 of file itkSmartPointer.h.
SmartPointer& itk::SmartPointer< TObjectType >::operator= | ( | const SmartPointer< TObjectType > & | r | ) | [inline] |
Overload operator assignment.
Definition at line 116 of file itkSmartPointer.h.
Referenced by itk::SmartPointer< const Self >::operator=().
SmartPointer& itk::SmartPointer< TObjectType >::operator= | ( | ObjectType * | r | ) | [inline] |
Overload operator assignment.
Definition at line 120 of file itkSmartPointer.h.
bool itk::SmartPointer< TObjectType >::operator== | ( | TR | r | ) | const [inline] |
Template comparison operators.
Definition at line 87 of file itkSmartPointer.h.
bool itk::SmartPointer< TObjectType >::operator> | ( | const SmartPointer< TObjectType > & | r | ) | const [inline] |
Comparison of pointers. Greater than comparison.
Definition at line 103 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 111 of file itkSmartPointer.h.
ObjectType* itk::SmartPointer< TObjectType >::Print | ( | std::ostream & | os | ) | const [inline] |
Function to print object pointed to
Definition at line 135 of file itkSmartPointer.h.
void itk::SmartPointer< TObjectType >::Register | ( | ) | [inline, private] |
Definition at line 147 of file itkSmartPointer.h.
Referenced by itk::SmartPointer< const Self >::operator=(), and itk::SmartPointer< const Self >::SmartPointer().
void itk::SmartPointer< TObjectType >::UnRegister | ( | ) | [inline, private] |
Definition at line 152 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().
ObjectType* itk::SmartPointer< TObjectType >::m_Pointer [private] |
The pointer to the object referrred to by this smart pointer.
Definition at line 145 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 >::operator>=(), itk::SmartPointer< const Self >::Print(), itk::SmartPointer< const Self >::Register(), itk::SmartPointer< const Self >::SmartPointer(), itk::SmartPointer< const Self >::UnRegister(), and itk::SmartPointer< const Self >::~SmartPointer().