IRC_SERVER
By @hyunjunk (hyunjun2372@gmail.com)
Loading...
Searching...
No Matches
IRCCore::detail::ControlBlock< T > Struct Template Reference

Do not use this class directly. More...

#include <ControlBlock.hpp>

Inheritance diagram for IRCCore::detail::ControlBlock< T >:

Public Member Functions

 ALIGNAS (ALIGNOF(T)) T data
 
 ControlBlock ()
 
 ALIGNAS (ALIGNOF(T)) char data[sizeof(T)]
 
 ControlBlock ()
 
 ~ControlBlock ()
 
- Public Member Functions inherited from IRCCore::FlexibleMemoryPoolingBase< ControlBlock< T > >
void * operator new (size_t size)
 
void * operator new (size_t size, void *ptr)
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, size_t size)
 

Public Attributes

RefCountBase RefCount
 
size_t StrongRefCount
 
size_t WeakRefCount
 
bool bExpired
 
T_Data
 <T> reference of data for debugging watch
 

Detailed Description

template<typename T>
struct IRCCore::detail::ControlBlock< T >

Do not use this class directly.

Use MakeShared function.

We will use placement new/deleteƍ The ControlBlock should not be deleted even after data's destructor is called. ControlBlock is deleted when both StrongRefCount and WeakRefCount are become 0.

Warning
"Never" change the order of RefCount field. This feature is implemented using the c++ standard that the address of the first member in structure is same as the address of the structure itself. (see WeakPtr() implementation)

Use MakeShared function.

We will use placement new/delete The ControlBlock should not be deleted even after data's destructor is called. ControlBlock is deleted when both StrongRefCount and WeakRefCount are become 0.

Warning
"Never" change the order of the data[sizeof(T)] member. This feature is implemented using the c++ standard that the address of the first member in structure is same as the address of the structure itself. (see MakeShared() implementation)

Constructor & Destructor Documentation

◆ ControlBlock() [1/2]

template<typename T >
IRCCore::detail::ControlBlock< T >::ControlBlock ( )
inline

◆ ControlBlock() [2/2]

template<typename T >
IRCCore::detail::ControlBlock< T >::ControlBlock ( )
inline

◆ ~ControlBlock()

Member Function Documentation

◆ ALIGNAS() [1/2]

template<typename T >
IRCCore::detail::ControlBlock< T >::ALIGNAS ( ALIGNOF(T) )

◆ ALIGNAS() [2/2]

template<typename T >
IRCCore::detail::ControlBlock< T >::ALIGNAS ( ALIGNOF(T) )

Member Data Documentation

◆ RefCount

◆ StrongRefCount

template<typename T >
size_t IRCCore::detail::ControlBlock< T >::StrongRefCount

◆ WeakRefCount

template<typename T >
size_t IRCCore::detail::ControlBlock< T >::WeakRefCount

◆ bExpired

template<typename T >
bool IRCCore::detail::ControlBlock< T >::bExpired

◆ _Data

template<typename T >
T& IRCCore::detail::ControlBlock< T >::_Data

<T> reference of data for debugging watch


The documentation for this struct was generated from the following files: