Skip to content
Flecs v4.1
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 */
27template <typename Kind>
30 const char *brief = nullptr,
31 const char *name = nullptr);
32
33/** @} */
untyped_component & metric(flecs::entity_t parent=0, const char *brief=nullptr, const char *name=nullptr)
Register a member as a metric.
ecs_entity_t entity_t
Entity type.
Definition c_types.hpp:21
flecs::string_view name() const
Return the entity name.
flecs::entity parent() const
Get parent of entity.
Definition impl.hpp:68
untyped_component()
Default constructor.