Flecs: ecs_alert_desc_t Struct Reference
Description: A fast entity component system (ECS) for C & C++

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

Loading...
Searching...
No Matches
Public Attributes | List of all members
ecs_alert_desc_t Struct Reference
C API » Addons » Alerts

Alert descriptor, used with ecs_alert_init(). More...

`#include <alerts.h>`

## Public Attributes
int32_t | _canary
ecs_entity_t | entity
| Entity associated with alert.
ecs_query_desc_t | query
| Alert query.
const char * | message
| Template for alert message.
const char * | doc_name
| User friendly name.
const char * | brief
| Description of alert.
ecs_entity_t | severity
| Metric kind.
ecs_alert_severity_filter_t | severity_filters [(4)]
| Severity filters can be used to assign different severities to the same 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.
const char * | var
| Variable from which to fetch the member (optional).

## Detailed Description

Alert descriptor, used with ecs_alert_init().

Definition at line 77 of file alerts.h.

## Member Data Documentation

## ◆ _canary

int32_t ecs_alert_desc_t::_canary

Definition at line 78 of file alerts.h.

## ◆ brief

const char* ecs_alert_desc_t::brief

Description of alert.

Will only be set if FLECS_DOC addon is enabled

Definition at line 103 of file alerts.h.

## ◆ doc_name

const char* ecs_alert_desc_t::doc_name

User friendly name.

Will only be set if FLECS_DOC addon is enabled.

Definition at line 100 of file alerts.h.

## ◆ entity

ecs_entity_t ecs_alert_desc_t::entity

Entity associated with alert.

Definition at line 81 of file alerts.h.

## ◆ id

ecs_id_t ecs_alert_desc_t::id

(Component) id of member to monitor.

If left to 0 this will be set to the parent entity of the member (optional).

Definition at line 128 of file alerts.h.

## ◆ member

ecs_entity_t ecs_alert_desc_t::member

Alert when member value is out of range.

Uses the warning/error ranges assigned to the member in the MemberRanges component (optional).

Definition at line 124 of file alerts.h.

## ◆ message

const char* ecs_alert_desc_t::message

Template for alert message.

This string is used to generate the alert message and may refer to variables in the query result. The format for the template expressions is as specified by ecs_script_string_interpolate().

Examples:

    "$this has Position but not Velocity"
    "$this has a parent entity $parent without Position"

Definition at line 97 of file alerts.h.

## ◆ query

ecs_query_desc_t ecs_alert_desc_t::query

Alert query.

An alert will be created for each entity that matches the specified query. The query must have at least one term that uses the $this variable (default).

Definition at line 86 of file alerts.h.

## ◆ retain_period

ecs_ftime_t ecs_alert_desc_t::retain_period

The retain period specifies how long an alert must be inactive before it is cleared.

This makes it easier to track noisy alerts. While an alert is inactive its duration won't increase. When the retain period is 0, the alert will clear immediately after it no longer matches the alert query.

Definition at line 120 of file alerts.h.

## ◆ severity

ecs_entity_t ecs_alert_desc_t::severity

Metric kind.

Must be EcsAlertInfo, EcsAlertWarning, EcsAlertError or EcsAlertCritical. Defaults to EcsAlertError.

Definition at line 107 of file alerts.h.

## ◆ severity_filters

ecs_alert_severity_filter_t ecs_alert_desc_t::severity_filters[(4)]

Severity filters can be used to assign different severities to the same alert.

This prevents having to create multiple alerts, and allows entities to transition between severities without resetting the alert duration (optional).

Definition at line 113 of file alerts.h.

## ◆ var

const char* ecs_alert_desc_t::var

Variable from which to fetch the member (optional).

When left to NULL 'id' will be obtained from $this.

Definition at line 132 of file alerts.h.

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

- include/flecs/addons/alerts.h