![]() |
Public API Reference |
![]() |
This is a class which provides basic atomic reference-counting semantics. More...
#include <csutil/refcount.h>
Inherited by CS::Threading::ThreadedJobQueue::ThreadState.
Public Member Functions | |
void | DecRef () |
Decrease the number of references to this object. | |
int | GetRefCount () const |
Get the reference count (only for debugging). | |
void | IncRef () |
Increase the number of references to this object. | |
AtomicRefCount () | |
Initialize object and set reference to 1. | |
AtomicRefCount (const AtomicRefCount &other) | |
Initialize object and set reference to 1. |
This is a class which provides basic atomic reference-counting semantics.
It behaves like csRefCount, with the difference that the reference count is increased/decreased atomically, making this class suitable for using reference-counted objects across threads.
Definition at line 203 of file refcount.h.
CS::Utility::AtomicRefCount::AtomicRefCount | ( | ) | [inline] |
Initialize object and set reference to 1.
Definition at line 225 of file refcount.h.
CS::Utility::AtomicRefCount::AtomicRefCount | ( | const AtomicRefCount & | other | ) | [inline] |
Initialize object and set reference to 1.
Definition at line 229 of file refcount.h.
void CS::Utility::AtomicRefCount::DecRef | ( | ) | [inline] |
Decrease the number of references to this object.
Definition at line 242 of file refcount.h.
int CS::Utility::AtomicRefCount::GetRefCount | ( | ) | const [inline] |
Get the reference count (only for debugging).
Definition at line 249 of file refcount.h.
void CS::Utility::AtomicRefCount::IncRef | ( | ) | [inline] |
Increase the number of references to this object.
Definition at line 236 of file refcount.h.