Flecs: Observers
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.1 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
Observers
C++ API » Core

Observers let applications register callbacks for ECS events. More...

Collaboration diagram for Observers:

## Classes
struct | flecs::observer_builder< Components >
| Observer builder. More...
struct | flecs::observer_builder_i< Base, Components >
| Observer builder interface. More...
flecs::observer | flecs::world::observer (flecs::entity e) const
| Observer builder.
template<typename... Components, typename... Args>
flecs::observer_builder< Components... > | observer (Args &&... args) const
| Create a new observer.

## Detailed Description

Observers let applications register callbacks for ECS events.

## Function Documentation

## ◆ observer() [1/2]

template<typename... Components, typename... Args>

flecs::observer_builder< Components... > observer | ( | Args &&... | args | ) | const
| related

Create a new observer.

Template Parameters

  Components | The components to match on.
  Args | Arguments passed to the constructor of flecs::observer_builder.

Returns
  Observer builder.

## ◆ observer() [2/2]

observer flecs::world::observer | ( | flecs::entity | e | ) | const
| inline

Observer builder.

Upcast entity to an observer. The provided entity must be an observer.

Parameters

  e | The entity.

Returns
  An observer object.

Definition at line 41 of file impl.hpp.