Open 3D Engine AzNetworking API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Member Functions | List of all members
AzNetworking::TcpRingBuffer< SIZE > Class Template Reference

statically sized ringbuffer class for reading from or writing to data streams like a TCP socket connection. More...

#include <TcpRingBuffer.h>

Public Member Functions

uint8_t * ReserveBlockForWrite (uint32_t numBytes)
 
uint8_t * GetReadBufferData () const
 
uint32_t GetReadBufferSize () const
 
bool AdvanceWriteBuffer (uint32_t numBytes)
 
bool AdvanceReadBuffer (uint32_t numBytes)
 

Detailed Description

template<uint32_t SIZE>
class AzNetworking::TcpRingBuffer< SIZE >

statically sized ringbuffer class for reading from or writing to data streams like a TCP socket connection.

Member Function Documentation

◆ AdvanceReadBuffer()

template<uint32_t SIZE>
bool AzNetworking::TcpRingBuffer< SIZE >::AdvanceReadBuffer ( uint32_t  numBytes)
inline

Advances the ringbuffer read offset by the requested number of bytes.

Parameters
numBytesnumber of bytes to advance the ringbuffer read pointer by
Returns
boolean true on success

◆ AdvanceWriteBuffer()

template<uint32_t SIZE>
bool AzNetworking::TcpRingBuffer< SIZE >::AdvanceWriteBuffer ( uint32_t  numBytes)
inline

Advances the ringbuffer write offset by the requested number of bytes.

Parameters
numBytesnumber of bytes to advance the ringbuffer write pointer by
Returns
boolean true on success

◆ GetReadBufferData()

template<uint32_t SIZE>
uint8_t * AzNetworking::TcpRingBuffer< SIZE >::GetReadBufferData
inline

Returns the start of ringbuffer read memory.

Returns
pointer to the start of ringbuffer read memory

◆ GetReadBufferSize()

template<uint32_t SIZE>
uint32_t AzNetworking::TcpRingBuffer< SIZE >::GetReadBufferSize
inline

Returns the size of ringbuffer read memory in bytes.

Returns
the size of ringbuffer read memory in bytes

◆ ReserveBlockForWrite()

template<uint32_t SIZE>
uint8_t * AzNetworking::TcpRingBuffer< SIZE >::ReserveBlockForWrite ( uint32_t  numBytes)
inline

Returns a pointer into writable memory guaranteed to be of at least numBytes in length.

Parameters
numBytesmaximum number of bytes to be written to the ring-buffer
Returns
pointer to the requested memory, nullptr if the requested size is too large for the ringbuffer to store contiguously

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