Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZStd::concurrent_vector< T, Allocator, INITIAL_CAPACITY_LOG, MAX_CAPACITY_LOG > Class Template Reference

#include <concurrent_vector.h>

Public Member Functions

const T & operator[] (unsigned int i) const
 
T & operator[] (unsigned int i)
 
unsigned int push_back (const T &v)
 Returns index of element that was added.
 
bool empty () const
 
unsigned int size () const
 
void clear ()
 
void resize (unsigned int newSize)
 

Detailed Description

template<typename T, typename Allocator = AZStd::allocator, unsigned int INITIAL_CAPACITY_LOG = 5, unsigned int MAX_CAPACITY_LOG = 32>
class AZStd::concurrent_vector< T, Allocator, INITIAL_CAPACITY_LOG, MAX_CAPACITY_LOG >

This container is lock free, provides indexed access and is dynamically resizable. It will not free up memory unless clear() is explicitly called.

WARNING 1: concurrent_vector IS NOT THREADSAFE! The size of the vector is changed atomically, and memory allocations are atomic, but elements are not pushed onto the list atomically when the size changes. If you just want a list that dynamically grows, doesn't free up and reallocate existing pointers, and can be read from in a thread-safe way, then use this. Otherwise, use something else (like an AZStd::list with a mutex).

WARNING 2: constructors and destructors on elements created by this will not be called. Best to use with structs and simple data types (ints, floats, etc)


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