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::SliceMetadataInfoComponent Class Reference

#include <SliceMetadataInfoComponent.h>

Inherits AZ::Component, SliceMetadataInfoRequestBus::Handler, AZ::EntityBus::MultiHandler, and SliceMetadataInfoManipulationBus::Handler.

Public Types

using EntityIdSet = AZStd::unordered_set< AZ::EntityId >
 

Public Member Functions

 AZ_COMPONENT (SliceMetadataInfoComponent, "{25EE4D75-8A17-4449-81F4-E561005BAABD}")
 
 SliceMetadataInfoComponent (bool persistent=false)
 
 ~SliceMetadataInfoComponent () override
 
void AddChildMetadataEntity (EntityId childEntityId) override
 
void RemoveChildMetadataEntity (EntityId childEntityId) override
 
void SetParentMetadataEntity (EntityId parentEntityId) override
 
void AddAssociatedEntity (EntityId associatedEntityId) override
 
void RemoveAssociatedEntity (EntityId associatedEntityId) override
 
void MarkAsPersistent (bool persistent) override
 
void Activate () override
 
void Deactivate () override
 
- Public Member Functions inherited from AZ::Component
 AZ_TYPE_INFO_WITH_NAME_DECL (Component)
 
 AZ_RTTI_NO_TYPE_INFO_DECL ()
 
 Component ()
 
virtual ~Component ()
 
EntityGetEntity () const
 
EntityId GetEntityId () const
 
NamedEntityId GetNamedEntityId () const
 
ComponentId GetId () const
 
virtual TypeId GetUnderlyingComponentType () const
 
void SetId (const ComponentId &id)
 
virtual void SetSerializedIdentifier (AZStd::string serializedIdentifer)
 
virtual AZStd::string GetSerializedIdentifier () const
 
virtual ComponentValidationResult ValidateComponentRequirements (const ImmutableEntityVector &, const AZStd::unordered_set< AZ::Crc32 > &) const
 
bool SetConfiguration (const AZ::ComponentConfig &config)
 
bool GetConfiguration (AZ::ComponentConfig &outConfig) const
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Protected Member Functions

void OnEntityDestruction (const AZ::EntityId &entityId) override
 
bool IsAssociated (EntityId entityId) override
 
void GetAssociatedEntities (AZStd::set< EntityId > &associatedEntityIds) override
 
AZ::EntityId GetParentId () override
 
void GetChildIDs (AZStd::unordered_set< EntityId > &childEntityIds) override
 
size_t GetAssociationCount () override
 
void CheckDependencyCount ()
 
AZ::ExportedComponent ExportComponent (AZ::Component *thisComponent, const AZ::PlatformTagSet &platformTags)
 
- Protected Member Functions inherited from AZ::Component
virtual void Init ()
 
virtual void Activate ()=0
 
virtual void Deactivate ()=0
 
virtual bool ReadInConfig (const ComponentConfig *baseConfig)
 
virtual bool WriteOutConfig (ComponentConfig *outBaseConfig) const
 
virtual void SetEntity (Entity *entity)
 
virtual void OnAfterEntitySet ()
 Function to call after setting the entity in this component.
 

Static Protected Member Functions

static void GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided)
 
static void GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible)
 

Protected Attributes

friend SliceComponent
 
SliceMetadataInfoNotificationBus::BusPtr m_notificationBus
 
AZStd::set< AZ::EntityIdm_associatedEntities
 Entity Association Data.
 
AZ::EntityId m_parent
 
EntityIdSet m_children
 
bool m_persistent
 
- Protected Attributes inherited from AZ::Component
Entitym_entity
 Reference to the entity that owns the component. The value is null if the component is not attached to an entity.
 
ComponentId m_id
 A component ID that is unique for an entity. This component ID is not unique across all entities.
 

Detailed Description

Slice Metadata Entity Information Component This component maintains a list of all of the entities that are associated with a slice metadata entity. An associated entity is defined as one that is new to the slice at the nested level that the metadata entity is associated with, that is, it wasn't inherited from a base slice. All entities in every slice are associated with exactly one metadata entity. In addition to associated editor entities, this component also tracks any metadata entities belonging to any root slices referenced by the associated slice as well as, if applicable, the metadata entity belonging to the slice holding the reference to the associated slice.

Constructor & Destructor Documentation

◆ SliceMetadataInfoComponent()

AZ::SliceMetadataInfoComponent::SliceMetadataInfoComponent ( bool  persistent = false)

Metadata Info Component Constructor

Parameters
persistentTrue if this info component should be persistent. A persistent component will not emit a notification when it has no dependencies. Only the actual destruction of the metadata entity will remove it from the context.

◆ ~SliceMetadataInfoComponent()

AZ::SliceMetadataInfoComponent::~SliceMetadataInfoComponent ( )
override

Destructor (Default)

Member Function Documentation

◆ Activate()

void AZ::SliceMetadataInfoComponent::Activate ( )
overridevirtual

Puts the component into an active state. The system calls this function once during activation of each entity that owns the component. You must override this function. The system calls a component's Activate() function only if all services and components that the component depends on are present and active. Use GetProvidedServices and GetDependentServices to specify these dependencies.

Implements AZ::Component.

◆ CheckDependencyCount()

void AZ::SliceMetadataInfoComponent::CheckDependencyCount ( )
protected

Gets the number of objects that are attached to this metadata entity. This includes both associated editor entities and child metadata entities belonging to referenced slices. If the dependency count is zero, this will send an OnMetadataDependenciesRemoved notification. Because this could result in the destruction of the metadata entity, be careful when calling this. This function does nothing if the component is marked as persistent. Note: This function can trigger the removal of the owning entity from the metadata context but can not trigger the deletion of the entity itself.

◆ Deactivate()

void AZ::SliceMetadataInfoComponent::Deactivate ( )
overridevirtual

Deactivates the component. The system calls this function when the owning entity is being deactivated. You must override this function. As a best practice, ensure that this function returns the component to a minimal footprint. The order of deactivation is the reverse of activation, so your component is deactivated before the components it depends on.

The system always calls the component's Deactivate() function before destroying the component. However, deactivation is not always followed by the destruction of the component. An entity and its components can be deactivated and reactivated without being destroyed. Ensure that your Deactivate() implementation can handle this scenario.

Implements AZ::Component.

◆ ExportComponent()

AZ::ExportedComponent AZ::SliceMetadataInfoComponent::ExportComponent ( AZ::Component thisComponent,
const AZ::PlatformTagSet platformTags 
)
protected

Handles the runtime export of the SliceMetadataInfoComponent.
The SliceMetadataInfo component shouldn't exist at runtime, so the export function returns a null component.

Parameters
thisComponentThe source component that is being exported.
platformTagsThe set of platforms to export for.
Returns
The exported component, along with a flag on whether or not to delete it at the end of the export process.

◆ GetIncompatibleServices()

static void AZ::SliceMetadataInfoComponent::GetIncompatibleServices ( AZ::ComponentDescriptor::DependencyArrayType incompatible)
staticprotected

Component Descriptor - Incompatible Services

Parameters
incompatibleAn array to fill out with all the services this component is incompatible with

◆ GetProvidedServices()

static void AZ::SliceMetadataInfoComponent::GetProvidedServices ( AZ::ComponentDescriptor::DependencyArrayType provided)
staticprotected

Component Descriptor - Provided Services

Parameters
providedAn array to fill out with all the services this component is dependent on

◆ Reflect()

static void AZ::SliceMetadataInfoComponent::Reflect ( AZ::ReflectContext context)
static

Component Descriptor - Component Reflection

Parameters
contextA reflection context

Member Data Documentation

◆ m_associatedEntities

AZStd::set<AZ::EntityId> AZ::SliceMetadataInfoComponent::m_associatedEntities
protected

Entity Association Data.

A list of editor entities associated with this slice metadata An associated entity is one that is new to this slice as opposed to an entity cloned from a referenced slice. Every editor entity should always be associated with exactly one metadata entity. Entities that are not part of slices are associated with the metadata component belonging to the root slice.

◆ m_children

EntityIdSet AZ::SliceMetadataInfoComponent::m_children
protected

The IDs of each metadata entity associated with an slice instance belonging to the associated slice.

◆ m_notificationBus

SliceMetadataInfoNotificationBus::BusPtr AZ::SliceMetadataInfoComponent::m_notificationBus
protected

A bus pointer for emitting addressed notifications

◆ m_parent

AZ::EntityId AZ::SliceMetadataInfoComponent::m_parent
protected

If the associated slice instance belongs to another slice, this is the ID of the metadata entity associated with that parent slice instance. Note: The root entity will never show up as a parent. Slices that are not instances belonging to a non-root slice have no parent.

◆ m_persistent

bool AZ::SliceMetadataInfoComponent::m_persistent
protected

The persistence flag indicates that the object is valid even without dependencies and will not emit the OnMetadataDependenciesRemoved notification when it's dependency count goes to 0. For example: The Root Slice.


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