Skip to content
Flecs
v4.1
Search
Ctrl K
include
flecs
addons
cpp
mixins
metrics
untyped_component.inl
Go to the documentation of this file.
1
/**
2
* @file addons/cpp/mixins/metrics/untyped_component.inl
3
* @brief Metrics component mixin.
4
*/
5
6
/**
7
* @memberof flecs::component
8
* @ingroup cpp_addons_metrics
9
*
10
* @{
11
*/
12
13
/** Register a member as a metric.
14
* When no explicit name is provided, this operation will derive the metric name
15
* from the member name. When the member name is "value", the operation will use
16
* the name of the component.
17
*
18
* When the brief parameter is provided, it is set on the metric as if
19
* set_doc_brief() is used. The brief description can be obtained with
20
* get_doc_brief().
21
*
22
* @tparam Kind Metric kind (Counter, CounterIncrement, or Gauge).
23
* @param parent Parent entity of the metric (optional).
24
* @param brief Description for metric (optional).
25
* @param name Name of metric (optional).
26
*/
27
template
<
typename
Kind>
28
untyped_component
&
metric
(
29
flecs::entity_t
parent
= 0,
30
const
char
*brief =
nullptr
,
31
const
char
*
name
=
nullptr
);
32
33
/** @} */
flecs::component::metric
untyped_component & metric(flecs::entity_t parent=0, const char *brief=nullptr, const char *name=nullptr)
Register a member as a metric.
flecs::entity_t
ecs_entity_t entity_t
Entity type.
Definition
c_types.hpp:21
flecs::entity_view::name
flecs::string_view name() const
Return the entity name.
Definition
entity_view.hpp:88
flecs::entity_view::parent
flecs::entity parent() const
Get parent of entity.
Definition
impl.hpp:68
flecs::untyped_component::untyped_component
untyped_component()
Default constructor.
Definition
component.hpp:372
Esc
↑
↓
to navigate
↵
to open
Esc
to close