Open 3D Engine Multiplayer Gem API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Multiplayer::RewindableFixedVector< TYPE, SIZE > Class Template Reference

Data structure that has a compile-time upper bound, provides vector semantics and supports network serialization. More...

#include <RewindableFixedVector.h>

Public Types

typedef const RewindableObject< TYPE, Multiplayer::RewindHistorySize > * const_iterator
 
typedef RewindableObject< TYPE, Multiplayer::RewindHistorySize > * iterator
 

Public Member Functions

constexpr RewindableFixedVector ()=default
 Default constructor.
 
constexpr RewindableFixedVector (const TYPE &initialValue, uint32_t count)
 
 ~RewindableFixedVector ()
 Destructor.
 
bool Serialize (AzNetworking::ISerializer &serializer)
 
bool Serialize (AzNetworking::ISerializer &serializer, AzNetworking::IBitset &deltaRecord)
 
constexpr bool copy_values (const TYPE *buffer, uint32_t bufferSize)
 
constexpr RewindableFixedVector< TYPE, SIZE > & operator= (const RewindableFixedVector< TYPE, SIZE > &rhs)
 
constexpr bool operator== (const RewindableFixedVector< TYPE, SIZE > &rhs) const
 
constexpr bool operator!= (const RewindableFixedVector< TYPE, SIZE > &rhs) const
 
constexpr bool resize (uint32_t count)
 
constexpr bool resize_no_construct (uint32_t count)
 
constexpr void clear ()
 Resets the vector, returning it to size 0.
 
constexpr const TYPE & operator[] (uint32_t index) const
 
constexpr TYPE & operator[] (uint32_t index)
 
constexpr bool push_back (const TYPE &value)
 
constexpr bool pop_back ()
 
constexpr bool empty () const
 
constexpr const TYPE & back () const
 Gets the last element of the vector.
 
constexpr uint32_t size () const
 Gets the size of the vector.
 
const_iterator begin () const
 
const_iterator end () const
 
constexpr iterator begin ()
 
constexpr iterator end ()
 

Detailed Description

template<typename TYPE, uint32_t SIZE>
class Multiplayer::RewindableFixedVector< TYPE, SIZE >

Data structure that has a compile-time upper bound, provides vector semantics and supports network serialization.

Constructor & Destructor Documentation

◆ RewindableFixedVector()

template<typename TYPE , uint32_t SIZE>
constexpr Multiplayer::RewindableFixedVector< TYPE, SIZE >::RewindableFixedVector ( const TYPE &  initialValue,
uint32_t  count 
)
constexpr

Construct and initialize buffer to the provided value

Parameters
initialValueinitial value to set the internal buffer to
countinitial value to reserve in the vector

Member Function Documentation

◆ copy_values()

template<typename TYPE , uint32_t SIZE>
constexpr bool Multiplayer::RewindableFixedVector< TYPE, SIZE >::copy_values ( const TYPE *  buffer,
uint32_t  bufferSize 
)
constexpr

Copies elements from the buffer pointed to by Buffer to this FixedSizeVector instance, vector size will be set to BufferSize

Parameters
bufferpointer to the buffer to copy
bufferSizenumber of elements in the buffer to copy
Returns
bool true on success, false if the input data was too large to fit in the vector

◆ empty()

template<typename TYPE , uint32_t SIZE>
constexpr bool Multiplayer::RewindableFixedVector< TYPE, SIZE >::empty
constexpr

Returns if the vector is empty

Returns
bool true on empty, false if the vector contains valid elements

◆ operator!=()

template<typename TYPE , uint32_t SIZE>
constexpr bool Multiplayer::RewindableFixedVector< TYPE, SIZE >::operator!= ( const RewindableFixedVector< TYPE, SIZE > &  rhs) const
constexpr

Inequality operator, returns true if the current instance is not equal to RHS

Parameters
rhsthe FixedSizeVector instance to test for inequality against
Returns
bool false if equal, true if not equal

◆ operator=()

template<typename TYPE , uint32_t SIZE>
constexpr RewindableFixedVector< TYPE, SIZE > & Multiplayer::RewindableFixedVector< TYPE, SIZE >::operator= ( const RewindableFixedVector< TYPE, SIZE > &  rhs)
constexpr

Copy buffer from the provided vector

Parameters
RHSinstance to copy from

◆ operator==()

template<typename TYPE , uint32_t SIZE>
constexpr bool Multiplayer::RewindableFixedVector< TYPE, SIZE >::operator== ( const RewindableFixedVector< TYPE, SIZE > &  rhs) const
constexpr

Equality operator, returns true if the current instance is equal to RHS

Parameters
rhsthe FixedSizeVector instance to test for equality against
Returns
bool true if equal, false if not

◆ operator[]() [1/2]

template<typename TYPE , uint32_t SIZE>
constexpr TYPE & Multiplayer::RewindableFixedVector< TYPE, SIZE >::operator[] ( uint32_t  index)
constexpr

Non-const element access

Parameters
Indexindex of the element to return
Returns
non-const reference to the requested element

◆ operator[]() [2/2]

template<typename TYPE , uint32_t SIZE>
constexpr const TYPE & Multiplayer::RewindableFixedVector< TYPE, SIZE >::operator[] ( uint32_t  index) const
constexpr

Const element access

Parameters
Indexindex of the element to return
Returns
const reference to the requested element

◆ pop_back()

template<typename TYPE , uint32_t SIZE>
constexpr bool Multiplayer::RewindableFixedVector< TYPE, SIZE >::pop_back
constexpr

Pops the last element off the vector, decreasing the vector's size by one

Returns
bool true on success, false if the vector was empty

◆ push_back()

template<typename TYPE , uint32_t SIZE>
constexpr bool Multiplayer::RewindableFixedVector< TYPE, SIZE >::push_back ( const TYPE &  value)
constexpr

Pushes a new element to the back of the vector

Parameters
Valuevalue to append to the back of this vector
Returns
boolean true on success, false if the vector was full

◆ resize()

template<typename TYPE , uint32_t SIZE>
constexpr bool Multiplayer::RewindableFixedVector< TYPE, SIZE >::resize ( uint32_t  count)
constexpr

Resizes the vector to the requested number of elements, initializing new elements if necessary

Parameters
countthe number of elements to size the vector to
Returns
bool true on success

◆ resize_no_construct()

template<typename TYPE , uint32_t SIZE>
constexpr bool Multiplayer::RewindableFixedVector< TYPE, SIZE >::resize_no_construct ( uint32_t  count)
constexpr

Resizes the vector to the requested number of elements, without initialization

Parameters
countthe number of elements to size the vector to
Returns
bool true on success

◆ Serialize() [1/2]

template<typename TYPE , uint32_t SIZE>
bool Multiplayer::RewindableFixedVector< TYPE, SIZE >::Serialize ( AzNetworking::ISerializer &  serializer)

Serialization method for fixed vector contained rewindable objects

Parameters
serializerISerializer instance to use for serialization
Returns
bool true for success, false for serialization failure

◆ Serialize() [2/2]

template<typename TYPE , uint32_t SIZE>
bool Multiplayer::RewindableFixedVector< TYPE, SIZE >::Serialize ( AzNetworking::ISerializer &  serializer,
AzNetworking::IBitset &  deltaRecord 
)

Serialization method for fixed vector contained rewindable objects

Parameters
serializerISerializer instance to use for serialization
deltaRecordBitset delta record used to detect state change during reconciliation
Returns
bool true for success, false for serialization failure

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