A generic reference counter.
More...
#include <B2BITS_ReferenceCounter.h>
|
virtual bool | addRef () const throw () |
| Increments reference counter.
|
|
virtual long | getNRef () const throw () |
| Returns the current value of the reference counter.
|
|
| ReferenceCounter () throw () |
| Constructor.
|
|
virtual long | release () const throw () |
| Decrements reference counter.
|
|
|
long | decrement () const throw () |
| Decrements counter and returns new counter value.
|
|
long | increment () const throw () |
| Increments counter and returns new counter value.
|
|
virtual | ~ReferenceCounter () |
| Destructor.
|
|
A generic reference counter.
◆ ReferenceCounter()
Utils::ReferenceCounter::ReferenceCounter |
( |
| ) |
|
throw | ( | ) | | | |
◆ ~ReferenceCounter()
virtual Utils::ReferenceCounter::~ReferenceCounter |
( |
| ) |
|
|
protectedvirtual |
◆ addRef()
virtual bool Utils::ReferenceCounter::addRef |
( |
| ) |
const |
throw | ( | ) | | | |
|
virtual |
Increments reference counter.
- Returns
- Return value should be ignored.
◆ decrement()
long Utils::ReferenceCounter::decrement |
( |
| ) |
const |
throw | ( | ) | | | |
|
protected |
Decrements counter and returns new counter value.
◆ getNRef()
virtual long Utils::ReferenceCounter::getNRef |
( |
| ) |
const |
throw | ( | ) | | | |
|
virtual |
Returns the current value of the reference counter.
◆ increment()
long Utils::ReferenceCounter::increment |
( |
| ) |
const |
throw | ( | ) | | | |
|
protected |
Increments counter and returns new counter value.
◆ release()
virtual long Utils::ReferenceCounter::release |
( |
| ) |
const |
throw | ( | ) | | | |
|
virtual |
Decrements reference counter.
If it becomes equal to 0 then calls destructor.
- Returns
- 0 if there are no more references to this object; otherwise any positive value.