#include <tSafePTR.h>
Public Member Functions | |
tReferencable () | |
tReferencable (const tReferencable &) | |
tReferencable & | operator= (const tReferencable &) |
void | AddRef () const |
void | Release () const |
int | GetRefcount () const |
Protected Member Functions | |
~tReferencable () | |
Private Attributes | |
int | refCtr_ |
MUTEX | mutex_ |
Friends | |
class | tStackObject< T > |
Definition at line 431 of file tSafePTR.h.
tReferencable< T, MUTEX >::tReferencable | ( | ) | [inline] |
tReferencable< T, MUTEX >::tReferencable | ( | const tReferencable< T, MUTEX > & | ) | [inline] |
tReferencable< T, MUTEX >::~tReferencable | ( | ) | [inline, protected] |
tReferencable& tReferencable< T, MUTEX >::operator= | ( | const tReferencable< T, MUTEX > & | ) | [inline] |
void tReferencable< T, MUTEX >::AddRef | ( | void | ) | const [inline] |
Definition at line 440 of file tSafePTR.h.
Referenced by eReferencableGameObject::AddRef().
00441 { 00442 #ifdef DEBUG 00443 st_AddRefBreakpint( this ); 00444 #endif 00445 tASSERT( this && refCtr_ >= 0 ); 00446 mutex_.acquire(); 00447 ++refCtr_; 00448 mutex_.release(); 00449 tASSERT( this && refCtr_ >= 0 ); 00450 }
void tReferencable< T, MUTEX >::Release | ( | ) | const [inline] |
Definition at line 452 of file tSafePTR.h.
Referenced by eReferencableGameObject::Release().
00453 { 00454 #ifdef DEBUG 00455 st_ReleaseBreakpint( this ); 00456 #endif 00457 00458 tASSERT ( this && refCtr_ >= 0 ); 00459 mutex_.acquire(); 00460 --refCtr_; 00461 mutex_.release(); 00462 00463 if ( refCtr_ <= 0 ) 00464 { 00465 refCtr_ = -1000; 00466 delete static_cast< const T* >( this ); 00467 } 00468 }
int tReferencable< T, MUTEX >::GetRefcount | ( | ) | const [inline] |
Definition at line 470 of file tSafePTR.h.
Referenced by eGrid::display_simple().
friend class tStackObject< T > [friend] |
Definition at line 433 of file tSafePTR.h.
int tReferencable< T, MUTEX >::refCtr_ [mutable, private] |
Definition at line 482 of file tSafePTR.h.
Referenced by tReferencable< eWall >::AddRef(), tReferencable< eWall >::GetRefcount(), tReferencable< eWall >::Release(), and tReferencable< eWall >::~tReferencable().
MUTEX tReferencable< T, MUTEX >::mutex_ [mutable, private] |
Definition at line 483 of file tSafePTR.h.
Referenced by tReferencable< eWall >::AddRef(), and tReferencable< eWall >::Release().