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::ComponentApplicationRequests Class Referenceabstract

Interface that components can use to make requests of the main application. More...

#include <ComponentApplicationBus.h>

Public Types

using EntityCallback = AZStd::function< void(Entity *)>
 

Public Member Functions

 AZ_RTTI (ComponentApplicationRequests, "{E8BE41B7-615F-4FE8-B611-8A9E441290A8}")
 
virtual ~ComponentApplicationRequests ()=default
 Destroys the event bus that components use to make requests of the main application.
 
virtual void RegisterComponentDescriptor (const ComponentDescriptor *descriptor)=0
 
virtual void UnregisterComponentDescriptor (const ComponentDescriptor *descriptor)=0
 
virtual ComponentApplicationGetApplication ()=0
 
virtual void RegisterEntityAddedEventHandler (EntityAddedEvent::Handler &handler)=0
 
virtual void RegisterEntityRemovedEventHandler (EntityRemovedEvent::Handler &handler)=0
 
virtual void RegisterEntityActivatedEventHandler (EntityActivatedEvent::Handler &handler)=0
 
virtual void RegisterEntityDeactivatedEventHandler (EntityDeactivatedEvent::Handler &handler)=0
 
virtual void SignalEntityActivated (AZ::Entity *entity)=0
 
virtual void SignalEntityDeactivated (AZ::Entity *entity)=0
 
virtual bool AddEntity (Entity *entity)=0
 
virtual bool RemoveEntity (Entity *entity)=0
 
virtual bool DeleteEntity (const EntityId &id)=0
 
virtual EntityFindEntity (const EntityId &id)=0
 
virtual AZStd::string GetEntityName (const EntityId &id)
 
virtual bool SetEntityName (const EntityId &id, const AZStd::string_view name)
 
virtual void EnumerateEntities (const EntityCallback &callback)=0
 
virtual class SerializeContextGetSerializeContext ()=0
 
virtual class BehaviorContextGetBehaviorContext ()=0
 
virtual class JsonRegistrationContextGetJsonRegistrationContext ()=0
 
virtual const char * GetEngineRoot () const =0
 
virtual const char * GetExecutableFolder () const =0
 
virtual void ResolveModulePath (AZ::OSString &modulePath)
 
virtual AZ::CommandLineGetAzCommandLine ()
 
virtual void QueryApplicationType (ApplicationTypeQuery &appType) const =0
 Returns all the flags that are true for the current application.
 

Detailed Description

Interface that components can use to make requests of the main application.

Member Typedef Documentation

◆ EntityCallback

The type that AZ::ComponentApplicationRequests::EnumerateEntities uses to pass entity callbacks to the application for enumeration.

Member Function Documentation

◆ AddEntity()

virtual bool AZ::ComponentApplicationRequests::AddEntity ( Entity entity)
pure virtual

Adds an entity to the application's registry. Calling Init() on an entity automatically performs this operation.

Parameters
entityA pointer to the entity to add to the application's registry.
Returns
True if the operation succeeded. False if the operation failed.

◆ DeleteEntity()

virtual bool AZ::ComponentApplicationRequests::DeleteEntity ( const EntityId id)
pure virtual

Unregisters and deletes the specified entity.

Parameters
entityA reference to the entity that will be unregistered and deleted.
Returns
True if the operation succeeded. False if the operation failed.

◆ EnumerateEntities()

virtual void AZ::ComponentApplicationRequests::EnumerateEntities ( const EntityCallback callback)
pure virtual

Enumerates all registered entities and invokes the specified callback for each entity.

Parameters
callbackA reference to the callback that is invoked for each entity.

◆ FindEntity()

virtual Entity * AZ::ComponentApplicationRequests::FindEntity ( const EntityId id)
pure virtual

Returns the entity with the matching ID, if the entity is registered with the application.

Parameters
entityA reference to the entity that you are searching for.
Returns
A pointer to the entity with the specified entity ID.

◆ GetApplication()

virtual ComponentApplication * AZ::ComponentApplicationRequests::GetApplication ( )
pure virtual

Gets a pointer to the application.

Returns
A pointer to the application.

◆ GetAzCommandLine()

virtual AZ::CommandLine * AZ::ComponentApplicationRequests::GetAzCommandLine ( )
inlinevirtual

Returns AZ parsed command line structure. Command Line structure can be queried for switches (-<switch> /<switch>) or positional parameter (

)

◆ GetBehaviorContext()

virtual class BehaviorContext * AZ::ComponentApplicationRequests::GetBehaviorContext ( )
pure virtual

Returns the behavior context that was registered with the app.

Returns
The behavior context, if there is one. BehaviorContext is a class that reflects classes, methods, and EBuses for runtime interaction.

◆ GetEngineRoot()

virtual const char * AZ::ComponentApplicationRequests::GetEngineRoot ( ) const
pure virtual

Gets the path of the working engine folder that the app is a part of.

Returns
a pointer to the engine path.

◆ GetEntityName()

virtual AZStd::string AZ::ComponentApplicationRequests::GetEntityName ( const EntityId id)
inlinevirtual

Returns the name of the entity that has the specified entity ID. Entity names are not unique. This method exists to facilitate better debugging messages.

Parameters
entityA reference to the entity whose name you are seeking.
Returns
The name of the entity with the specified entity ID. If no entity is found for the specified ID, it returns an empty string.

◆ GetExecutableFolder()

virtual const char * AZ::ComponentApplicationRequests::GetExecutableFolder ( ) const
pure virtual

Gets the path to the directory that contains the application's executable.

Returns
a pointer to the name of the path that contains the application's executable.

◆ GetJsonRegistrationContext()

virtual class JsonRegistrationContext * AZ::ComponentApplicationRequests::GetJsonRegistrationContext ( )
pure virtual

Returns the Json Registration context that was registered with the app.

Returns
The Json Registration context, if there is one. JsonRegistrationContext is a class that contains the serializers used by the best-effort json serialization.

◆ GetSerializeContext()

virtual class SerializeContext * AZ::ComponentApplicationRequests::GetSerializeContext ( )
pure virtual

Returns the serialize context that was registered with the app.

Returns
The serialize context, if there is one. SerializeContext is a class that contains reflection data for serialization and construction of objects.

◆ RegisterComponentDescriptor()

virtual void AZ::ComponentApplicationRequests::RegisterComponentDescriptor ( const ComponentDescriptor descriptor)
pure virtual

Registers a component descriptor with the application.

Parameters
descriptorA component descriptor.

◆ RegisterEntityActivatedEventHandler()

virtual void AZ::ComponentApplicationRequests::RegisterEntityActivatedEventHandler ( EntityActivatedEvent::Handler handler)
pure virtual

Registers an event handler that will be signalled whenever an entity is added.

Parameters
handlerthe event handler to signal.

◆ RegisterEntityAddedEventHandler()

virtual void AZ::ComponentApplicationRequests::RegisterEntityAddedEventHandler ( EntityAddedEvent::Handler handler)
pure virtual

Registers an event handler that will be signalled whenever an entity is added.

Parameters
handlerthe event handler to signal.

◆ RegisterEntityDeactivatedEventHandler()

virtual void AZ::ComponentApplicationRequests::RegisterEntityDeactivatedEventHandler ( EntityDeactivatedEvent::Handler handler)
pure virtual

Registers an event handler that will be signalled whenever an entity is removed.

Parameters
handlerthe event handler to signal.

◆ RegisterEntityRemovedEventHandler()

virtual void AZ::ComponentApplicationRequests::RegisterEntityRemovedEventHandler ( EntityRemovedEvent::Handler handler)
pure virtual

Registers an event handler that will be signalled whenever an entity is removed.

Parameters
handlerthe event handler to signal.

◆ RemoveEntity()

virtual bool AZ::ComponentApplicationRequests::RemoveEntity ( Entity entity)
pure virtual

Removes the specified entity from the application's registry. Deleting an entity automatically performs this operation.

Parameters
entityA pointer to the entity that will be removed from the application's registry.
Returns
True if the operation succeeded. False if the operation failed.

◆ ResolveModulePath()

virtual void AZ::ComponentApplicationRequests::ResolveModulePath ( AZ::OSString modulePath)
inlinevirtual

ResolveModulePath is called whenever LoadDynamicModule wants to resolve a module in order to actually load it. You can override this if you need to load modules from a different path or hijack module loading in some other way. If you do, ensure that you use platform-specific conventions to do so, as this is called by multiple platforms. The default implantation prepends the path to the executable to the module path, but you can override this behavior (Call the base class if you want this behavior to persist in overrides)

◆ SetEntityName()

virtual bool AZ::ComponentApplicationRequests::SetEntityName ( const EntityId id,
const AZStd::string_view  name 
)
inlinevirtual

Sets the name of the entity that has the specified entity ID. Entity names are not enforced to be unique.

Parameters
entityIdA reference to the entity whose name you want to change.
Returns
True if the name was changed successfully, false if it wasn't.

◆ SignalEntityActivated()

virtual void AZ::ComponentApplicationRequests::SignalEntityActivated ( AZ::Entity entity)
pure virtual

Signals that the provided entity has been activated.

Parameters
entitythe entity being activated.

◆ SignalEntityDeactivated()

virtual void AZ::ComponentApplicationRequests::SignalEntityDeactivated ( AZ::Entity entity)
pure virtual

Signals that the provided entity has been deactivated.

Parameters
entitythe entity being deactivated.

◆ UnregisterComponentDescriptor()

virtual void AZ::ComponentApplicationRequests::UnregisterComponentDescriptor ( const ComponentDescriptor descriptor)
pure virtual

Unregisters a component descriptor with the application.

Parameters
descriptorA component descriptor.

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