Menu
Lumberyard
C++ API Reference (Version 1.10)

AZ::ComponentDescriptor Class Referenceabstract

Provides an interface through which the system can get the details of a component and reflect the component data to a variety of contexts. More...

Public Types

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

Public Member Functions

virtual ComponentCreateComponent ()=0
 Creates an instance of the component. More...
 
virtual const char * GetName () const =0
 Gets the name of the component. More...
 
virtual const Uuid & GetUuid () const =0
 Gets the ID of the component. More...
 
virtual void Reflect (ReflectContext *reflection) const =0
 Reflects component data into a variety of contexts (script, serialize, edit, and so on). More...
 
virtual void GetProvidedServices (DependencyArrayType &provided, const Component *instance) const
 Specifies the services that the component provides. More...
 
virtual void GetDependentServices (DependencyArrayType &dependent, const Component *instance) const
 Specifies the services that the component depends on, but does not require. More...
 
virtual void GetRequiredServices (DependencyArrayType &required, const Component *instance) const
 Specifies the services that the component requires. More...
 
virtual void GetIncompatibleServices (DependencyArrayType &incompatible, const Component *instance) const
 Specifies the services that the component cannot operate with. More...
 
virtual ComponentDescriptorGetDescriptor ()
 Gets the current descriptor. More...
 
virtual void ReleaseDescriptor ()
 Calls ComponentApplicationBus::UnregisterComponentDescriptor and deletes the descriptor. More...
 
virtual ~ComponentDescriptor ()=default
 Destroys the descriptor, but you should call ReleaseDescriptor() instead of using this function. More...
 

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.

This is a fixed vector because we are typically using the array on the stack.

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 const Uuid& AZ::ComponentDescriptor::GetUuid ( ) const
pure virtual

Gets the ID of the component.

Returns
Returns a pointer to the component ID.

◆ 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:
  • C:/lumberyard-root/dev/Code/Framework/AzCore/AzCore/Component/Component.h