cgma
TDUPtr< T > Class Template Reference

#include <TDUPtr.hpp>

Inheritance diagram for TDUPtr< T >:
TDUPtrListNode

List of all members.

Public Member Functions

 TDUPtr ()
 TDUPtr (T *ptr)
 TDUPtr (const TDUPtr< T > &copy)
virtual ~TDUPtr ()
T & operator* () const
T * operator-> () const
 operator bool () const
TDUPtr< T > & operator= (const TDUPtr< T > &copy)
TDUPtr< T > & operator= (T *ptr)
bool operator== (const TDUPtr< T > &other) const
bool operator!= (const TDUPtr< T > &other) const
bool operator== (const T *ptr) const
bool operator!= (const T *ptr) const
void change_ptr (T *ptr)
T * ptr () const

Private Member Functions

virtual void nullify ()

Private Attributes

T * ptrTo

Detailed Description

template<class T>
class TDUPtr< T >

Definition at line 57 of file TDUPtr.hpp.


Constructor & Destructor Documentation

template<class T>
TDUPtr< T >::TDUPtr ( ) [inline]

Definition at line 61 of file TDUPtr.hpp.

: ptrTo(0) {}
template<class T>
TDUPtr< T >::TDUPtr ( T *  ptr) [inline]

Definition at line 63 of file TDUPtr.hpp.

                          : ptrTo(0)
    { change_ptr(ptr); }
template<class T>
TDUPtr< T >::TDUPtr ( const TDUPtr< T > &  copy) [inline]

Definition at line 66 of file TDUPtr.hpp.

                                         : TDUPtrListNode(), ptrTo(0)
    { change_ptr(copy.ptrTo); }
template<class T>
virtual TDUPtr< T >::~TDUPtr ( ) [inline, virtual]

Definition at line 69 of file TDUPtr.hpp.

    { change_ptr(0); }

Member Function Documentation

template<class T >
void TDUPtr< T >::change_ptr ( T *  ptr) [inline]

Definition at line 124 of file TDUPtr.hpp.

{
  if( ptr != ptrTo ) 
  {
    TDPtr::remove_from_TD(this, ptrTo);
    ptrTo = ptr;
    TDPtr::add_to_TD(this, ptrTo);
  }
}
template<class T>
virtual void TDUPtr< T >::nullify ( ) [inline, private, virtual]

Implements TDUPtrListNode.

Definition at line 98 of file TDUPtr.hpp.

    { ptrTo = 0; }
template<class T>
TDUPtr< T >::operator bool ( ) const [inline]

Definition at line 74 of file TDUPtr.hpp.

{ return ptrTo != 0; }
template<class T>
bool TDUPtr< T >::operator!= ( const TDUPtr< T > &  other) const [inline]

Definition at line 84 of file TDUPtr.hpp.

    { return ptrTo != other.ptrTo; }
template<class T>
bool TDUPtr< T >::operator!= ( const T *  ptr) const [inline]

Definition at line 88 of file TDUPtr.hpp.

    { return ptrTo != ptr; }
template<class T>
T& TDUPtr< T >::operator* ( ) const [inline]

Definition at line 72 of file TDUPtr.hpp.

{ return *ptrTo; }
template<class T>
T* TDUPtr< T >::operator-> ( ) const [inline]

Definition at line 73 of file TDUPtr.hpp.

{ return ptrTo; }
template<class T>
TDUPtr<T>& TDUPtr< T >::operator= ( const TDUPtr< T > &  copy) [inline]

Definition at line 76 of file TDUPtr.hpp.

    { change_ptr(copy.ptrTo); return *this; }
template<class T>
TDUPtr<T>& TDUPtr< T >::operator= ( T *  ptr) [inline]

Definition at line 79 of file TDUPtr.hpp.

    { change_ptr(ptr); return *this; }
template<class T>
bool TDUPtr< T >::operator== ( const TDUPtr< T > &  other) const [inline]

Definition at line 82 of file TDUPtr.hpp.

    { return ptrTo == other.ptrTo; }
template<class T>
bool TDUPtr< T >::operator== ( const T *  ptr) const [inline]

Definition at line 86 of file TDUPtr.hpp.

    { return ptrTo == ptr; }
template<class T>
T* TDUPtr< T >::ptr ( ) const [inline]

Definition at line 93 of file TDUPtr.hpp.

    { return ptrTo; }

Member Data Documentation

template<class T>
T* TDUPtr< T >::ptrTo [private]

Definition at line 101 of file TDUPtr.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines