nObserverPtr< T > Class Template Reference

#include <nObserver.h>

List of all members.

Public Member Functions

 operator bool () const
bool operator! () const
const T * GetPointer () const
 operator const T * () const
const T * operator-> () const
const T * operator * () const
void SetObject (const T *t)
nObserverPtroperator= (const T *t)
 nObserverPtr (const T *t)
 nObserverPtr ()

Private Member Functions

 tCONTROLLED_PTR (nObserver) observer_


Detailed Description

template<class T>
class nObserverPtr< T >

Definition at line 60 of file nObserver.h.


Constructor & Destructor Documentation

template<class T>
nObserverPtr< T >::nObserverPtr ( const T *  t  )  [inline]

Definition at line 131 of file nObserver.h.

00132     {
00133         SetObject( t );
00134     }

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

Definition at line 136 of file nObserver.h.

00137     {
00138     }


Member Function Documentation

template<class T>
nObserverPtr< T >::operator bool (  )  const [inline]

Definition at line 63 of file nObserver.h.

Referenced by nObserverPtr< ePlayerNetID >::operator!().

00064     {
00065 #ifdef DEBUG
00066         nObserver::SetLastChecked( this->observer_ );
00067 #endif
00068 
00069         return ( bool( this->observer_ ) && this->observer_->GetNetObject() );
00070     }

Here is the caller graph for this function:

template<class T>
bool nObserverPtr< T >::operator! (  )  const [inline]

Definition at line 72 of file nObserver.h.

00073     {
00074         return !operator bool();
00075     }

template<class T>
const T* nObserverPtr< T >::GetPointer (  )  const [inline]

Definition at line 77 of file nObserver.h.

Referenced by gEnemyInfluence::AddWall(), gEnemyInfluence::GetEnemy(), and nObserverPtr< T >::operator const T *().

00078     {
00079         if ( this->observer_ )
00080             return dynamic_cast< const T* >( observer_->GetNetObject() );
00081         else
00082             return NULL;
00083     }

Here is the caller graph for this function:

template<class T>
nObserverPtr< T >::operator const T * (  )  const [inline]

Definition at line 85 of file nObserver.h.

References nObserverPtr< T >::GetPointer().

00086     {
00087         return this->GetPointer();
00088     }

Here is the call graph for this function:

template<class T>
const T* nObserverPtr< T >::operator-> (  )  const [inline]

Definition at line 90 of file nObserver.h.

00091     {
00092         const T* t = *this;
00093 
00094 #ifdef DEBUG
00095         //              tASSERT( nObserver::WasChecked( this->observer_ ) );
00096 #endif
00097 
00098         tASSERT(t);
00099 
00100         return t;
00101     }

template<class T>
const T* nObserverPtr< T >::operator * (  )  const [inline]

Definition at line 103 of file nObserver.h.

00104     {
00105         const T* t = *this;
00106 
00107 #ifdef DEBUG
00108         //              tASSERT( nObserver::WasChecked( this->observer_ ) );
00109 #endif
00110 
00111         tASSERT(t);
00112 
00113         return t;
00114     }

template<class T>
void nObserverPtr< T >::SetObject ( const T *  t  )  [inline]

Definition at line 116 of file nObserver.h.

Referenced by nObserverPtr< ePlayerNetID >::nObserverPtr(), and nObserverPtr< ePlayerNetID >::operator=().

00117     {
00118         if ( t == NULL )
00119             observer_ = NULL;
00120         else
00121             observer_ = &t->GetObserver();
00122     }

Here is the caller graph for this function:

template<class T>
nObserverPtr& nObserverPtr< T >::operator= ( const T *  t  )  [inline]

Definition at line 124 of file nObserver.h.

00125     {
00126         SetObject( t );
00127 
00128         return *this;
00129     }

template<class T>
nObserverPtr< T >::tCONTROLLED_PTR ( nObserver   )  [private]


The documentation for this class was generated from the following file:
Generated on Sat Mar 15 23:49:16 2008 for Armagetron Advanced by  doxygen 1.5.4