Gecode::Support::RefCount Class Reference
A class for thread-safe reference counting. More...
#include <gecode/support/ref-count.hpp>
Public Member Functions | |
| RefCount (unsigned long int n) | |
| Initialize. | |
| void | inc (void) |
| Increment counter. | |
| bool | dec (void) |
| Decrement counter and return true if it hits zero. | |
| operator bool (void) const | |
| Test whether reference count is non-zero. | |
Protected Attributes | |
| std::atomic_ulong | n |
| The reference count. | |
Detailed Description
A class for thread-safe reference counting.
Definition at line 39 of file ref-count.hpp.
Constructor & Destructor Documentation
◆ RefCount()
|
inline |
Initialize.
Definition at line 55 of file ref-count.hpp.
Member Function Documentation
◆ inc()
|
inline |
Increment counter.
Definition at line 59 of file ref-count.hpp.
◆ dec()
|
inline |
Decrement counter and return true if it hits zero.
Definition at line 63 of file ref-count.hpp.
◆ operator bool()
|
inline |
Test whether reference count is non-zero.
Definition at line 67 of file ref-count.hpp.
Member Data Documentation
◆ n
|
protected |
The reference count.
Definition at line 42 of file ref-count.hpp.
The documentation for this class was generated from the following file:
- gecode/support/ref-count.hpp
