|
The Vish Visualization Shell 0.3
Vish
|
Base class for thread-safe reference counting. More...
#include <elementary/memcore/ReferenceCount.hpp>
Public Member Functions | |
| bool | canIncrementStrongRefsEvenMore () const noexcept |
| The "extreme unction" state is when a pointer is determined to die sure, and this state is set by the suicide() function. | |
| refcount_t | get_pointers () const noexcept |
| Return the weak reference count, i.e. | |
| refcount_t | get_refs () const noexcept |
| Return the strong reference count, i.e. | |
| refcount_t | weak_refcount () const noexcept |
| Return the weak reference count, i.e. | |
Static Public Attributes | |
| static constexpr refcount_t | dead_object_refcount = -111L |
| Some unrealistically large value that is used during premature destruction of objects to indicate that they are still alive even though they will be killed soon after. | |
| static constexpr refcount_t | max_object_refcount = 0x39000000L |
| Maximum value that a reference count can reach before it overflows. | |
| static constexpr refcount_t | null_referencer = -222L |
| Magic number to indicate that a reference refers to a non-existent reference, i.e. | |
Protected Member Functions | |
| ReferenceCount () noexcept | |
| Initialize reference counts to zero. | |
Protected Attributes | |
| interlocked_t | strong_refs |
| Strong references. | |
| interlocked_t | weak_refs |
| Weak references. | |
Base class for thread-safe reference counting.
|
inlinenoexcept |
The "extreme unction" state is when a pointer is determined to die sure, and this state is set by the suicide() function.
In that state a reference pointer can still be incremented and decremented, but it is prone to die soonish.
|
inlinenoexcept |
Return the weak reference count, i.e.
how many pointers refer to this object.
|
inlinenoexcept |
Return the strong reference count, i.e.
how many object keep this object alive.
|
inlinenoexcept |
Return the weak reference count, i.e.
how many pointers refer to this object.
|
staticconstexpr |
Some unrealistically large value that is used during premature destruction of objects to indicate that they are still alive even though they will be killed soon after.
Objects with such a strong reference count value pretty much dead. Magic number to indicate that a reference refers to an object that has already died.
|
staticconstexpr |
Maximum value that a reference count can reach before it overflows.
Theoretically, this value is like the max number of bits, but here we set it to some smaller, arbitrarily chosen value for debugging purposes. It should still never be reached.
|
staticconstexpr |
Magic number to indicate that a reference refers to a non-existent reference, i.e.
the weakptr does not have a control block to oeprate on.
Referenced by MemCore::DynPtr< ObjectBase, ObjectBase >::strong_refs(), and MemCore::DynPtr< ObjectBase, ObjectBase >::weak_refs().