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::TcpRingBufferImpl Class Reference

helper class to move ring buffer implementation details out of template header code. More...

#include <TcpRingBufferImpl.h>

Public Member Functions

 TcpRingBufferImpl (uint8_t *buffer, uint32_t bufferSize)
 
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

helper class to move ring buffer implementation details out of template header code.

Constructor & Destructor Documentation

◆ TcpRingBufferImpl()

AzNetworking::TcpRingBufferImpl::TcpRingBufferImpl ( uint8_t *  buffer,
uint32_t  bufferSize 
)

Construct with a buffer and size.

Parameters
bufferinput buffer to use as ring-buffer storage
bufferSizesize of the input buffer in bytes

Member Function Documentation

◆ AdvanceReadBuffer()

bool AzNetworking::TcpRingBufferImpl::AdvanceReadBuffer ( uint32_t  numBytes)

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()

bool AzNetworking::TcpRingBufferImpl::AdvanceWriteBuffer ( uint32_t  numBytes)

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()

uint8_t * AzNetworking::TcpRingBufferImpl::GetReadBufferData ( ) const
inline

Returns the start of ringbuffer read memory.

Returns
pointer to the start of ringbuffer read memory

◆ GetReadBufferSize()

uint32_t AzNetworking::TcpRingBufferImpl::GetReadBufferSize ( ) const
inline

Returns the size of ringbuffer read memory in bytes.

Returns
the size of ringbuffer read memory in bytes

◆ ReserveBlockForWrite()

uint8_t* AzNetworking::TcpRingBufferImpl::ReserveBlockForWrite ( uint32_t  numBytes)

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: