ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::monomem::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 102 of file sharedmonoval.inl.

Collaboration diagram for alib::monomem::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 TRequires = TAllocator>
requires std::default_initializable<TRequires>
 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> alib::monomem::TSharedMonoVal< T, TAllocator, TLock >::FieldMembersWithLock::allocator

The allocator that this class is contained in.

Definition at line 108 of file sharedmonoval.inl.

◆ custom

template<typename T, typename TAllocator, typename TLock>
lang::Placeholder<T> alib::monomem::TSharedMonoVal< T, TAllocator, TLock >::FieldMembersWithLock::custom

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

Definition at line 105 of file sharedmonoval.inl.

◆ lock

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

The embedded lock.

Definition at line 114 of file sharedmonoval.inl.

◆ refCount

template<typename T, typename TAllocator, typename TLock>
std::atomic<unsigned int> alib::monomem::TSharedMonoVal< T, TAllocator, TLock >::FieldMembersWithLock::refCount

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

Definition at line 111 of file sharedmonoval.inl.

Constructor(s) / Destructor Details:

◆ FieldMembersWithLock() [1/2]

template<typename T, typename TAllocator, typename TLock>
alib::monomem::TSharedMonoVal< T, TAllocator, TLock >::FieldMembersWithLock::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 125 of file sharedmonoval.inl.

◆ FieldMembersWithLock() [2/2]

template<typename T, typename TAllocator, typename TLock>
template<typename TRequires = TAllocator>
requires std::default_initializable<TRequires>
alib::monomem::TSharedMonoVal< T, TAllocator, TLock >::FieldMembersWithLock::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).

Template Parameters
TRequiresDefaulted template parameter. Must not be specified.
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 143 of file sharedmonoval.inl.


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