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

#include <Component.h>

Public Types

typedef AZStd::vector< ComponentServiceTypeDependencyArrayType
 
typedef AZStd::vector< AZStd::stringStringWarningArray
 

Public Member Functions

virtual ComponentCreateComponent ()=0
 
virtual const char * GetName () const =0
 
virtual Uuid GetUuid () const =0
 
virtual void Reflect (ReflectContext *reflection) const =0
 
virtual void GetProvidedServices (DependencyArrayType &provided, const Component *instance) const
 
virtual void GetDependentServices (DependencyArrayType &dependent, const Component *instance) const
 
virtual void GetRequiredServices (DependencyArrayType &required, const Component *instance) const
 
virtual void GetIncompatibleServices (DependencyArrayType &incompatible, const Component *instance) const
 
virtual void GetWarnings (StringWarningArray &warnings, const Component *instance) const
 
virtual ComponentDescriptorGetDescriptor ()
 
virtual void ReleaseDescriptor ()
 
virtual ~ComponentDescriptor ()=default
 

Detailed Description

Provides an interface through which the system can get the details of a component and reflect the component data to a variety of contexts. If you implement a component descriptor, inherit from ComponentDescriptorHelper to implement additional functionality.

Member Typedef Documentation

◆ DependencyArrayType

The type of array that components use to specify provided, required, dependent, and incompatible services.

◆ StringWarningArray

This type of array is used by the warning

Constructor & Destructor Documentation

◆ ~ComponentDescriptor()

virtual AZ::ComponentDescriptor::~ComponentDescriptor ( )
virtualdefault

Destroys the descriptor, but you should call ReleaseDescriptor() instead of using this function.

Member Function Documentation

◆ CreateComponent()

virtual Component * AZ::ComponentDescriptor::CreateComponent ( )
pure virtual

Creates an instance of the component.

Returns
Returns a pointer to the component.

◆ GetDependentServices()

virtual void AZ::ComponentDescriptor::GetDependentServices ( DependencyArrayType dependent,
const Component instance 
) const
inlinevirtual

Specifies the services that the component depends on, but does not require. The system activates the dependent services before it activates this component. It also deactivates the dependent services after it deactivates this component. If a dependent service is missing before this component is activated, the system does not return an error and still activates this component.

Parameters
providedArray of dependent services.
instanceOptional parameter with which you can refine services for each instance. This value is null if no instance exists.

◆ GetDescriptor()

virtual ComponentDescriptor * AZ::ComponentDescriptor::GetDescriptor ( )
inlinevirtual

Gets the current descriptor.

Parameters
instanceThe current descriptor.

◆ GetIncompatibleServices()

virtual void AZ::ComponentDescriptor::GetIncompatibleServices ( DependencyArrayType incompatible,
const Component instance 
) const
inlinevirtual

Specifies the services that the component cannot operate with. For example, if two components provide a similar service and the system cannot use the services simultaneously, each of those components would specify the other component as an incompatible service.

Parameters
providedArray to fill with incompatible services.
instanceOptional parameter with which you can refine services for each instance. This value is null if no instance exists.

◆ GetName()

virtual const char * AZ::ComponentDescriptor::GetName ( ) const
pure virtual

Gets the name of the component.

Returns
Returns a pointer to the name of the component.

◆ GetProvidedServices()

virtual void AZ::ComponentDescriptor::GetProvidedServices ( DependencyArrayType provided,
const Component instance 
) const
inlinevirtual

Specifies the services that the component provides. The system uses this information to determine when to create the component.

Parameters
providedArray of provided services.
instanceOptional parameter with which you can refine services for each instance. This value is null if no instance exists.

◆ GetRequiredServices()

virtual void AZ::ComponentDescriptor::GetRequiredServices ( DependencyArrayType required,
const Component instance 
) const
inlinevirtual

Specifies the services that the component requires. The system activates the required services before it activates this component. It also deactivates the required services after it deactivates this component. If a required service is missing before this component is activated, the system returns an error and does not activate this component.

Parameters
providedArray of required services.
instanceOptional parameter with which you can refine services for each instance. This value is null if no instance exists.

◆ GetUuid()

virtual Uuid AZ::ComponentDescriptor::GetUuid ( ) const
pure virtual

Gets the ID of the component.

Returns
Returns a pointer to the component ID.

◆ GetWarnings()

virtual void AZ::ComponentDescriptor::GetWarnings ( StringWarningArray warnings,
const Component instance 
) const
inlinevirtual

Specifies warnings that you want in the component (will put a warning and a continue button).

Parameters
warningsprovided array of strings that would be the actual warnings.
instanceOptional parameter with which you can refine services for each instance. This value is null if no instance exists.

◆ Reflect()

virtual void AZ::ComponentDescriptor::Reflect ( ReflectContext reflection) const
pure virtual

Reflects component data into a variety of contexts (script, serialize, edit, and so on).

Parameters
reflectionA pointer to the reflection context.

◆ ReleaseDescriptor()

virtual void AZ::ComponentDescriptor::ReleaseDescriptor ( )
virtual

Calls ComponentApplicationBus::UnregisterComponentDescriptor and deletes the descriptor.


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