Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
Public Types | Public Member Functions | List of all members
igtl::SmartPointer< TObjectType > Class Template Reference

#include <igtlSmartPointer.h>

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

Public Types

typedef TObjectType ObjectType
 

Public Member Functions

ObjectTypeGetPointer () const
 
 operator ObjectType * () const
 
template<typename R >
bool operator!= (R r) const
 
ObjectTypeoperator-> () const
 
bool operator< (const SmartPointer &r) const
 
bool operator<= (const SmartPointer &r) const
 
SmartPointeroperator= (const SmartPointer &r)
 
template<typename R >
bool operator== (R 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
 
SmartPointeroperator= (ObjectType *r)
 
ObjectTypePrint (std::ostream &os) const
 

Detailed Description

template<class TObjectType>
class igtl::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; ..exe linux: c++ SmartPointerTest.cxx ./a.out other: CCcompiler SmartPointerTest.cxx ./a.out

Definition at line 56 of file igtlSmartPointer.h.

Member Typedef Documentation

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

Definition at line 59 of file igtlSmartPointer.h.

Constructor & Destructor Documentation

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

Constructor

Definition at line 62 of file igtlSmartPointer.h.

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

Copy constructor

Definition at line 66 of file igtlSmartPointer.h.

template<class TObjectType>
igtl::SmartPointer< TObjectType >::SmartPointer ( ObjectType p)
inline

Constructor to pointer p

Definition at line 71 of file igtlSmartPointer.h.

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

Destructor

Definition at line 76 of file igtlSmartPointer.h.

Member Function Documentation

template<class TObjectType>
ObjectType* igtl::SmartPointer< TObjectType >::GetPointer ( ) const
inline
template<class TObjectType>
bool igtl::SmartPointer< TObjectType >::IsNotNull ( ) const
inline

Test if the pointer has been initialized

Definition at line 92 of file igtlSmartPointer.h.

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

Test if the pointer has been initialized

Definition at line 94 of file igtlSmartPointer.h.

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

Return pointer to object.

Definition at line 88 of file igtlSmartPointer.h.

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

Definition at line 104 of file igtlSmartPointer.h.

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

Overload operator ->

Definition at line 84 of file igtlSmartPointer.h.

template<class TObjectType>
bool igtl::SmartPointer< TObjectType >::operator< ( const SmartPointer< TObjectType > &  r) const
inline

Comparison of pointers. Less than comparison.

Definition at line 112 of file igtlSmartPointer.h.

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

Comparison of pointers. Less than or equal to comparison.

Definition at line 120 of file igtlSmartPointer.h.

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

Overload operator assignment.

Definition at line 128 of file igtlSmartPointer.h.

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

Overload operator assignment.

Definition at line 132 of file igtlSmartPointer.h.

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

Template comparison operators.

Definition at line 100 of file igtlSmartPointer.h.

template<class TObjectType>
bool igtl::SmartPointer< TObjectType >::operator> ( const SmartPointer< TObjectType > &  r) const
inline

Comparison of pointers. Greater than comparison.

Definition at line 116 of file igtlSmartPointer.h.

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

Comparison of pointers. Greater than or equal to comparison.

Definition at line 124 of file igtlSmartPointer.h.

template<class TObjectType>
ObjectType* igtl::SmartPointer< TObjectType >::Print ( std::ostream &  os) const
inline

Function to print object pointed to

Definition at line 146 of file igtlSmartPointer.h.


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

Generated at Wed Dec 4 2013 11:11:32 for OpenIGTLink by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2012