16template<
typename Base,
typename ... Components>
79 template <
typename Severity>
86 ecs_assert(severity_filter_count < ECS_ALERT_MAX_SEVERITY_FILTERS,
87 ECS_INVALID_PARAMETER,
"Maximum number of severity filters reached");
92 filter->severity = kind;
99 template <
typename Severity>
105 template <typename Severity, typename T, if_not_t< is_enum<T>::value > = 0>
112 template <typename Severity, typename T, if_t< is_enum<T>::value > = 0 >
128 Base&
id(flecs::id_t
id) {
134 template <
typename T>
135 Base&
member(
const char *m,
const char *v =
nullptr) {
138 world_v(),
id, m,
"::",
"::",
false);
139 ecs_assert(m != 0, ECS_INVALID_PARAMETER, NULL);
145 Base&
var(
const char *v) {
151 virtual flecs::world_t* world_v() = 0;
155 return *
static_cast<Base*
>(
this);
159 int32_t severity_filter_count = 0;
#define ecs_assert(condition, error_code,...)
Assert.
flecs::entity to_entity(E constant) const
Convert enum constant to entity.
#define ecs_ftime_t
Customizable precision for scalar time values.
ecs_entity_t ecs_lookup_path_w_sep(const ecs_world_t *world, ecs_entity_t parent, const char *path, const char *sep, const char *prefix, bool recursive)
Lookup an entity from a path.
Alert descriptor, used with ecs_alert_init().
ecs_alert_severity_filter_t severity_filters[(4)]
Severity filters can be used to assign different severities to the same alert.
const char * brief
Description of alert.
ecs_ftime_t retain_period
The retain period specifies how long an alert must be inactive before it is cleared.
ecs_entity_t member
Alert when member value is out of range.
ecs_id_t id
(Component) id of member to monitor.
ecs_entity_t severity
Metric kind.
ecs_query_desc_t query
Alert query.
const char * doc_name
User friendly name.
const char * message
Template for alert message.
const char * var
Variable from which to fetch the member (optional).
Base & severity_filter(flecs::id_t with, const char *var=nullptr)
Add severity filter.
Base & doc_name(const char *doc_name)
Set doc name for alert.
Base & message(const char *message)
Alert message.
Base & severity_filter(T with, const char *var=nullptr)
Add severity filter.
Base & severity()
Set severity of alert (default is Error)
Base & var(const char *v)
Set source variable for member (optional, defaults to $this)
Base & member(const char *m, const char *v=nullptr)
Set member to create an alert for out of range values.
Base & severity(flecs::entity_t kind)
Set severity of alert (default is Error)
Base & severity_filter(flecs::entity_t kind, flecs::id_t with, const char *var=nullptr)
Add severity filter.
Base & member(flecs::entity_t m)
Set member to create an alert for out of range values.
Base & id(flecs::id_t id)
Set (component) id for member (optional).
Base & brief(const char *brief)
Set brief description for alert.
Base & severity_filter(const char *var=nullptr)
Add severity filter.
flecs::id pair() const
Get pair id from relationship, object.