Open 3D Engine AzNetworking 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.
AzNetworking::TimeoutQueue Class Reference

class for managing timeout items. More...

#include <TimeoutQueue.h>

Classes

struct  TimeoutItem
 

Public Types

using TimeoutHandler = AZStd::function< TimeoutResult(TimeoutQueue::TimeoutItem &)>
 

Public Member Functions

void Reset ()
 Resets all internal state for this timeout queue.
 
TimeoutId RegisterItem (uint64_t userData, AZ::TimeMs timeoutMs)
 
TimeoutItemRetrieveItem (TimeoutId timeoutId)
 
void RemoveItem (TimeoutId timeoutId)
 
void UpdateTimeouts (const TimeoutHandler &timeoutHandler, int32_t maxTimeouts=-1)
 

Detailed Description

class for managing timeout items.

Member Typedef Documentation

◆ TimeoutHandler

Updates timeouts for all items, invokes the provided timeout functor if required.

Parameters
timeoutHandlerlambda to invoke for all timeouts
maxTimeoutsthe maximum number of timeouts to process before breaking iteration

Member Function Documentation

◆ RegisterItem()

TimeoutId AzNetworking::TimeoutQueue::RegisterItem ( uint64_t  userData,
AZ::TimeMs  timeoutMs 
)

Registers a new item with the TimeoutQueue.

Parameters
userDatavalue to register a timeout callback for
timeoutMsnumber of milliseconds to trigger the callback after
Returns
boolean true if registration was successful

◆ RemoveItem()

void AzNetworking::TimeoutQueue::RemoveItem ( TimeoutId  timeoutId)

Removes an item from the TimeoutQueue.

Parameters
timeoutIdthe identifier of the item to remove

◆ RetrieveItem()

TimeoutItem * AzNetworking::TimeoutQueue::RetrieveItem ( TimeoutId  timeoutId)

Returns the provided timeout item if it exists, also refreshes the timeout value.

Parameters
timeoutIdthe identifier of the item to fetch
Returns
pointer to the timeout item if it exists

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