ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
TSharedMonoVal< T, TAllocator, TLock >::FieldMembersWithLock Struct Reference

Description:

template<typename T, typename TAllocator, typename TLock>
struct alib::monomem::TSharedMonoVal< T, TAllocator, TLock >::FieldMembersWithLock

The combined struct of members that are allocated in the first buffer of the monotonic allocator.

Definition at line 116 of file sharedmonoval.hpp.

#include <sharedmonoval.hpp>

Collaboration diagram for TSharedMonoVal< T, TAllocator, TLock >::FieldMembersWithLock:
[legend]

Public Field Index:

TMonoAllocator< TAllocator > allocator
 The allocator that this class is contained in.
 
lang::Placeholder< T > custom
 The space for the custom member. The instance will be constructed using placement-new.
 
TLock lock
 The embedded lock.
 
std::atomic< unsigned int > refCount
 The reference counter used to implement the std::shared_ptr behavior.
 

Public Method Index:

template<typename TEnableIf = TAllocator, ATMP_IF(std::is_default_constructible< TEnableIf >::value) >
 FieldMembersWithLock (detail::Buffer *firstBuffer, size_t initialBufferSize, unsigned int bufferGrowthInPercent)
 
 FieldMembersWithLock (TAllocator &pAllocator, detail::Buffer *firstBuffer, size_t initialBufferSize, unsigned int bufferGrowthInPercent)
 

Field Details:

◆ allocator

template<typename T , typename TAllocator , typename TLock >
TMonoAllocator<TAllocator> allocator

The allocator that this class is contained in.

Definition at line 122 of file sharedmonoval.hpp.

◆ custom

template<typename T , typename TAllocator , typename TLock >
lang::Placeholder<T> custom

The space for the custom member. The instance will be constructed using placement-new.

Definition at line 119 of file sharedmonoval.hpp.

◆ lock

template<typename T , typename TAllocator , typename TLock >
TLock lock

The embedded lock.

Definition at line 128 of file sharedmonoval.hpp.

◆ refCount

template<typename T , typename TAllocator , typename TLock >
std::atomic<unsigned int> refCount

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

Definition at line 125 of file sharedmonoval.hpp.

Constructor(s) / Destructor Details:

◆ FieldMembersWithLock() [1/2]

template<typename T , typename TAllocator , typename TLock >
FieldMembersWithLock ( TAllocator & pAllocator,
detail::Buffer * firstBuffer,
size_t initialBufferSize,
unsigned int bufferGrowthInPercent )
inline

Constructor. Creates the allocator and initializes refCount. The custom contents will be constructed by an obligatory, separated call to ConstructT.

Parameters
pAllocatorThe chained allocator of the monotonic allocator.
firstBufferThe first argument to field allocator.
initialBufferSizeThe second argument to field allocator.
bufferGrowthInPercentOptional growth factor in percent, applied to the buffer size with each next buffer allocation. Values provided should be greater than 100.

Definition at line 139 of file sharedmonoval.hpp.

◆ FieldMembersWithLock() [2/2]

template<typename T , typename TAllocator , typename TLock >
template<typename TEnableIf = TAllocator, ATMP_IF(std::is_default_constructible< TEnableIf >::value) >
FieldMembersWithLock ( detail::Buffer * firstBuffer,
size_t initialBufferSize,
unsigned int bufferGrowthInPercent )
inline

Alternative constructor missing the allocator instance. This is used only with allocators that are default constructible (like HeapAllocator is).

Parameters
firstBufferThe first argument to field allocator.
initialBufferSizeThe second argument to field allocator.
bufferGrowthInPercentOptional growth factor in percent, applied to the buffer size with each next buffer allocation. Values provided should be greater than 100.

Definition at line 156 of file sharedmonoval.hpp.


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