Code_TYMPAN  4.2.0
Industrial site acoustic simulation
Public Member Functions | Public Attributes | List of all members
SmartPtr< T > Class Template Reference

#include <smartptr.h>

Inheritance diagram for SmartPtr< T >:
Inheritance graph
[legend]
Collaboration diagram for SmartPtr< T >:
Collaboration graph
[legend]

Public Member Functions

 SmartPtr ()
 
 SmartPtr (T *pObj)
 
template<class U >
 SmartPtr (const SmartPtr< U > &ptr)
 
 SmartPtr (const SmartPtr &ptr)
 
 ~SmartPtr ()
 
 operator T* () const
 
T & operator* ()
 
T * operator-> () const
 
template<class U >
SmartPtroperator= (const SmartPtr< U > &ptr)
 
SmartPtroperator= (const SmartPtr &ptr)
 
SmartPtroperator= (T *pObj)
 
bool operator== (const SmartPtr &ptr) const
 
bool operator== (T *pObj) const
 
bool operator!= (const SmartPtr &ptr) const
 
bool operator!= (T *pObj) const
 
bool operator> (const SmartPtr &ptr) const
 
bool operator> (T *pObj) const
 
bool operator< (const SmartPtr &ptr) const
 
bool operator< (T *pObj) const
 
T * getRealPointer ()
 
const T * getRealPointer () const
 

Public Attributes

T * _pObj
 The real pointer, must derived IRefCount. More...
 

Detailed Description

template<class T>
class SmartPtr< T >

This is the smart pointer template. It assumes that the referenced object supports a reference count interface via IRefCount.

Definition at line 101 of file smartptr.h.

Constructor & Destructor Documentation

◆ SmartPtr() [1/4]

template<class T>
SmartPtr< T >::SmartPtr ( )
inline

Definition at line 104 of file smartptr.h.

◆ SmartPtr() [2/4]

template<class T>
SmartPtr< T >::SmartPtr ( T *  pObj)
inline

Definition at line 105 of file smartptr.h.

◆ SmartPtr() [3/4]

template<class T>
template<class U >
SmartPtr< T >::SmartPtr ( const SmartPtr< U > &  ptr)
inline

Copy constructor from an inherited type of T.

Definition at line 116 of file smartptr.h.

◆ SmartPtr() [4/4]

template<class T>
SmartPtr< T >::SmartPtr ( const SmartPtr< T > &  ptr)
inline

Copy constructor.

Definition at line 127 of file smartptr.h.

◆ ~SmartPtr()

template<class T>
SmartPtr< T >::~SmartPtr ( )
inline

Definition at line 136 of file smartptr.h.

Member Function Documentation

◆ getRealPointer() [1/2]

template<class T>
T* SmartPtr< T >::getRealPointer ( )
inline

Gets the real pointer.

Returns
The real pointer.

Definition at line 275 of file smartptr.h.

Here is the caller graph for this function:

◆ getRealPointer() [2/2]

template<class T>
const T* SmartPtr< T >::getRealPointer ( ) const
inline

Gets the real pointer.

Returns
The real pointer.

Definition at line 280 of file smartptr.h.

◆ operator T*()

template<class T>
SmartPtr< T >::operator T* ( ) const
inline

Cast operator.

Definition at line 150 of file smartptr.h.

◆ operator!=() [1/2]

template<class T>
bool SmartPtr< T >::operator!= ( const SmartPtr< T > &  ptr) const
inline

Equality operator with a smart pointer.

Definition at line 228 of file smartptr.h.

◆ operator!=() [2/2]

template<class T>
bool SmartPtr< T >::operator!= ( T *  pObj) const
inline

Equality operator with a real pointer.

Definition at line 236 of file smartptr.h.

◆ operator*()

template<class T>
T& SmartPtr< T >::operator* ( )
inline

Definition at line 151 of file smartptr.h.

◆ operator->()

template<class T>
T* SmartPtr< T >::operator-> ( ) const
inline

Pointer operator.

Definition at line 156 of file smartptr.h.

◆ operator<() [1/2]

template<class T>
bool SmartPtr< T >::operator< ( const SmartPtr< T > &  ptr) const
inline

Comparaison operator with a smart pointer.

Definition at line 259 of file smartptr.h.

◆ operator<() [2/2]

template<class T>
bool SmartPtr< T >::operator< ( T *  pObj) const
inline

Comparaison operator with a real pointer.

Definition at line 266 of file smartptr.h.

◆ operator=() [1/3]

template<class T>
template<class U >
SmartPtr& SmartPtr< T >::operator= ( const SmartPtr< U > &  ptr)
inline

Copy operator from a derived type smart pointer.

Definition at line 161 of file smartptr.h.

◆ operator=() [2/3]

template<class T>
SmartPtr& SmartPtr< T >::operator= ( const SmartPtr< T > &  ptr)
inline

Copy operator from a smart pointer.

Definition at line 184 of file smartptr.h.

◆ operator=() [3/3]

template<class T>
SmartPtr& SmartPtr< T >::operator= ( T *  pObj)
inline

Copy operator from a real pointer.

Definition at line 193 of file smartptr.h.

◆ operator==() [1/2]

template<class T>
bool SmartPtr< T >::operator== ( const SmartPtr< T > &  ptr) const
inline

Equality operator with a smart pointer.

Definition at line 212 of file smartptr.h.

◆ operator==() [2/2]

template<class T>
bool SmartPtr< T >::operator== ( T *  pObj) const
inline

Equality operator with a real pointer.

Definition at line 220 of file smartptr.h.

◆ operator>() [1/2]

template<class T>
bool SmartPtr< T >::operator> ( const SmartPtr< T > &  ptr) const
inline

Comparaison operator with a smart pointer.

Definition at line 244 of file smartptr.h.

◆ operator>() [2/2]

template<class T>
bool SmartPtr< T >::operator> ( T *  pObj) const
inline

Comparaison operator with a real pointer.

Definition at line 251 of file smartptr.h.

Member Data Documentation

◆ _pObj

template<class T>
T* SmartPtr< T >::_pObj

The real pointer, must derived IRefCount.

Definition at line 285 of file smartptr.h.


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