ITK  5.2.0
Insight Toolkit
Public Types | Public Member Functions | List of all members
itk::WeakPointer< TObjectType > Class Template Reference

#include <itkWeakPointer.h>

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

Public Types

using ObjectType = TObjectType
 

Public Member Functions

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

Detailed Description

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

Implements a weak reference to an object.

WeakPointer implements a weak reference to an object. A natural interface to the class is defined by operator -> (and *) among others. WeakPointer is really nothing more than a standard pointer. It is used to call attention to the fact that it does not adjust the reference count of an object like SmartPointer does. WeakPointer is used internally to Insight to manage (break) reference counting loops. At some point, an object may keep track of how many objects hold weak references to itself. In all cases, however, an outstanding weak reference will not keep an object from destructing.

Definition at line 44 of file itkWeakPointer.h.

Member Typedef Documentation

◆ ObjectType

template<typename TObjectType>
using itk::WeakPointer< TObjectType >::ObjectType = TObjectType

Extract information from template parameter.

Definition at line 48 of file itkWeakPointer.h.

Constructor & Destructor Documentation

◆ WeakPointer() [1/4]

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

Constructor.

Definition at line 51 of file itkWeakPointer.h.

◆ WeakPointer() [2/4]

template<typename TObjectType>
itk::WeakPointer< TObjectType >::WeakPointer ( const WeakPointer< ObjectType > &  p)
default

Copy constructor.

◆ WeakPointer() [3/4]

template<typename TObjectType>
itk::WeakPointer< TObjectType >::WeakPointer ( WeakPointer< ObjectType > &&  p)
default

Move constructor

◆ WeakPointer() [4/4]

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

Constructor to pointer p.

Definition at line 60 of file itkWeakPointer.h.

◆ ~WeakPointer()

template<typename TObjectType>
itk::WeakPointer< TObjectType >::~WeakPointer ( )
default

Destructor.

Member Function Documentation

◆ GetPointer()

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

Access function to pointer.

Definition at line 90 of file itkWeakPointer.h.

◆ IsNotNull()

template<typename TObjectType>
bool itk::WeakPointer< TObjectType >::IsNotNull ( ) const
inline

Test if the pointer is not NULL.

Definition at line 97 of file itkWeakPointer.h.

◆ IsNull()

template<typename TObjectType>
bool itk::WeakPointer< TObjectType >::IsNull ( ) const
inline

Test if the pointer is NULL.

Definition at line 104 of file itkWeakPointer.h.

Referenced by itk::WeakPointer< itk::ImageToImageFilter >::Print().

◆ operator ObjectType *()

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

Return pointer to object.

Definition at line 71 of file itkWeakPointer.h.

◆ operator!=()

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

Definition at line 83 of file itkWeakPointer.h.

◆ operator->()

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

Overload operator ->.

Definition at line 68 of file itkWeakPointer.h.

◆ operator<()

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

Comparison of pointers. Less than comparison.

Definition at line 111 of file itkWeakPointer.h.

◆ operator<=()

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

Comparison of pointers. Less than or equal to comparison.

Definition at line 125 of file itkWeakPointer.h.

◆ operator=() [1/3]

template<typename TObjectType>
WeakPointer& itk::WeakPointer< TObjectType >::operator= ( const WeakPointer< TObjectType > &  r)
default

Overload operator assignment.

◆ operator=() [2/3]

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

Overload operator assignment.

Definition at line 147 of file itkWeakPointer.h.

◆ operator=() [3/3]

template<typename TObjectType>
WeakPointer& itk::WeakPointer< TObjectType >::operator= ( WeakPointer< TObjectType > &&  r)
default

◆ operator==()

template<typename TObjectType>
template<typename R >
bool itk::WeakPointer< TObjectType >::operator== ( r) const
inline

Template comparison operators.

Definition at line 76 of file itkWeakPointer.h.

◆ operator>()

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

Comparison of pointers. Greater than comparison.

Definition at line 118 of file itkWeakPointer.h.

◆ operator>=()

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

Comparison of pointers. Greater than or equal to comparison.

Definition at line 132 of file itkWeakPointer.h.

◆ Print()

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

Function to print object pointed to.

Definition at line 155 of file itkWeakPointer.h.

Referenced by itk::operator<<().

Member Data Documentation

◆ m_Pointer

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

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