Open 3D Engine AzCore API Reference  22.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Types | Static Public Member Functions | List of all members
AZ::EBusConnectionPolicy< Bus > Struct Template Reference

#include <Policies.h>

Inherited by AZ::Data::AssetEvents::AssetConnectionPolicy< Bus >.

Public Types

typedef Bus::BusPtr BusPtr
 
typedef Bus::BusIdType BusIdType
 
typedef Bus::HandlerNode HandlerNode
 
typedef Bus::Context Context
 
typedef Bus::MutexType MutexType
 
typedef Bus::Context::ConnectLockGuard ConnectLockGuard
 

Static Public Member Functions

static void Connect (BusPtr &ptr, Context &context, HandlerNode &handler, ConnectLockGuard &contextLock, const BusIdType &id=0)
 
static void Disconnect (Context &context, HandlerNode &handler, BusPtr &ptr)
 

Detailed Description

template<class Bus>
struct AZ::EBusConnectionPolicy< Bus >

Defines the default connection policy that is used when AZ::EBusTraits::ConnectionPolicy is left unspecified. Use this as a template for custom connection policies.

Template Parameters
BusA class that defines an EBus.

Member Typedef Documentation

◆ BusIdType

template<class Bus >
typedef Bus::BusIdType AZ::EBusConnectionPolicy< Bus >::BusIdType

The type of ID that is used to address the EBus. This type is used when the address policy is EBusAddressPolicy::ById or EBusAddressPolicy::ByIdAndOrdered only.

◆ BusPtr

template<class Bus >
typedef Bus::BusPtr AZ::EBusConnectionPolicy< Bus >::BusPtr

A pointer to a specific address on the EBus.

◆ ConnectLockGuard

template<class Bus >
typedef Bus::Context::ConnectLockGuard AZ::EBusConnectionPolicy< Bus >::ConnectLockGuard

Lock type used for connecting / disconnecting to the bus. When NullMutex isn't used as the default mutex this will be a unique lock to allow for unlocking before connection dispatches which some specialized policies perform

E.g RequestConnect -> LockMutex -> ConnectInternal -> UnlockMutex -> ExecuteHandlerMethod -> Return

◆ Context

template<class Bus >
typedef Bus::Context AZ::EBusConnectionPolicy< Bus >::Context

Global data for the EBus. There is only one context for each EBus type.

◆ HandlerNode

template<class Bus >
typedef Bus::HandlerNode AZ::EBusConnectionPolicy< Bus >::HandlerNode

A handler connected to the EBus.

◆ MutexType

template<class Bus >
typedef Bus::MutexType AZ::EBusConnectionPolicy< Bus >::MutexType

Default MutexType used for connecting, disconnecting and dispatch when enabled

Member Function Documentation

◆ Connect()

template<class Bus >
void AZ::EBusConnectionPolicy< Bus >::Connect ( BusPtr ptr,
Context context,
HandlerNode handler,
ConnectLockGuard contextLock,
const BusIdType id = 0 
)
static

Connects a handler to an EBus address.

Parameters
ptr[out]A pointer that will be bound to the EBus address that the handler will be connected to.
contextGlobal data for the EBus.
handlerThe handler to connect to the EBus address.
idThe ID of the EBus address that the handler will be connected to.

◆ Disconnect()

template<class Bus >
void AZ::EBusConnectionPolicy< Bus >::Disconnect ( Context context,
HandlerNode handler,
BusPtr ptr 
)
static

Disconnects a handler from an EBus address.

Parameters
contextGlobal data for the EBus.
handlerThe handler to disconnect from the EBus address.
ptrA pointer to a specific address on the EBus.

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