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.
AZ::TickEvents Class Referenceabstract

#include <TickBus.h>

Inherits AZ::EBusTraits.

Classes

struct  BusHandlerOrderCompare
 

Public Types

typedef AZStd::recursive_mutex EventQueueMutexType
 
- Public Types inherited from AZ::EBusTraits
using AllocatorType = AZ::Internal::EBusEnvironmentAllocator
 
using BusIdType = NullBusId
 
using BusIdOrderCompare = NullBusIdCompare
 
using BusHandlerOrderCompare = BusHandlerCompareDefault
 
using MutexType = NullMutex
 
using EventQueueMutexType = NullMutex
 
template<class Bus >
using ConnectionPolicy = EBusConnectionPolicy< Bus >
 
template<class Context >
using StoragePolicy = EBusEnvironmentStoragePolicy< Context >
 
template<class Bus >
using RouterPolicy = EBusRouterPolicy< Bus >
 
using EventProcessingPolicy = EBusEventProcessingPolicy
 
template<typename DispatchMutex , bool IsLocklessDispatch>
using DispatchLockGuard = AZStd::conditional_t< IsLocklessDispatch, AZ::Internal::NullLockGuard< DispatchMutex >, AZStd::scoped_lock< DispatchMutex > >
 
template<typename ContextMutex >
using ConnectLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > >
 
template<typename ContextMutex >
using BindLockGuard = AZStd::scoped_lock< ContextMutex >
 
template<typename ContextMutex >
using CallstackTrackerLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > >
 

Public Member Functions

 AZ_RTTI (TickEvents, "{DF79B555-D9E9-489A-8A00-AD39C564E258}")
 
 TickEvents ()
 
virtual ~TickEvents ()
 
virtual void OnTick (float deltaTime, ScriptTimePoint time)=0
 
virtual int GetTickOrder ()
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::MultipleAndOrdered
 
static const bool EnableEventQueue = true
 
- Static Public Attributes inherited from AZ::EBusTraits
static constexpr EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Multiple
 
static constexpr EBusAddressPolicy AddressPolicy = EBusAddressPolicy::Single
 
static constexpr bool EnableEventQueue = false
 
static constexpr bool EventQueueingActiveByDefault = true
 
static constexpr bool EnableQueuedReferences = false
 
static constexpr bool LocklessDispatch = false
 

Protected Attributes

int m_tickOrder
 

Friends

class ComponentApplication
 

Additional Inherited Members

- Protected Member Functions inherited from AZ::EBusTraits
 ~EBusTraits ()=default
 

Detailed Description

Interface for AZ::TickBus, which is the EBus that dispatches tick events. These tick events are executed on the main game thread. In games, AZ::TickBus dispatches ticks even if the application is not in focus. In tools, AZ::TickBus can become inactive when the tool loses focus.

Note
Do not add a mutex to TickEvents. It is unnecessary and typically degrades performance.

Member Typedef Documentation

◆ EventQueueMutexType

Specifies the mutex that is used when adding and removing events from the event queue. This mutex is for the event queue, not TickEvents. Do not add a mutex to TickEvents.

Constructor & Destructor Documentation

◆ TickEvents()

AZ::TickEvents::TickEvents ( )
inline

Creates an instance of the class and sets the tick order of the handler to the default value.

◆ ~TickEvents()

virtual AZ::TickEvents::~TickEvents ( )
inlinevirtual

Destroys the instance of the class.

Member Function Documentation

◆ GetTickOrder()

virtual int AZ::TickEvents::GetTickOrder ( )
inlinevirtual

Specifies The order in which a handler receives tick events relative to other handlers. This value should not be changed while the handler is connected. See the ComponentTickBus enum for recommended values.

Returns
a value specifying this handler's relative order.

◆ OnTick()

virtual void AZ::TickEvents::OnTick ( float  deltaTime,
ScriptTimePoint  time 
)
pure virtual

Signals that the application has issued a tick.

Parameters
deltaTimeThe delta (in seconds) from the previous tick and the current time.
timeThe current time.

Member Data Documentation

◆ EnableEventQueue

const bool AZ::TickEvents::EnableEventQueue = true
static

Enables the event queue, which you can use to execute actions just before the OnTick event.

◆ HandlerPolicy

const AZ::EBusHandlerPolicy AZ::TickEvents::HandlerPolicy = EBusHandlerPolicy::MultipleAndOrdered
static

Overrides the default AZ::EBusTraits handler policy so that multiple handlers can connect to the bus. This bus has one address because it
uses the default EBusTraits address policy. At the address, handlers receive events based on the order in which the components are initialized, unless a handler explicitly sets its TickEvents::m_tickOrder.

◆ m_tickOrder

int AZ::TickEvents::m_tickOrder
protected

Deprecated.

Deprecated:
Override GetTickOrder() to specify the order in which the handler receives tick events.

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