Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::WeakAndStrongBase Class Reference

Base class to support WeakPointer and SmartPointer. More...

Inheritance diagram for Burger::WeakAndStrongBase:
Collaboration diagram for Burger::WeakAndStrongBase:

Public Member Functions

ProxyReferenceCounterGetProxyReferenceCounter (void) const noexcept
 Function used by WeakPointer.
 
const Burger::StaticRTTIget_StaticRTTI (void) const noexcept override
 Get the description to the class.
 
- Public Member Functions inherited from Burger::ReferenceCounter
 ReferenceCounter () noexcept
 Sets the reference count to zero.
 
virtual ~ReferenceCounter ()
 Destructor.
 
void AddRef (void) noexcept
 Increase the reference count by 1.
 
void Release (void) noexcept
 Decrease the reference count by 1.
 
- Public Member Functions inherited from Burger::Base
const char * get_class_name (void) const noexcept
 Get the name of the class.
 
virtual ~Base () noexcept=default
 Destructor.
 

Static Public Attributes

static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 
- Static Public Attributes inherited from Burger::ReferenceCounter
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 
- Static Public Attributes inherited from Burger::Base
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 

Private Attributes

WeakPointerAnchor m_WeakPointerAnchor
 Data to track WeakPointer data.
 

Detailed Description

Base class to support WeakPointer and SmartPointer.


Sometimes it's desired to support both weak and smart pointers at the same time. This base class will offer this support. Derive from this class to obtain the functions to easily allow SmartPointer and WeakPointer support.

See also
WeakPointer, SmartPointer and ReferenceCounter

Member Function Documentation

◆ get_StaticRTTI()

const Burger::StaticRTTI * Burger::WeakAndStrongBase::get_StaticRTTI ( void ) const
overridevirtualnoexcept

Get the description to the class.


This virtual function will pull the pointer to the StaticRTTI instance that has the name of the class. Due to it being virtual, it will be the name of the most derived class.

Returns
Pointer to a global, read only instance of StaticRTTI for the true class

Reimplemented from Burger::ReferenceCounter.

◆ GetProxyReferenceCounter()

ProxyReferenceCounter * Burger::WeakAndStrongBase::GetProxyReferenceCounter ( void ) const
inlinenoexcept

Function used by WeakPointer.


This function is inserted by BURGER_ALLOW_WEAK_POINTERS() to give support to WeakPointer

See also
WeakPointer or ProxyReferenceCounter

Member Data Documentation

◆ g_StaticRTTI

const Burger::StaticRTTI Burger::WeakAndStrongBase::g_StaticRTTI
static

The global description of the class.


This record contains the name of this class and a reference to the parent

◆ m_WeakPointerAnchor

WeakPointerAnchor Burger::WeakAndStrongBase::m_WeakPointerAnchor
private

Data to track WeakPointer data.


This data is used by the WeakPointer system to notify other objects that this object was deleted.

See also
WeakPointer, WeakPointerAnchor or GetProxyReferenceCounter(void) const