Inherited by AZ::BehaviorContextEvents, AZ::ComponentApplicationEvents, AZ::ComponentApplicationRequests, AZ::ComponentBus, AZ::ComponentDescriptorBusTraits, AZ::EntitySystemEvents, AZ::SystemTickEvents, AZ::TickEvents, AZ::TickRequests, AzFramework::EntityContextEvents, AzFramework::EntityContextRequests, AzFramework::GameEntityContextEvents, AzFramework::GameEntityContextRequests, and AzFramework::SliceInstantiationResults.
|Allocator used by the EBus. More...|
|The type of ID that is used to address the EBus. More...|
|Sorting function for EBus address IDs. More...|
|Sorting function for EBus event handlers. More...|
|Locking primitive that is used when connecting handlers to the EBus or executing events. More...|
|Locking primitive that is used when adding and removing events from the queue. More...|
|Enables custom logic to run when a handler connects or disconnects from the EBus. More...|
|Specifies where EBus data is stored. More...|
|Controls the flow of EBus events. More...|
|static const EBusHandlerPolicy||HandlerPolicy|
|Defines how many handlers can connect to an address on the EBus and the order in which handlers at each address receive events. More...|
|static const EBusAddressPolicy||AddressPolicy|
|Defines how many addresses exist on the EBus. More...|
|static const bool||EnableEventQueue|
|Specifies whether the EBus supports an event queue. More...|
|A destructor. More...|
EBusTraits are properties that you use to configure an EBus.
The key EBusTraits to understand are AddressPolicy, which defines how many addresses the EBus contains, HandlerPolicy, which describes how many handlers can connect to each address, and
BusIdType, which is the type of ID that is used to address the EBus if addresses are used.
Member Typedef Documentation
|using AZ::EBusTraits::AllocatorType = AZStd::allocator|
Allocator used by the EBus.
The default setting is AZStd::allocator, which uses AZ::SystemAllocator.
|using AZ::EBusTraits::BusHandlerOrderCompare = BusHandlerCompareDefault|
Sorting function for EBus event handlers.
Used only when the HandlerPolicy is AZ::EBusHandlerPolicy::MultipleAndOrdered. This function determines the order in which handlers at an address receive an event. The function must satisfy
AZStd::binary_function<Interface*, Interface*, bool>.
By default, the function requires the handler to implement the following comparison function.
|using AZ::EBusTraits::BusIdOrderCompare = NullBusIdCompare|
Sorting function for EBus address IDs.
Used only when the AddressPolicy is AZ::EBusAddressPolicy::ByIdAndOrdered. If an event is dispatched without an ID, this function determines the order in which each address receives the event. The function must satisfy
AZStd::binary_function<BusIdType, BusIdType, bool>.
The following example shows a sorting function that meets these requirements.
Locking primitive that is used when connecting handlers to the EBus or executing events.
By default, all access is assumed to be single threaded and no locking occurs. For multithreaded access, specify a mutex of the following type.
- For simple multithreaded cases, use AZStd::mutex.
- For multithreaded cases where an event handler sends a new event on the same bus or connects/disconnects while handling an event on the same bus, use AZStd::recursive_mutex.
|using AZ::EBusTraits::RouterPolicy = EBusRouterPolicy<Bus>|
Controls the flow of EBus events.
Enables an event to be forwarded, and possibly stopped, before reaching the normal event handlers. Use cases for routing include tracing, debugging, and versioning an EBus. The default
EBusRouterPolicy forwards the event to each connected
EBusRouterNode before sending the event to the normal handlers. Each node can stop the event or let it continue.
|using AZ::EBusTraits::StoragePolicy = EBusEnvironmentStoragePolicy<Context>|
Specifies where EBus data is stored.
This drives how many instances of this EBus exist at runtime. Available storage policies include the following:
- (Default) EBusEnvironmentStoragePolicy - EBus data is stored in the AZ::Environment. With this policy, a single EBus instance is shared across all modules (DLLs) that attach to the AZ::Environment.
- EBusGlobalStoragePolicy - EBus data is stored in a global static variable. With this policy, each module (DLL) has its own instance of the EBus.
- EBusThreadLocalStoragePolicy - EBus data is stored in a thread_local static variable. With this policy, each thread has its own instance of the EBus.
Constructor & Destructor Documentation
Member Data Documentation
Specifies whether the EBus supports an event queue.
You can use the event queue to execute events at a later time. To execute the queued events, you must call
<BusName>::ExecuteQueuedEvents(). By default, the event queue is disabled.
The documentation for this struct was generated from the following file: