Medical Imaging Interaction Toolkit  2023.12.99-77685e7b
Medical Imaging Interaction Toolkit
berry::SmartPointer Class Reference

Implements transparent reference counting. More...

#include <berryICommandCategoryListener.h>

Inheritance diagram for berry::SmartPointer:

Public Types

typedef TObjectType ObjectType
 
typedef SmartPointer Self
 
typedef ObjectType *Self::* unspecified_bool_type
 

Public Member Functions

 SmartPointer ()
 
 SmartPointer (ObjectType *p)
 
 SmartPointer (const SmartPointer< ObjectType > &p)
 
template<class Other >
 SmartPointer (const SmartPointer< Other > &ptr)
 
template<class Other >
 SmartPointer (const WeakPointer< Other > &wp)
 
 ~SmartPointer ()
 
template<class Other >
SmartPointer< Other > Cast () const
 
ObjectTypeoperator-> () const
 
ObjectTypeoperator* () const
 
bool IsNotNull () const
 
bool IsNull () const
 
 operator unspecified_bool_type () const
 
template<typename R >
bool operator== (const R *o) const
 
template<typename R >
bool operator== (const SmartPointer< R > &r) const
 
bool operator== (int r) const
 
template<typename R >
bool operator!= (const R *r) const
 
template<typename R >
bool operator!= (const SmartPointer< R > &r) const
 
bool operator!= (int r) const
 
ObjectTypeGetPointer () const
 
template<typename R >
bool operator< (const SmartPointer< R > &r) const
 
template<typename R >
bool operator> (const SmartPointer< R > &r) const
 
template<typename R >
bool operator<= (const SmartPointer< R > &r) const
 
template<typename R >
bool operator>= (const SmartPointer< R > &r) const
 
SmartPointeroperator= (const SmartPointer &r)
 
template<typename R >
SmartPointeroperator= (const SmartPointer< R > &r)
 
SmartPointeroperator= (ObjectType *r)
 
QDebug Print (QDebug os) const
 

Detailed Description

Implements transparent reference counting.

SmartPointer is a copy of itk::SmartPointer. It 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.

Definition at line 21 of file berryICommandCategoryListener.h.

Member Typedef Documentation

◆ ObjectType

typedef TObjectType berry::SmartPointer::ObjectType

Definition at line 48 of file berrySmartPointer.h.

◆ Self

Definition at line 49 of file berrySmartPointer.h.

◆ unspecified_bool_type

Definition at line 145 of file berrySmartPointer.h.

Constructor & Destructor Documentation

◆ SmartPointer() [1/5]

berry::SmartPointer::SmartPointer ( )
inline

Constructor

Definition at line 52 of file berrySmartPointer.h.

◆ SmartPointer() [2/5]

berry::SmartPointer::SmartPointer ( ObjectType p)
inlineexplicit

Constructor to pointer p

Definition at line 62 of file berrySmartPointer.h.

◆ SmartPointer() [3/5]

berry::SmartPointer::SmartPointer ( const SmartPointer< ObjectType > &  p)
inline

Copy constructor

Definition at line 74 of file berrySmartPointer.h.

◆ SmartPointer() [4/5]

template<class Other >
berry::SmartPointer::SmartPointer ( const SmartPointer< Other > &  ptr)
inline

Definition at line 85 of file berrySmartPointer.h.

◆ SmartPointer() [5/5]

template<class Other >
berry::SmartPointer::SmartPointer ( const WeakPointer< Other > &  wp)
explicit

Definition at line 352 of file berrySmartPointer.h.

◆ ~SmartPointer()

berry::SmartPointer::~SmartPointer ( )
inline

Destructor

Definition at line 100 of file berrySmartPointer.h.

Member Function Documentation

◆ Cast()

template<class Other >
SmartPointer<Other> berry::SmartPointer::Cast ( ) const
inline

◆ GetPointer()

◆ IsNotNull()

bool berry::SmartPointer::IsNotNull ( ) const
inline

Test if the pointer has been initialized

Definition at line 136 of file berrySmartPointer.h.

◆ IsNull()

bool berry::SmartPointer::IsNull ( ) const
inline

Definition at line 140 of file berrySmartPointer.h.

Referenced by qHash().

◆ operator unspecified_bool_type()

berry::SmartPointer::operator unspecified_bool_type ( ) const
inline

Definition at line 147 of file berrySmartPointer.h.

◆ operator!=() [1/3]

template<typename R >
bool berry::SmartPointer::operator!= ( const R *  r) const
inline

Definition at line 175 of file berrySmartPointer.h.

◆ operator!=() [2/3]

template<typename R >
bool berry::SmartPointer::operator!= ( const SmartPointer< R > &  r) const
inline

Definition at line 181 of file berrySmartPointer.h.

◆ operator!=() [3/3]

bool berry::SmartPointer::operator!= ( int  r) const
inline

Definition at line 186 of file berrySmartPointer.h.

◆ operator*()

ObjectType& berry::SmartPointer::operator* ( ) const
inline

Definition at line 129 of file berrySmartPointer.h.

◆ operator->()

ObjectType* berry::SmartPointer::operator-> ( ) const
inline

Overload operator ->

Definition at line 118 of file berrySmartPointer.h.

◆ operator<()

template<typename R >
bool berry::SmartPointer::operator< ( const SmartPointer< R > &  r) const
inline

Comparison of pointers. Less than comparison.

Definition at line 216 of file berrySmartPointer.h.

Referenced by berry::SmartPointer< berry::IContributionManagerOverrides >::operator<=().

◆ operator<=()

template<typename R >
bool berry::SmartPointer::operator<= ( const SmartPointer< R > &  r) const
inline

Comparison of pointers. Less than or equal to comparison.

Definition at line 232 of file berrySmartPointer.h.

◆ operator=() [1/3]

SmartPointer& berry::SmartPointer::operator= ( const SmartPointer r)
inline

Overload operator assignment.

Definition at line 245 of file berrySmartPointer.h.

Referenced by berry::SmartPointer< berry::IContributionManagerOverrides >::operator=().

◆ operator=() [2/3]

template<typename R >
SmartPointer& berry::SmartPointer::operator= ( const SmartPointer< R > &  r)
inline

Overload operator assignment.

Definition at line 252 of file berrySmartPointer.h.

◆ operator=() [3/3]

SmartPointer& berry::SmartPointer::operator= ( ObjectType r)
inline

Overload operator assignment.

Definition at line 258 of file berrySmartPointer.h.

◆ operator==() [1/3]

template<typename R >
bool berry::SmartPointer::operator== ( const R *  o) const
inline

◆ operator==() [2/3]

template<typename R >
bool berry::SmartPointer::operator== ( const SmartPointer< R > &  r) const
inline

Definition at line 160 of file berrySmartPointer.h.

◆ operator==() [3/3]

bool berry::SmartPointer::operator== ( int  r) const
inline

Definition at line 166 of file berrySmartPointer.h.

◆ operator>()

template<typename R >
bool berry::SmartPointer::operator> ( const SmartPointer< R > &  r) const
inline

Comparison of pointers. Greater than comparison.

Definition at line 224 of file berrySmartPointer.h.

Referenced by berry::SmartPointer< berry::IContributionManagerOverrides >::operator>=().

◆ operator>=()

template<typename R >
bool berry::SmartPointer::operator>= ( const SmartPointer< R > &  r) const
inline

Comparison of pointers. Greater than or equal to comparison.

Definition at line 239 of file berrySmartPointer.h.

◆ Print()

QDebug berry::SmartPointer::Print ( QDebug  os) const

Function to print object pointed to

Definition at line 371 of file berrySmartPointer.h.


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