Class to track an object that can be deleted at any time. More...
Public Member Functions | |
uint_t | IsParentAlive (void) const noexcept |
Return TRUE if the parent still exists. | |
void | ParentIsDead (void) noexcept |
Send a signal that the parent was deleted. | |
void | AddRef (void) noexcept |
Increase the reference count by 1. | |
void | Release (void) noexcept |
Decrease the reference count by 1. | |
Static Public Member Functions | |
static ProxyReferenceCounter * | New (void) noexcept |
Allocate a ProxyReferenceCounter using the global memory manager. | |
Private Member Functions | |
ProxyReferenceCounter (const ProxyReferenceCounter &)=delete | |
ProxyReferenceCounter & | operator= (const ProxyReferenceCounter &)=delete |
ProxyReferenceCounter (ProxyReferenceCounter &&)=delete | |
ProxyReferenceCounter & | operator= (ProxyReferenceCounter &&)=delete |
ProxyReferenceCounter () noexcept | |
Private default constructor. | |
Private Attributes | |
uint_t | m_uRefCount |
Number of weak pointers that are using this object as an anchor. | |
uint_t | m_bParentAlive |
TRUE if the parent object was deleted | |
Class to track an object that can be deleted at any time.
When using a WeakPointer, it needs to be able to keep track of an object's status in case the object is deleted. To handle this, a reference counted object will create an independently allocated object in which all weak pointers will reference count so if the parent object is deleted, this object will remain to notify all the other systems that the object is no more. When all the WeakPointer have been notified of the parent's deletion, the proxy will be disposed of.
This class is not meant to be used as a stand alone class, it's meant to be created by ReferenceCounter objects when a WeakPointer object is requesting a connection.
|
privatedelete |
|
privatedelete |
|
inlineprivatenoexcept |
Private default constructor.
Sets the default values on construction. This can't be called by applications. Use Burger::ProxyReferenceCounter::New() instead.
|
inlinenoexcept |
|
inlinenoexcept |
Return TRUE if the parent still exists.
When this class is created, this flag is set to TRUE. Once the parent is deleted, it will clear this flag so all WeakPointer class instances will know that the parent object is no more.
|
staticnoexcept |
Allocate a ProxyReferenceCounter using the global memory manager.
Using the GlobalMemoryManager, allocate an instance of this class and return the pointer.
|
privatedelete |
|
privatedelete |
|
inlinenoexcept |
Send a signal that the parent was deleted.
This function should only be called by the parent object when the parent object's destructor is called. The ProxyReferenceCounter will be signaled and all WeakPointer object that reference it will be able to know that the parent is gone.
|
inlinenoexcept |
|
private |
Number of weak pointers that are using this object as an anchor.