Medical Imaging Interaction Toolkit  2018.04.99-c3229764
Medical Imaging Interaction Toolkit
berry::SmartPointer< TObjectType > Class Template Reference

Implements transparent reference counting. More...

#include <berryICommandCategoryListener.h>

Inheritance diagram for berry::SmartPointer< TObjectType >:

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

template<class TObjectType>
class berry::SmartPointer< TObjectType >

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

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

Definition at line 48 of file berrySmartPointer.h.

◆ Self

template<class TObjectType>
typedef SmartPointer berry::SmartPointer< TObjectType >::Self

Definition at line 49 of file berrySmartPointer.h.

◆ unspecified_bool_type

template<class TObjectType>
typedef ObjectType* Self::* berry::SmartPointer< TObjectType >::unspecified_bool_type

Definition at line 145 of file berrySmartPointer.h.

Constructor & Destructor Documentation

◆ SmartPointer() [1/5]

template<class TObjectType>
berry::SmartPointer< TObjectType >::SmartPointer ( )
inline

Constructor

Definition at line 52 of file berrySmartPointer.h.

Referenced by berry::SmartPointer< berry::MenuManager >::SmartPointer().

◆ SmartPointer() [2/5]

template<class TObjectType>
berry::SmartPointer< TObjectType >::SmartPointer ( ObjectType p)
inlineexplicit

Constructor to pointer p

Definition at line 62 of file berrySmartPointer.h.

◆ SmartPointer() [3/5]

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

Copy constructor

Definition at line 74 of file berrySmartPointer.h.

◆ SmartPointer() [4/5]

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

Definition at line 85 of file berrySmartPointer.h.

◆ SmartPointer() [5/5]

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

Definition at line 352 of file berrySmartPointer.h.

◆ ~SmartPointer()

template<class TObjectType>
berry::SmartPointer< TObjectType >::~SmartPointer ( )
inline

Destructor

Definition at line 100 of file berrySmartPointer.h.

Member Function Documentation

◆ Cast()

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

◆ GetPointer()

template<class TObjectType>
ObjectType* berry::SmartPointer< TObjectType >::GetPointer ( ) const
inline

◆ IsNotNull()

template<class TObjectType>
bool berry::SmartPointer< TObjectType >::IsNotNull ( ) const
inline

Test if the pointer has been initialized

Definition at line 136 of file berrySmartPointer.h.

◆ IsNull()

template<class TObjectType>
bool berry::SmartPointer< TObjectType >::IsNull ( ) const
inline

Definition at line 140 of file berrySmartPointer.h.

◆ operator unspecified_bool_type()

template<class TObjectType>
berry::SmartPointer< TObjectType >::operator unspecified_bool_type ( ) const
inline

Definition at line 147 of file berrySmartPointer.h.

◆ operator!=() [1/3]

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

Definition at line 175 of file berrySmartPointer.h.

◆ operator!=() [2/3]

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

Definition at line 181 of file berrySmartPointer.h.

◆ operator!=() [3/3]

template<class TObjectType>
bool berry::SmartPointer< TObjectType >::operator!= ( int  r) const
inline

Definition at line 186 of file berrySmartPointer.h.

◆ operator*()

template<class TObjectType>
ObjectType& berry::SmartPointer< TObjectType >::operator* ( ) const
inline

Return pointer to object.

Definition at line 129 of file berrySmartPointer.h.

◆ operator->()

template<class TObjectType>
ObjectType* berry::SmartPointer< TObjectType >::operator-> ( ) const
inline

Overload operator ->

Definition at line 118 of file berrySmartPointer.h.

◆ operator<()

template<class TObjectType>
template<typename R >
bool berry::SmartPointer< TObjectType >::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::MenuManager >::operator<=().

◆ operator<=()

template<class TObjectType>
template<typename R >
bool berry::SmartPointer< TObjectType >::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]

template<class TObjectType>
SmartPointer& berry::SmartPointer< TObjectType >::operator= ( const SmartPointer< TObjectType > &  r)
inline

Overload operator assignment.

Definition at line 245 of file berrySmartPointer.h.

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

◆ operator=() [2/3]

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

Overload operator assignment.

Definition at line 252 of file berrySmartPointer.h.

◆ operator=() [3/3]

template<class TObjectType>
SmartPointer& berry::SmartPointer< TObjectType >::operator= ( ObjectType r)
inline

Overload operator assignment.

Definition at line 258 of file berrySmartPointer.h.

◆ operator==() [1/3]

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

◆ operator==() [2/3]

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

Definition at line 160 of file berrySmartPointer.h.

◆ operator==() [3/3]

template<class TObjectType>
bool berry::SmartPointer< TObjectType >::operator== ( int  r) const
inline

Definition at line 166 of file berrySmartPointer.h.

◆ operator>()

template<class TObjectType>
template<typename R >
bool berry::SmartPointer< TObjectType >::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::MenuManager >::operator>=().

◆ operator>=()

template<class TObjectType>
template<typename R >
bool berry::SmartPointer< TObjectType >::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()

template<class T >
QDebug berry::SmartPointer< T >::Print ( QDebug  os) const

Function to print object pointed to

Definition at line 371 of file berrySmartPointer.h.

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


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