NewNet::BasePtr< T > Class Template Reference

Base class for wrapped pointers. More...

#include <nnbaseptr.h>

Inheritance diagram for NewNet::BasePtr< T >:

NewNet::RefPtr< T > NewNet::WeakRefPtr< T > List of all members.

Public Member Functions

 BasePtr ()
 Create a new BasePtr.
 BasePtr (T *t)
 Create a new initialized BasePtr.
T * ptr () const
 Return the pointer.
 operator T * () const
 Cast operator to T *.
T & operator * ()
 Dereferencing operator to T &.
const T & operator * () const
 Dereferencing operator to const T &.
T * operator-> ()
 Dereferencing operator to T *.
const T * operator-> () const
 Dereferencing operator to const T *.
bool isValid () const
 Determine wether the pointer is valid (not NULL).
bool operator! () const
 Check if the pointer is NULL.

Protected Attributes

T * m_Ptr
 The pointer value.

Detailed Description

template<class T>
class NewNet::BasePtr< T >

This is a base wrapper class for pointers. This class is pretty useless when used directly, subclass it or use RefPtr or WeakRefPtr instead.

Definition at line 43 of file nnbaseptr.h.


Constructor & Destructor Documentation

template<class T>
NewNet::BasePtr< T >::BasePtr (  )  [inline]

Create a new BasePtr. The pointer always points at NULL.

Definition at line 48 of file nnbaseptr.h.

template<class T>
NewNet::BasePtr< T >::BasePtr ( T *  t  )  [inline]

Create a new BasePtr. The pointer will point at T * t.

Definition at line 54 of file nnbaseptr.h.


Member Function Documentation

template<class T>
T* NewNet::BasePtr< T >::ptr (  )  const [inline]

Return the pointer.

Definition at line 60 of file nnbaseptr.h.

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

This provides a cast operator to T *.

Definition at line 67 of file nnbaseptr.h.

References NewNet::BasePtr< T >::m_Ptr.

template<class T>
T& NewNet::BasePtr< T >::operator * (  )  [inline]

This provides a dereferencing operator to T &. Dereferencing a NULL pointer is checked if compiled with -DNN_PTR_DEBUG.

Definition at line 75 of file nnbaseptr.h.

template<class T>
const T& NewNet::BasePtr< T >::operator * (  )  const [inline]

This provides a dereferencing operator to const T &. Dereferencing a NULL pointer is checked if compiled with -DNN_PTR_DEBUG.

Definition at line 84 of file nnbaseptr.h.

template<class T>
T* NewNet::BasePtr< T >::operator-> (  )  [inline]

This provides a dereferencing operator to T *. Dereferencing a NULL pointer is checked if compiled with -DNN_PTR_DEBUG.

Definition at line 93 of file nnbaseptr.h.

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

This provides a dereferencing operator to const T *. Dereferencing a NULL pointer is checked if compiled with -DNN_PTR_DEBUG.

Definition at line 102 of file nnbaseptr.h.

template<class T>
bool NewNet::BasePtr< T >::isValid (  )  const [inline]

Return true if the pointer is not NULL.

Definition at line 110 of file nnbaseptr.h.

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

Returns true if the pointer is NULL.

Definition at line 117 of file nnbaseptr.h.


Member Data Documentation

template<class T>
T* NewNet::BasePtr< T >::m_Ptr [protected]

Provides the current pointer value.

Definition at line 125 of file nnbaseptr.h.

Referenced by NewNet::BasePtr< NewNet::Event::Callback >::isValid(), NewNet::BasePtr< NewNet::Event::Callback >::operator *(), NewNet::BasePtr< T >::operator T *(), NewNet::BasePtr< NewNet::Event::Callback >::operator!(), NewNet::BasePtr< NewNet::Event::Callback >::operator->(), NewNet::WeakRefPtr< T >::operator=(), NewNet::RefPtr< NewNet::Event::Callback >::operator=(), NewNet::BasePtr< NewNet::Event::Callback >::ptr(), NewNet::RefPtr< NewNet::Event::Callback >::RefPtr(), and NewNet::WeakRefPtr< T >::WeakRefPtr().


The documentation for this class was generated from the following file:
Generated on Sun Jan 7 14:00:01 2007 for NewNet by  doxygen 1.5.1