News SF.net Project Frequently Asked Questions Documentation Downloads Mailing Lists How to Contribute

SourceForge.net Logo

Changing the way games are made and played.

TemplateTNL::SafePtr< T > class Reference

TNL::SafePtr< T > Class Template Reference

#include <tnlNetBase.h>

Inheritance diagram for TNL::SafePtr< T >:

TNL::SafeObjectRef

Detailed Description

template<class T>
class TNL::SafePtr< T >

Safe object template pointer class.

Instances of this template class can be used as pointers to instances of Object and its subclasses.

When the object referenced by a SafePtr instance is deleted, the pointer to the object is set to NULL in the SafePtr instance.


Public Member Functions

 SafePtr ()
 SafePtr (T *ptr)
 SafePtr (const SafePtr< T > &ref)
SafePtr< T > & operator= (const SafePtr< T > &ref)
SafePtr< T > & operator= (T *ptr)
bool isNull () const
bool isValid () const
T * operator-> () const
T & operator * () const
 operator T * () const
 operator T * ()
T * getPointer ()


Constructor & Destructor Documentation

template<class T>
TNL::SafePtr< T >::SafePtr  )  [inline]
 

template<class T>
TNL::SafePtr< T >::SafePtr T *  ptr  )  [inline]
 

template<class T>
TNL::SafePtr< T >::SafePtr const SafePtr< T > &  ref  )  [inline]
 


Member Function Documentation

template<class T>
SafePtr<T>& TNL::SafePtr< T >::operator= const SafePtr< T > &  ref  )  [inline]
 

template<class T>
SafePtr<T>& TNL::SafePtr< T >::operator= T *  ptr  )  [inline]
 

template<class T>
bool TNL::SafePtr< T >::isNull  )  const [inline]
 

template<class T>
bool TNL::SafePtr< T >::isValid  )  const [inline]
 

template<class T>
T* TNL::SafePtr< T >::operator->  )  const [inline]
 

template<class T>
T& TNL::SafePtr< T >::operator *  )  const [inline]
 

template<class T>
TNL::SafePtr< T >::operator T *  )  const [inline]
 

template<class T>
TNL::SafePtr< T >::operator T *  )  [inline]
 

template<class T>
T* TNL::SafePtr< T >::getPointer  )  [inline]