Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
gts::internal::ParallelSubVector< T, TSharedMutex, TAllocator > Class Template Reference

An sub-vector used by ParallelVector. More...

#include <ParallelVector.h>

Inherits gts::AlignedAllocator< GTS_NO_SHARING_CACHE_LINE_SIZE >.

Classes

struct  index_buffer_type
 
struct  slot_type
 

Public Types

using value_type = T
 
using size_type = size_t
 
using mutex_type = TSharedMutex
 
using backoff_type = typename mutex_type::backoff_type
 
using allocator_type = TAllocator
 

Public Member Functions

 ParallelSubVector (size_type numVecs, allocator_type const &allocator=allocator_type())
 
 ParallelSubVector (ParallelSubVector const &other)
 
ParallelSubVectoroperator= (ParallelSubVector const &other)
 
 ParallelSubVector (ParallelSubVector &&other)
 
ParallelSubVectoroperator= (ParallelSubVector &&other)
 
template<typename... TArgs>
void emplaceBack (size_type globalIdx, TArgs &&... args)
 
template<bool useLock>
value_type && pop_back_and_get (size_type globalIdx)
 
slot_typereadAt (size_type globalIdx) const
 
slot_typewriteAt (size_type globalIdx)
 
void reserve (size_type newCapacity)
 
void clear ()
 
void shrinkToFit ()
 
size_type capacity () const
 
allocator_type get_allocator () const
 
template<typename... TArgs>
void emplaceBack (size_type globalIdx, TArgs &&... args)
 
template<bool useLock>
ParallelSubVector< T, TSharedMutex, TAllocator >::value_type && pop_back_and_get (size_type globalIdx)
 

Detailed Description

template<typename T, typename TSharedMutex = UnfairSharedSpinMutex<>, typename TAllocator = AlignedAllocator<GTS_NO_SHARING_CACHE_LINE_SIZE>>
class gts::internal::ParallelSubVector< T, TSharedMutex, TAllocator >

An sub-vector used by ParallelVector.

Template Parameters
TThe element type stored in the container.
TSharedMutexThe shared mutex type used to grow the table.
TAllocatorThe allocator used by the storage backing.