Menu
Lumberyard
C++ API Reference (Version 1.10)

AZ::BusInternal::EBusBroadcastQueue< Bus, Traits > Struct Template Reference

Open 3D Engine (O3DE), the successor to Lumberyard, is now available in Developer Preview. Download O3DE or visit the AWS Game Tech blog to learn more.

EBus functionality related to the queuing of events and functions. More...

Inherited by AZ::BusInternal::EBusEventQueue< Bus, Traits > .

Public Types

using BusPtr
Pointer to an address on the bus. More...

Static Public Member Functions

static void ExecuteQueuedEvents ()
Executes queued events and functions. More...
static void ClearQueuedEvents ()
Clears the queue without calling events or functions. More...
static void AllowFunctionQueuing (bool isAllowed)
Sets whether function queuing is allowed. More...
static bool IsFunctionQueuing ()
Returns whether function queuing is allowed. More...
template<class Function , class ... InputArgs>
static void QueueBroadcast (Function func, InputArgs &&... args)
Enqueues an asynchronous event to dispatch to all handlers. More...
template<class Function , class ... InputArgs>
static void QueueBroadcastReverse (Function func, InputArgs &&... args)
Enqueues an asynchronous event to dispatch to all handlers in reverse order. More...
template<class Function , class ... InputArgs>
static void QueueFunction (Function func, InputArgs &&... args)
Enqueues an arbitrary callable function to be executed asynchronously. More...

Detailed Description

template<class Bus, class Traits>
struct AZ::BusInternal::EBusBroadcastQueue< Bus, Traits >

EBus functionality related to the queuing of events and functions.

This is specifically for queuing events and functions that will be broadcast to all handlers on the EBus .

Template Parameters
Bus The EBus type.
Traits A class that inherits from EBusTraits and configures the EBus . This parameter may be left unspecified if the Interface class inherits from EBusTraits .

Member Typedef Documentation

BusPtr

template<class Bus , class Traits >
using AZ::BusInternal::EBusBroadcastQueue < Bus, Traits >:: BusPtr = typename Traits::BusPtr

Pointer to an address on the bus.

Member Function Documentation

AllowFunctionQueuing()

template<class Bus , class Traits >
static void AZ::BusInternal::EBusBroadcastQueue < Bus, Traits >::AllowFunctionQueuing ( bool isAllowed )
inline static

Sets whether function queuing is allowed.

This does not affect event queuing. Function queuing is allowed by default when EBusTraits::EnableEventQueue is true. It is never allowed when EBusTraits::EnableEventQueue is false.

See also
QueueFunction , EBusTraits::EnableEventQueue
Parameters
isAllowed Set to true to allow function queuing. Otherwise, set to false.

ClearQueuedEvents()

template<class Bus , class Traits >
static void AZ::BusInternal::EBusBroadcastQueue < Bus, Traits >::ClearQueuedEvents ( )
inline static

Clears the queue without calling events or functions.

Use in situations where memory must be freed immediately, such as shutdown. Use with care. Cleared queued events will never be executed, and those events might have been expected.

ExecuteQueuedEvents()

template<class Bus , class Traits >
static void AZ::BusInternal::EBusBroadcastQueue < Bus, Traits >::ExecuteQueuedEvents ( )
inline static

Executes queued events and functions.

Execution will occur on the thread that calls this function.

See also
QueueBroadcast() , EBusEventQueue::QueueEvent() , QueueFunction() , ClearQueuedEvents()

IsFunctionQueuing()

template<class Bus , class Traits >
static bool AZ::BusInternal::EBusBroadcastQueue < Bus, Traits >::IsFunctionQueuing ( )
inline static

Returns whether function queuing is allowed.

Returns
True if function queuing is allowed. Otherwise, false.
See also
QueueFunction , AllowFunctionQueuing

QueueBroadcast()

template<class Bus , class Traits >
template<class Function , class ... InputArgs>
void AZ::BusInternal::EBusBroadcastQueue < Bus, Traits >::QueueBroadcast ( Function func ,
InputArgs &&... args
)
inline static

Enqueues an asynchronous event to dispatch to all handlers.

The event is not executed until ExecuteQueuedEvents() is called.

Parameters
func Function pointer of the event to dispatch.
args Function arguments that are passed to each handler.

QueueBroadcastReverse()

template<class Bus , class Traits >
template<class Function , class ... InputArgs>
void AZ::BusInternal::EBusBroadcastQueue < Bus, Traits >::QueueBroadcastReverse ( Function func ,
InputArgs &&... args
)
inline static

Enqueues an asynchronous event to dispatch to all handlers in reverse order.

The event is not executed until ExecuteQueuedEvents() is called.

Parameters
func Function pointer of the event to dispatch.
args Function arguments that are passed to each handler.

QueueFunction()

template<class Bus , class Traits >
template<class Function , class ... InputArgs>
void AZ::BusInternal::EBusBroadcastQueue < Bus, Traits >::QueueFunction ( Function func ,
InputArgs &&... args
)
inline static

Enqueues an arbitrary callable function to be executed asynchronously.

The function is not executed until ExecuteQueuedEvents() is called. The function might be unrelated to this EBus or any handlers. Examples of callable functions are static functions, lambdas, and bound-member functions.

One use case is to determine when a batch of queued events has finished. When the function is executed, we know that all events that were queued before the function have finished executing.

Parameters
func Callable function.
args Arguments for func .

The documentation for this struct was generated from the following file:
  • C:/lumberyard-root/dev/Code/Framework/AzCore/AzCore/EBus/ BusImpl.h