Skip to main content

ComponentOps Struct

Container for type-erased component lifecycle function pointers. More...

Declaration

struct helios::engine::ecs::ComponentOps { ... }

Public Member Typedefs Index

usingOnAcquireFn = void(*)(void *)

Function signature for pool acquisition callback. More...

usingOnReleaseFn = void(*)(void *)

Function signature for pool release callback. More...

usingOnRemoveFn = bool(*)(void *)

Function signature for removal interception callback. More...

usingEnableFn = void(*)(void *)

Function signature for component enable callback. More...

usingDisableFn = void(*)(void *)

Function signature for component disable callback. More...

usingCloneFn = void *(*)(void *manager, const void *source, const EntityHandle *target)

Function signature for component cloning. More...

usingOnActivateFn = void(*)(void *)

Function signature for GameObject activation callback. More...

usingOnDeactivateFn = void(*)(void *)

Function signature for GameObject deactivation callback. More...

Public Member Attributes Index

OnAcquireFnonAcquire = nullptr

Called when entity is acquired from an object pool. More...

OnReleaseFnonRelease = nullptr

Called when entity is released back to an object pool. More...

OnRemoveFnonRemove = nullptr

Called before component removal. Return `false` to block. More...

EnableFnenable = nullptr

Called to enable the component. More...

DisableFndisable = nullptr

Called to disable the component. More...

CloneFnclone = nullptr

Called to clone the component to a target entity. More...

OnActivateFnonActivate = nullptr

Called when the owning GameObject is activated. More...

OnDeactivateFnonDeactivate = nullptr

Called when the owning GameObject is deactivated. More...

Description

Container for type-erased component lifecycle function pointers.

`ComponentOps` enables runtime invocation of component lifecycle hooks without knowing the concrete component type. Function pointers are set during type registration via `ComponentReflector::registerType<T>()`.

## Type Erasure Pattern

```cpp // At registration (type known): ComponentOps ops{ .onAcquire = [](void* ptr) { static_cast<HealthComponent*>(ptr)->onAcquire(); } };

// At runtime (type erased): if (ops.onAcquire) { ops.onAcquire(rawComponent); } ```

See Also

ComponentOpsRegistry

See Also

ComponentReflector

See Also

Traits

Definition at line 40 of file ComponentOps.ixx.

Public Member Typedefs

CloneFn

using helios::engine::ecs::ComponentOps::CloneFn = void*(*)(void* manager, const void* source, const EntityHandle* target)

Function signature for component cloning.

Parameters
manager

Raw pointer to the EntityManager.

source

Raw pointer to the source component.

target

Pointer to the target EntityHandle.

Returns

Raw pointer to the newly created component.

Definition at line 88 of file ComponentOps.ixx.

88 using CloneFn = void*(*)(void* manager, const void* source, const EntityHandle* target);

DisableFn

using helios::engine::ecs::ComponentOps::DisableFn = void(*)(void*)

Function signature for component disable callback.

Parameters
ptr

Raw pointer to the component instance.

Definition at line 77 of file ComponentOps.ixx.

77 using DisableFn = void(*)(void*);

EnableFn

using helios::engine::ecs::ComponentOps::EnableFn = void(*)(void*)

Function signature for component enable callback.

Parameters
ptr

Raw pointer to the component instance.

Definition at line 70 of file ComponentOps.ixx.

70 using EnableFn = void(*)(void*);

OnAcquireFn

using helios::engine::ecs::ComponentOps::OnAcquireFn = void(*)(void*)

Function signature for pool acquisition callback.

Parameters
ptr

Raw pointer to the component instance.

Definition at line 47 of file ComponentOps.ixx.

47 using OnAcquireFn = void(*)(void*);

OnActivateFn

using helios::engine::ecs::ComponentOps::OnActivateFn = void(*)(void*)

Function signature for GameObject activation callback.

Parameters
ptr

Raw pointer to the component instance.

Definition at line 95 of file ComponentOps.ixx.

95 using OnActivateFn = void(*)(void*);

OnDeactivateFn

using helios::engine::ecs::ComponentOps::OnDeactivateFn = void(*)(void*)

Function signature for GameObject deactivation callback.

Parameters
ptr

Raw pointer to the component instance.

Definition at line 102 of file ComponentOps.ixx.

102 using OnDeactivateFn = void(*)(void*);

OnReleaseFn

using helios::engine::ecs::ComponentOps::OnReleaseFn = void(*)(void*)

Function signature for pool release callback.

Parameters
ptr

Raw pointer to the component instance.

Definition at line 54 of file ComponentOps.ixx.

54 using OnReleaseFn = void(*)(void*);

OnRemoveFn

using helios::engine::ecs::ComponentOps::OnRemoveFn = bool(*)(void*)

Function signature for removal interception callback.

Parameters
ptr

Raw pointer to the component instance.

Returns

`true` to allow removal, `false` to prevent it.

Definition at line 63 of file ComponentOps.ixx.

63 using OnRemoveFn = bool(*)(void*);

Public Member Attributes

clone

CloneFn helios::engine::ecs::ComponentOps::clone = nullptr

Called to clone the component to a target entity.

Definition at line 132 of file ComponentOps.ixx.

132 CloneFn clone = nullptr;

disable

DisableFn helios::engine::ecs::ComponentOps::disable = nullptr

Called to disable the component.

Definition at line 127 of file ComponentOps.ixx.

127 DisableFn disable = nullptr;

enable

EnableFn helios::engine::ecs::ComponentOps::enable = nullptr

Called to enable the component.

Definition at line 122 of file ComponentOps.ixx.

122 EnableFn enable = nullptr;

onAcquire

OnAcquireFn helios::engine::ecs::ComponentOps::onAcquire = nullptr

Called when entity is acquired from an object pool.

Definition at line 107 of file ComponentOps.ixx.

onActivate

OnActivateFn helios::engine::ecs::ComponentOps::onActivate = nullptr

Called when the owning GameObject is activated.

Definition at line 137 of file ComponentOps.ixx.

onDeactivate

OnDeactivateFn helios::engine::ecs::ComponentOps::onDeactivate = nullptr

Called when the owning GameObject is deactivated.

Definition at line 142 of file ComponentOps.ixx.

onRelease

OnReleaseFn helios::engine::ecs::ComponentOps::onRelease = nullptr

Called when entity is released back to an object pool.

Definition at line 112 of file ComponentOps.ixx.

onRemove

OnRemoveFn helios::engine::ecs::ComponentOps::onRemove = nullptr

Called before component removal. Return `false` to block.

Definition at line 117 of file ComponentOps.ixx.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.