Open 3D Engine AzCore 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.
EBus.h File Reference
#include <AzCore/EBus/BusImpl.h>
#include <AzCore/EBus/Environment.h>
#include <AzCore/EBus/Results.h>
#include <AzCore/EBus/Internal/Debug.h>
#include <AzCore/std/typetraits/typetraits.h>
#include <AzCore/std/smart_ptr/unique_ptr.h>
#include <AzCore/std/containers/unordered_set.h>
#include <AzCore/std/typetraits/is_same.h>
#include <AzCore/std/utils.h>
#include <AzCore/std/parallel/scoped_lock.h>
#include <AzCore/std/parallel/shared_mutex.h>

Classes

struct  AZ::EBusTraits
 
class  AZ::EBus< Interface, BusTraits >
 

Namespaces

namespace  AZStd
 AZ namespace needs to be closed in order to specialize the AZStd::hash struct for AddressTypeElement and AddressType.
 
namespace  AZ
 Reopen namespace to define DataPatch class.
 

Macros

#define DEPRECATE_EBUS(_Interface, _BusName, _message)   DEPRECATE_EBUS_WITH_TRAITS(_Interface, _Interface, _BusName, _message)
 
#define DEPRECATE_EBUS_WITH_TRAITS(_Interface, _BusTraits, _BusName, _message)
 
#define EBUS_EVENT_PTR(_BusPtr, _EBUS, ...)   _EBUS::Event(_BusPtr, &_EBUS::Events::__VA_ARGS__)
 Dispatches an event to handlers at a cached address.
 
#define EBUS_EVENT_PTR_RESULT(_Result, _BusPtr, _EBUS, ...)   _EBUS::EventResult(_Result, _BusPtr, &_EBUS::Events::__VA_ARGS__)
 Dispatches an event to handlers at a cached address and receives results.
 
#define EBUS_EVENT_ID(_BusId, _EBUS, ...)   _EBUS::Event(_BusId, &_EBUS::Events::__VA_ARGS__)
 Dispatches an event to handlers at a specific address.
 
#define EBUS_EVENT_ID_RESULT(_Result, _BusId, _EBUS, ...)   _EBUS::EventResult(_Result, _BusId, &_EBUS::Events::__VA_ARGS__)
 Dispatches an event to handlers at a specific address and receives results.
 
#define EBUS_EVENT(_EBUS, ...)   _EBUS::Broadcast(&_EBUS::Events::__VA_ARGS__)
 Dispatches an event to all handlers.
 
#define EBUS_EVENT_RESULT(_Result, _EBUS, ...)   _EBUS::BroadcastResult(_Result, &_EBUS::Events::__VA_ARGS__)
 Dispatches an event to all handlers and receives results.
 
#define EBUS_EVENT_PTR_REVERSE(_BusPtr, _EBUS, ...)   _EBUS::EventReverse(_BusPtr, &_EBUS::Events::__VA_ARGS__)
 Dispatches an event to handlers at a cached address in reverse order.
 
#define EBUS_EVENT_PTR_RESULT_REVERSE(_Result, _BusPtr, _EBUS, ...)   _EBUS::EventResultReverse(_Result, _BusPtr, &_EBUS::Events::__VA_ARGS__)
 Dispatches an event to handlers at a cached address in reverse order and receives results.
 
#define EBUS_EVENT_ID_REVERSE(_BusId, _EBUS, ...)   _EBUS::EventReverse(_BusId, &_EBUS::Events::__VA_ARGS__)
 Dispatches an event to handlers at a specific address in reverse order.
 
#define EBUS_EVENT_ID_RESULT_REVERSE(_Result, _BusId, _EBUS, ...)   _EBUS::EventReverse(_Result, _BusId, &_EBUS::Events::__VA_ARGS__)
 Dispatches an event to handlers at a specific address in reverse order and receives results.
 
#define EBUS_EVENT_REVERSE(_EBUS, ...)   _EBUS::BroadcastReverse(&_EBUS::Events::__VA_ARGS__)
 Dispatches an event to all handlers in reverse order.
 
#define EBUS_EVENT_RESULT_REVERSE(_Result, _EBUS, ...)   _EBUS::BroadcastResultReverse(_Result, &_EBUS::Events::__VA_ARGS__)
 Dispatches an event to all handlers in reverse order and receives results.
 
#define EBUS_QUEUE_EVENT(_EBUS, ...)   _EBUS::QueueBroadcast(&_EBUS::Events::__VA_ARGS__)
 Enqueues an asynchronous event to dispatch to all handlers.
 
#define EBUS_QUEUE_EVENT_PTR(_BusPtr, _EBUS, ...)   _EBUS::QueueEvent(_BusPtr, &_EBUS::Events::__VA_ARGS__)
 Enqueues an asynchronous event to dispatch to handlers at a cached address.
 
#define EBUS_QUEUE_EVENT_ID(_BusId, _EBUS, ...)   _EBUS::QueueEvent(_BusId, &_EBUS::Events::__VA_ARGS__)
 Enqueues an asynchronous event to dispatch to handlers at a specific address.
 
#define EBUS_QUEUE_EVENT_REVERSE(_EBUS, ...)   _EBUS::QueueBroadcastReverse(&_EBUS::Events::__VA_ARGS__)
 Enqueues an asynchronous event to dispatch to all handlers in reverse order.
 
#define EBUS_QUEUE_EVENT_PTR_REVERSE(_BusPtr, _EBUS, ...)   _EBUS::QueueEventReverse(_BusPtr, &_EBUS::Events::__VA_ARGS__)
 Enqueues an asynchronous event to dispatch to handlers at a cached address in reverse order.
 
#define EBUS_QUEUE_EVENT_ID_REVERSE(_BusId, _EBUS, ...)   _EBUS::QueueEventReverse(_BusId, &_EBUS::Events::__VA_ARGS__)
 Enqueues an asynchronous event to dispatch to handlers at a specific address in reverse order.
 
#define EBUS_QUEUE_FUNCTION(_EBUS, ...)   _EBUS::QueueFunction(__VA_ARGS__)
 Enqueues an arbitrary callable function to be executed asynchronously.
 
#define EBUS_DBG_EVENT_PTR(_BusPtr, _EBUS, ...)
 Dispatches an event to handlers at a cached address.
 
#define EBUS_DBG_EVENT_PTR_RESULT(_Result, _BusPtr, _EBUS, ...)
 Dispatches an event to handlers at a cached address and receives results.
 
#define EBUS_DBG_EVENT_ID(_BusId, _EBUS, ...)
 Dispatches an event to handlers at a specific address.
 
#define EBUS_DBG_EVENT_ID_RESULT(_Result, _BusId, _EBUS, ...)
 Dispatches an event to handlers at a specific address and receives results.
 
#define EBUS_DBG_EVENT(_EBUS, ...)
 Dispatches an event to all handlers.
 
#define EBUS_DBG_EVENT_RESULT(_Result, _EBUS, ...)
 Dispatches an event to all handlers and receives results.
 
#define EBUS_DBG_EVENT_PTR_REVERSE(_BusPtr, _EBUS, ...)
 Dispatches an event to handlers at a cached address in reverse order.
 
#define EBUS_DBG_EVENT_PTR_RESULT_REVERSE(_Result, _BusPtr, _EBUS, ...)
 Dispatches an event to handlers at a cached address in reverse order and receives results.
 
#define EBUS_DBG_EVENT_ID_REVERSE(_BusId, _EBUS, ...)
 Dispatches an event to handlers at a specific address in reverse order.
 
#define EBUS_DBG_EVENT_ID_RESULT_REVERSE(_Result, _BusId, _EBUS, ...)
 Dispatches an event to handlers at a specific address in reverse order and receives results.
 
#define EBUS_DBG_EVENT_REVERSE(_EBUS, ...)
 Dispatches an event to all handlers in reverse order.
 
#define EBUS_DBG_EVENT_RESULT_REVERSE(_Result, _EBUS, ...)
 Dispatches an event to all handlers in reverse order and receives results.
 
#define EBUS_DBG_QUEUE_EVENT(_EBUS, ...)
 Enqueues an asynchronous event to dispatch to all handlers.
 
#define EBUS_DBG_QUEUE_EVENT_PTR(_BusPtr, _EBUS, ...)
 Enqueues an asynchronous event to dispatch to handlers at a cached address.
 
#define EBUS_DBG_QUEUE_EVENT_ID(_BusId, _EBUS, ...)
 Enqueues an asynchronous event to dispatch to handlers at a specific address.
 
#define EBUS_DBG_QUEUE_EVENT_REVERSE(_EBUS, ...)
 Enqueues an asynchronous event to dispatch to all handlers in reverse order.
 
#define EBUS_DBG_QUEUE_EVENT_PTR_REVERSE(_BusPtr, _EBUS, ...)
 Enqueues an asynchronous event to dispatch to handlers at a cached address in reverse order.
 
#define EBUS_DBG_QUEUE_EVENT_ID_REVERSE(_BusId, _EBUS, ...)
 Enqueues an asynchronous event to dispatch to handlers at a specific address in reverse order.
 
#define EBUS_DBG_QUEUE_FUNCTION(_EBUS, ...)
 Enqueues an arbitrary callable function to be executed asynchronously.
 
#define DECLARE_EBUS_EXTERN_WITH_TRAITS(a, b)
 Externs an EBus class template with both the interface and bus traits arguments.
 
#define DECLARE_EBUS_EXTERN(a)
 
#define DECLARE_EBUS_INSTANTIATION_WITH_TRAITS(a, b)
 Instantiates an EBus class template with both the interface and bus traits arguments.
 
#define DECLARE_EBUS_INSTANTIATION(a)
 

Detailed Description

Header file for event bus (EBus), a general-purpose communication system that Open 3D Engine uses to dispatch notifications and receive requests. EBuses are configurable and support many different use cases. For more information about EBuses, see AZ::EBus in this guide and Event Bus in the Open 3D Engine Developer Guide.

Macro Definition Documentation

◆ DECLARE_EBUS_EXTERN

#define DECLARE_EBUS_EXTERN (   a)
Value:
namespace AZ \
{ \
extern template class EBus<a, a>; \
}
Reopen namespace to define DataPatch class.
Definition: AssetCommon.h:26

Externs an EBus class template using only the interface argument for both the EBus Interface and BusTraits template parameters

◆ DECLARE_EBUS_EXTERN_WITH_TRAITS

#define DECLARE_EBUS_EXTERN_WITH_TRAITS (   a,
 
)
Value:
namespace AZ \
{ \
extern template class EBus<a, b>; \
}

Externs an EBus class template with both the interface and bus traits arguments.

◆ DECLARE_EBUS_INSTANTIATION

#define DECLARE_EBUS_INSTANTIATION (   a)
Value:
namespace AZ \
{ \
template class EBus<a, a>; \
}

Instantiates an EBus class template using only the interface argument for both the EBus Interface and BusTraits template parameters

◆ DECLARE_EBUS_INSTANTIATION_WITH_TRAITS

#define DECLARE_EBUS_INSTANTIATION_WITH_TRAITS (   a,
 
)
Value:
namespace AZ \
{ \
template class EBus<a, b>; \
}

Instantiates an EBus class template with both the interface and bus traits arguments.

◆ DEPRECATE_EBUS

#define DEPRECATE_EBUS (   _Interface,
  _BusName,
  _message 
)    DEPRECATE_EBUS_WITH_TRAITS(_Interface, _Interface, _BusName, _message)

Helper macro to deprecate the helper typedef EBus<_Interface> _BusName Where _Interface is a deprecated EBus API class

◆ DEPRECATE_EBUS_WITH_TRAITS

#define DEPRECATE_EBUS_WITH_TRAITS (   _Interface,
  _BusTraits,
  _BusName,
  _message 
)
Value:
AZ_PUSH_DISABLE_WARNING(4996, "-Wdeprecated-declarations") \
typedef AZ::EBus<_Interface, _BusTraits> DeprecatedBus_##_Interface##_BusTraits; \
AZ_POP_DISABLE_WARNING \
AZ_DEPRECATED(typedef DeprecatedBus_##_Interface##_BusTraits _BusName, _message);
Definition: EBus.h:405

Helper macro to deprecate the helper typedef EBus<_Interface, _BusTraits> _BusName Where _Interface is a deprecated EBus API class and/or _BusTraits is a deprecated EBusTraits class