Skip to content
Flecs v4.1
builder.hpp
Go to the documentation of this file.
1/**
2 * @file addons/cpp/mixins/alerts/builder.hpp
3 * @brief Alert builder.
4 */
5
6#pragma once
7
9#include "builder_i.hpp"
10
11namespace flecs {
12namespace _ {
13 template <typename ... Components>
14 using alert_builder_base = builder<
15 alert<Components...>, ecs_alert_desc_t, alert_builder<Components...>,
16 alert_builder_i, Components ...>;
17}
18
19/** Alert builder.
20 *
21 * @ingroup cpp_addons_alerts
22 */
23template <typename ... Components>
24struct alert_builder final : _::alert_builder_base<Components...> {
25 alert_builder(flecs::world_t* world, const char *name = nullptr)
26 : _::alert_builder_base<Components...>(world)
27 {
28 _::populate_signature<Components...>(world, this);
29 this->set_name(name);
30 }
31};
32
33}
Alert builder interface.
struct ecs_alert_desc_t ecs_alert_desc_t
Alert descriptor, used with ecs_alert_init().
ecs_world_t world_t
World type.
Definition c_types.hpp:18
Int to enum.
Definition component.hpp:18
Base & name(const char *name)
Specify the value of the identifier by name.
Definition builder_i.hpp:58
The world.
Definition world.hpp:129
flecs::alert_builder< Comps... > alert(Args &&... args) const
Create an alert.
Builder base class.