|
The Vish Visualization Shell 0.3
Vish
|
Base class for objects which do reference counting. More...
#include <elementary/memcore/RefPtr.hpp>
Public Types | |
| using | reference_domain_t = Object |
| The type of the base class. | |
| using | SelfPtr_t = WeakPtr< Object, Object > |
| Type for a pointer to this object itself. | |
Public Member Functions | |
| auto | getObjectCountID () const noexcept |
| Get a unique ID for this object in the given domain. | |
| bool | isIdentical (const WeakPtr< Object, Object > &PossibleSelf) const noexcept |
| Check if this object is identical to the one used by the given pointer. | |
| void | mkAutoDestructive () |
| Marks this object as being automatically destructed, e.g. | |
| refcount_t | refcount () const noexcept |
| The strong reference count. | |
| ReferenceBase (Object *that) noexcept | |
| Constructor, initializes reference counter to zero. | |
| const auto & | self () const |
| Return weak pointer to the object self. | |
| refcount_t | wrefcount () const noexcept |
| The weak reference count. | |
Protected Member Functions | |
| virtual void | extremeUnction () |
| A virtual function that will be called just before the object is destroyed. | |
| ReferenceBase & | operator= (const ReferenceBase &R) |
| Protected assignment operator (should not be called). | |
| void | suicide () |
| Delete this. | |
| virtual | ~ReferenceBase () |
| Virtual destructor. | |
Base class for objects which do reference counting.
Contains a reference counter, to be used with the RefPtr<> template.
|
inlineprotectedvirtual |
A virtual function that will be called just before the object is destroyed.
It will be called while the reference count is just zero, thus reference pointers are still (barely!) valid to this object. An implementation of this function is like a virtual destructor with yet intact reference pointers, whereas in a virtual destructor all reference pointers have already been invalidated. Consequently, the object itself is still valid when this function is called, but it will no longer be considered valid once the destructor is called.
Reimplemented in A< Object >, A< Object >, A< Object >, and A< Object >.
|
inlinenoexcept |
Get a unique ID for this object in the given domain.
Each ReferenceBase gets a unique such number. This object count ID serves like a unique pointer to each object, but moreover is unique for the object even if another one was living at the same memory address some time before.
Referenced by MemCore::CacheQueue::list_info().
|
inline |
Marks this object as being automatically destructed, e.g.
it is a static or automatic variable, or it is deleted explicetly. This call increments the strong reference count, such that its lifetime is preserved over all strong pointers referring to this object.
This function is identical to calling self().ref(). The effect can be reversed by calling self().unref(), which might destroy the object in charge if no other strong pointer refers to this object. In general, there is no need to call the unref() function. Its only purpose where to keep the object alive temporarily with no strong pointer referring to it; usually, it should be simpler to just introduce a strong pointer. On the other hand, the ref() call makes sense for automatic or static objects, where "the system" holds a (not-strong) pointer to the object.
|
inlineprotected |
Protected assignment operator (should not be called).
Leaves references untouched. We may assume that some child data are copied from the other reference object, but that the references to this object by itself are unchanged, i.e. just the data change due to the assigment operation, but not the references.
|
inline |
Return weak pointer to the object self.
Same functionality as the address operator, but better ;-).
Referenced by MemCore::CacheQueue::adjust(), MemCore::StrongPtr< Object, ObjectBase >::assignStrong(), Wizt::Seagrass::computeAnemonesMemory(), Wizt::GLColormap::Enable(), A< Object >::extremeUnction(), Wizt::Seagrass::getCachedAnemonesMemory(), Wizt::Seagrass::getNumberOfAnemones(), Wizt::VValue< Type >::getValueCreator(), Wizt::VSlot::getVObjectPtr(), Wizt::VValueBase::operator!=(), Wizt::VValueBase::operator==(), MemCore::CacheQueue::purge(), and Wizt::GLProgram::setAllUniforms().