Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::SmartPointer< TObjectType > Class Template Reference
[ITK System ObjectsData Access Objects]

Implements transparent reference counting. More...

#include <itkSmartPointer.h>

Inheritance diagram for itk::SmartPointer:

Inheritance graph
[legend]
Collaboration diagram for itk::SmartPointer< TObjectType >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TObjectType ObjectType

Public Methods

 SmartPointer ()
 SmartPointer (const SmartPointer< ObjectType > &p)
 SmartPointer (ObjectType *p)
ObjectTypeoperator-> () const
 operator ObjectType * () const
template<typename R> bool operator== (R r) const
template<typename R> bool operator!= (R r) const
ObjectTypeGetPointer () const
bool operator< (const SmartPointer &r) const
bool operator> (const SmartPointer &r) const
bool operator<= (const SmartPointer &r) const
bool operator>= (const SmartPointer &r) const
SmartPointer & operator= (const SmartPointer &r)
SmartPointer & operator= (const WeakPointer< ObjectType > &r)
 SmartPointer (const WeakPointer< ObjectType > &p)
 ~SmartPointer ()
SmartPointer & operator= (ObjectType *r)
ObjectTypePrint (std::ostream &os) const

Detailed Description

template<class 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

Definition at line 44 of file itkSmartPointer.h.


Member Typedef Documentation

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

Definition at line 47 of file itkSmartPointer.h.


Constructor & Destructor Documentation

template<class TObjectType>
itk::SmartPointer< TObjectType >::SmartPointer   [inline]
 

Constructor

Definition at line 50 of file itkSmartPointer.h.

template<class TObjectType>
itk::SmartPointer< TObjectType >::SmartPointer const SmartPointer< ObjectType > &    p [inline]
 

Copy constructor

Definition at line 54 of file itkSmartPointer.h.

template<class TObjectType>
itk::SmartPointer< TObjectType >::SmartPointer ObjectType   p [inline]
 

Constructor to pointer p

Definition at line 59 of file itkSmartPointer.h.

template<class TObjectType>
itk::SmartPointer< TObjectType >::SmartPointer const WeakPointer< ObjectType > &    p [inline]
 

Construct from a WeakPointer

Definition at line 64 of file itkSmartPointer.h.

template<class TObjectType>
itk::SmartPointer< TObjectType >::~SmartPointer   [inline]
 

Destructor

Definition at line 72 of file itkSmartPointer.h.


Member Function Documentation

template<class TObjectType>
ObjectType* itk::SmartPointer< TObjectType >::GetPointer   const [inline]
 

Access function to pointer.

Definition at line 97 of file itkSmartPointer.h.

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

template<class TObjectType>
itk::SmartPointer< TObjectType >::operator ObjectType *   const [inline]
 

Return pointer to object.

Definition at line 84 of file itkSmartPointer.h.

template<class TObjectType>
template<typename R>
bool itk::SmartPointer< TObjectType >::operator!=   r const [inline]
 

Definition at line 93 of file itkSmartPointer.h.

template<class TObjectType>
ObjectType* itk::SmartPointer< TObjectType >::operator->   const [inline]
 

Overload operator->

Definition at line 80 of file itkSmartPointer.h.

template<class TObjectType>
bool itk::SmartPointer< TObjectType >::operator< const SmartPointer< TObjectType > &    r const [inline]
 

Comparison of pointers. Less than comparison.

Definition at line 101 of file itkSmartPointer.h.

template<class TObjectType>
bool itk::SmartPointer< TObjectType >::operator<= const SmartPointer< TObjectType > &    r const [inline]
 

Comparison of pointers. Less than or equal to comparison.

Definition at line 109 of file itkSmartPointer.h.

template<class TObjectType>
SmartPointer& itk::SmartPointer< TObjectType >::operator= ObjectType   r [inline]
 

Overload operator assignment.

Definition at line 125 of file itkSmartPointer.h.

template<class TObjectType>
SmartPointer& itk::SmartPointer< TObjectType >::operator= const WeakPointer< ObjectType > &    r [inline]
 

Overload operator assignment.

Definition at line 121 of file itkSmartPointer.h.

template<class TObjectType>
SmartPointer& itk::SmartPointer< TObjectType >::operator= const SmartPointer< TObjectType > &    r [inline]
 

Overload operator assignment.

Definition at line 117 of file itkSmartPointer.h.

template<class TObjectType>
template<typename R>
bool itk::SmartPointer< TObjectType >::operator==   r const [inline]
 

Template comparison operators.

Definition at line 89 of file itkSmartPointer.h.

template<class TObjectType>
bool itk::SmartPointer< TObjectType >::operator> const SmartPointer< TObjectType > &    r const [inline]
 

Comparison of pointers. Greater than comparison.

Definition at line 105 of file itkSmartPointer.h.

template<class TObjectType>
bool itk::SmartPointer< TObjectType >::operator>= const SmartPointer< TObjectType > &    r const [inline]
 

Comparison of pointers. Greater than or equal to comparison.

Definition at line 113 of file itkSmartPointer.h.

template<class TObjectType>
ObjectType* itk::SmartPointer< TObjectType >::Print std::ostream &    os const [inline]
 

Function to print object pointed to

Definition at line 139 of file itkSmartPointer.h.


The documentation for this class was generated from the following file:
Generated at Wed Mar 12 01:20:47 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000