#include <RefCounted.h>
Public Member Functions | |
RefCounted () | |
RefCounted (const RefCounted &) | |
~RefCounted () | |
bool | isShared () const |
void | addReference () |
void | removeReference () |
bool | removeRefAndCheckGarbage () |
void | lock () const |
void | unlock () const |
int | count () const |
int | countUnlocked () const |
It encapsulates the count and provides an interface for manipulating and checking the count.
When running in a threaded environment, RefCounted protects the reference count with a mutex, so this class is thread safe.
RefCounted::RefCounted | ( | ) | [inline] |
RefCounted::RefCounted | ( | const RefCounted & | ) | [inline] |
RefCounted::~RefCounted | ( | ) | [inline] |
bool RefCounted::isShared | ( | ) | const [inline] |
References Pooma::DummyMutex::lock(), and Pooma::DummyMutex::unlock().
void RefCounted::addReference | ( | ) | [inline] |
References Pooma::DummyMutex::lock(), and Pooma::DummyMutex::unlock().
void RefCounted::removeReference | ( | ) | [inline] |
References Pooma::DummyMutex::lock(), PAssert, and Pooma::DummyMutex::unlock().
bool RefCounted::removeRefAndCheckGarbage | ( | ) | [inline] |
References Pooma::DummyMutex::lock(), PAssert, and Pooma::DummyMutex::unlock().
void RefCounted::lock | ( | ) | const [inline] |
References Pooma::DummyMutex::lock().
void RefCounted::unlock | ( | ) | const [inline] |
References Pooma::DummyMutex::unlock().
int RefCounted::count | ( | ) | const [inline] |
References Pooma::DummyMutex::lock(), and Pooma::DummyMutex::unlock().
Referenced by SparseTileLayoutViewData< Dim, Dim2 >::computeSubdomains(), DynamicLayoutViewData::computeSubdomains(), SparseTileLayoutViewData< Dim, Dim2 >::touches(), DynamicLayoutViewData::touches(), and DynamicLayoutData::touches().
int RefCounted::countUnlocked | ( | ) | const [inline] |