ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
SharedPtr< T, TAllocator >::FieldMembers< U > Struct Template Reference

Description:

template<typename T, typename TAllocator = HeapAllocator>
template<typename U>
struct alib::containers::SharedPtr< T, TAllocator >::FieldMembers< U >

The combined struct of members which are from the TAllocator passed in the constructor. Note, that in the case that HeapAllocator is used parent class AllocatorMember will be empty.

Definition at line 69 of file sharedptr.hpp.

#include <sharedptr.hpp>

Inheritance diagram for SharedPtr< T, TAllocator >::FieldMembers< U >:
[legend]
Collaboration diagram for SharedPtr< T, TAllocator >::FieldMembers< U >:
[legend]

Public Field Index:

size_t allocSize
 The size of the allocated pair of these fields and the custom type.
 
T * custom
 The duly cast pointer to the custom type behind us.
 
std::atomic< unsigned int > refCount
 The reference counter used to implement the std::shared_ptr behavior.
 
u
 The instance, either derived or T.
 

Public Method Index:

 FieldMembers (T *pCustom, size_t pAllocSize)
 
 FieldMembers (TAllocator &pAllocator, T *pCustom, size_t pAllocSize)
 
- Public Method Index: inherited from AllocatorMember< TAllocator >
 AllocatorMember ()=delete
 Deleted default constructor. (The allocator has to be given with construction)
 
 AllocatorMember (TAllocator &pAllocator) noexcept
 
AllocatorInterface< TAllocator > AI () const noexcept
 
TAllocator & GetAllocator () const noexcept
 

Additional Inherited Members

- Public Type Index: inherited from AllocatorMember< TAllocator >
using AllocatorType = TAllocator
 Exposes the allocator type.
 
- Protected Field Index: inherited from AllocatorMember< TAllocator >
TAllocator & allocator
 A reference to the allocator.
 

Field Details:

◆ allocSize

template<typename T , typename TAllocator = HeapAllocator>
template<typename U >
size_t allocSize

The size of the allocated pair of these fields and the custom type.

Definition at line 75 of file sharedptr.hpp.

◆ custom

template<typename T , typename TAllocator = HeapAllocator>
template<typename U >
T* custom

The duly cast pointer to the custom type behind us.

Definition at line 72 of file sharedptr.hpp.

◆ refCount

template<typename T , typename TAllocator = HeapAllocator>
template<typename U >
std::atomic<unsigned int> refCount

The reference counter used to implement the std::shared_ptr behavior.

Definition at line 78 of file sharedptr.hpp.

◆ u

template<typename T , typename TAllocator = HeapAllocator>
template<typename U >
U u

The instance, either derived or T.

Definition at line 81 of file sharedptr.hpp.

Constructor(s) / Destructor Details:

◆ FieldMembers() [1/2]

template<typename T , typename TAllocator = HeapAllocator>
template<typename U >
FieldMembers ( TAllocator & pAllocator,
T * pCustom,
size_t pAllocSize )
inline

Constructor.

Parameters
pAllocatorThe allocator, stored in parent AllocatorMember.
pCustomThe pointer to custom, rightfully cast.
pAllocSizeThe size of the allocated pair, containing this and the potentially derived object T.

Definition at line 88 of file sharedptr.hpp.

◆ FieldMembers() [2/2]

template<typename T , typename TAllocator = HeapAllocator>
template<typename U >
FieldMembers ( T * pCustom,
size_t pAllocSize )
inline

Alternative constructor missing the allocator instance.

Parameters
pAllocSizeThe size of the allocated pair, containing this and the potentially derived object T.
pCustomThe pointer to custom, rightfully cast.

Definition at line 98 of file sharedptr.hpp.


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