arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

gutz::SmartPtrRef< T > Class Template Reference

#include <smartptr.h>

List of all members.


Detailed Description

template<class T>
class gutz::SmartPtrRef< T >

Smart Pointer Reference class, behaves like a reference to a pointer.

This class can be used for clean double indirection of objects, ie. when an object changes all those with one of these objects referencing it will see the changes. Great for volitle pointers.

Definition at line 316 of file smartptr.h.

get the contained pointer

T * getPtr ()
T const * getPtr () const

assign smart pointer, remember this is

a reference to a pointer, not a pointer.

SmartPtrRefoperator= (const SmartPtrRef &sp)
T * operator= (T *ptr)

access members of T

ex.

T->myFunction()

T * operator-> ()
T const * operator-> () const

De-reference like a regular pointer

ex (*mySmartPRef).myFunction()

T & operator * ()
T const & operator * () const

utilities, comparison ops

just like raw ptrs, if(T != 0)...

if(T == NULL)

bool operator! () const
bool operator== (const T *ptr) const
bool operator== (const SmartPtrRef &sp) const
bool operator!= (const T *ptr) const
bool operator!= (const SmartPtrRef &sp) const
bool operator< (const SmartPtrRef &sp) const
 these may or maynot be what you want! be carefull

bool operator<= (const SmartPtrRef &sp) const
bool operator> (const SmartPtrRef &sp) const
bool operator>= (const SmartPtrRef &sp) const

Public Types

typedef SmartPtr< T > type

Public Member Functions

 SmartPtrRef ()
 SmartPtrRef (T *ptr)
 SmartPtrRef (const SmartPtrRef &dsp)
 SmartPtrRef (SmartPtr< T > *sp)
virtual ~SmartPtrRef ()
 operator T * ()
 Implicit conversion to T* (for function calls).

bool isNull () const
 for convienence since if(mySP) is always true, use if(!myPtr.isNull())...


Protected Member Functions

void assign (type *ref)

Protected Attributes

type_ref
 Private from here down.


Member Typedef Documentation

template<class T>
typedef SmartPtr<T> gutz::SmartPtrRef< T >::type
 

Definition at line 318 of file smartptr.h.

Referenced by gutz::SmartPtrRef< TFElement >::assign(), gutz::SmartPtrRef< TFElement >::SmartPtrRef(), and gutz::SmartPtrRef< TFElement >::~SmartPtrRef().


Constructor & Destructor Documentation

template<class T>
gutz::SmartPtrRef< T >::SmartPtrRef  )  [inline]
 

Definition at line 320 of file smartptr.h.

template<class T>
gutz::SmartPtrRef< T >::SmartPtrRef T *  ptr  )  [inline]
 

Definition at line 321 of file smartptr.h.

template<class T>
gutz::SmartPtrRef< T >::SmartPtrRef const SmartPtrRef< T > &  dsp  )  [inline]
 

Definition at line 322 of file smartptr.h.

template<class T>
gutz::SmartPtrRef< T >::SmartPtrRef SmartPtr< T > *  sp  )  [inline]
 

Definition at line 323 of file smartptr.h.

template<class T>
virtual gutz::SmartPtrRef< T >::~SmartPtrRef  )  [inline, virtual]
 

Definition at line 324 of file smartptr.h.


Member Function Documentation

template<class T>
void gutz::SmartPtrRef< T >::assign type ref  )  [inline, protected]
 

add a reference to the new guy

deleting the old guy

just a dec most of the time

but if we are the last reference, nuke it

Definition at line 387 of file smartptr.h.

Referenced by gutz::SmartPtrRef< TFElement >::SmartPtrRef(), and gutz::SmartPtrRef< TFElement >::~SmartPtrRef().

template<class T>
T const* gutz::SmartPtrRef< T >::getPtr  )  const [inline]
 

Definition at line 330 of file smartptr.h.

template<class T>
T* gutz::SmartPtrRef< T >::getPtr  )  [inline]
 

Definition at line 329 of file smartptr.h.

Referenced by gutz::SmartPtrRef< TFElement >::isNull(), gutz::SmartPtrRef< TFElement >::operator *(), gutz::SmartPtrRef< TFElement >::operator!(), gutz::SmartPtrRef< TFElement >::operator!=(), gutz::SmartPtrRef< TFElement >::operator->(), gutz::SmartPtrRef< TFElement >::operator<(), gutz::SmartPtrRef< TFElement >::operator<=(), gutz::SmartPtrRef< TFElement >::operator==(), gutz::SmartPtrRef< TFElement >::operator>(), and gutz::SmartPtrRef< TFElement >::operator>=().

template<class T>
bool gutz::SmartPtrRef< T >::isNull  )  const [inline]
 

for convienence since if(mySP) is always true, use if(!myPtr.isNull())...

Definition at line 380 of file smartptr.h.

template<class T>
T const& gutz::SmartPtrRef< T >::operator *  )  const [inline]
 

Definition at line 355 of file smartptr.h.

template<class T>
T& gutz::SmartPtrRef< T >::operator *  )  [inline]
 

Definition at line 354 of file smartptr.h.

template<class T>
gutz::SmartPtrRef< T >::operator T *  )  [inline]
 

Implicit conversion to T* (for function calls).

Definition at line 360 of file smartptr.h.

template<class T>
bool gutz::SmartPtrRef< T >::operator!  )  const [inline]
 

Definition at line 367 of file smartptr.h.

template<class T>
bool gutz::SmartPtrRef< T >::operator!= const SmartPtrRef< T > &  sp  )  const [inline]
 

Definition at line 371 of file smartptr.h.

template<class T>
bool gutz::SmartPtrRef< T >::operator!= const T *  ptr  )  const [inline]
 

Definition at line 370 of file smartptr.h.

template<class T>
T const* gutz::SmartPtrRef< T >::operator->  )  const [inline]
 

Definition at line 347 of file smartptr.h.

template<class T>
T* gutz::SmartPtrRef< T >::operator->  )  [inline]
 

Definition at line 346 of file smartptr.h.

template<class T>
bool gutz::SmartPtrRef< T >::operator< const SmartPtrRef< T > &  sp  )  const [inline]
 

these may or maynot be what you want! be carefull

Definition at line 373 of file smartptr.h.

template<class T>
bool gutz::SmartPtrRef< T >::operator<= const SmartPtrRef< T > &  sp  )  const [inline]
 

Definition at line 374 of file smartptr.h.

template<class T>
T* gutz::SmartPtrRef< T >::operator= T *  ptr  )  [inline]
 

Definition at line 339 of file smartptr.h.

template<class T>
SmartPtrRef& gutz::SmartPtrRef< T >::operator= const SmartPtrRef< T > &  sp  )  [inline]
 

Definition at line 337 of file smartptr.h.

template<class T>
bool gutz::SmartPtrRef< T >::operator== const SmartPtrRef< T > &  sp  )  const [inline]
 

Definition at line 369 of file smartptr.h.

template<class T>
bool gutz::SmartPtrRef< T >::operator== const T *  ptr  )  const [inline]
 

Definition at line 368 of file smartptr.h.

template<class T>
bool gutz::SmartPtrRef< T >::operator> const SmartPtrRef< T > &  sp  )  const [inline]
 

Definition at line 375 of file smartptr.h.

template<class T>
bool gutz::SmartPtrRef< T >::operator>= const SmartPtrRef< T > &  sp  )  const [inline]
 

Definition at line 376 of file smartptr.h.


Member Data Documentation

template<class T>
type* gutz::SmartPtrRef< T >::_ref [protected]
 

Private from here down.

Definition at line 385 of file smartptr.h.

Referenced by gutz::SmartPtrRef< TFElement >::assign(), gutz::SmartPtrRef< TFElement >::getPtr(), gutz::SmartPtrRef< TFElement >::operator T *(), gutz::SmartPtrRef< TFElement >::operator=(), and gutz::SmartPtrRef< TFElement >::SmartPtrRef().


The documentation for this class was generated from the following file:
Send questions, comments, and bug reports to:
jmk