Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs::metric_builder Struct Reference

Metric builder interface. More...

#include <builder.hpp>

Public Member Functions

 metric_builder (flecs::world_t *world, flecs::entity_t entity)
 Construct a metric builder.
 
 ~metric_builder ()
 Destructor.
 
metric_buildermember (flecs::entity_t e)
 Set the member to use for the metric by entity ID.
 
metric_buildermember (const char *name)
 Set the member to use for the metric by name.
 
template<typename T >
metric_buildermember (const char *name)
 Set the member to use for the metric by type and name.
 
metric_builderdotmember (const char *name)
 Set the member to use for the metric using dot notation.
 
template<typename T >
metric_builderdotmember (const char *name)
 Set the member to use for the metric by type using dot notation.
 
metric_builderid (flecs::id_t the_id)
 Set the ID for the metric.
 
metric_builderid (flecs::entity_t first, flecs::entity_t second)
 Set the ID for the metric as a pair.
 
template<typename T >
metric_builderid ()
 Set the ID for the metric by type.
 
template<typename First >
metric_builderid (flecs::entity_t second)
 Set the ID for the metric as a pair with type First.
 
template<typename Second >
metric_builderid_second (flecs::entity_t first)
 Set the ID for the metric as a pair with type Second.
 
template<typename First , typename Second >
metric_builderid ()
 Set the ID for the metric as a pair with types First and Second.
 
metric_buildertargets (bool value=true)
 Set whether to create metrics for targets.
 
metric_builderkind (flecs::entity_t the_kind)
 Set the metric kind (e.g., Counter, Gauge).
 
template<typename Kind >
metric_builderkind ()
 Set the metric kind by type.
 
metric_builderbrief (const char *b)
 Set a brief description for the metric.
 
 operator flecs::entity ()
 Finalize the metric and return the entity.
 

Protected Attributes

flecs::world_tworld_
 
ecs_metric_desc_t desc_ = {}
 
bool created_ = false
 

Detailed Description

Metric builder interface.

Definition at line 16 of file builder.hpp.

Constructor & Destructor Documentation

◆ metric_builder()

flecs::metric_builder::metric_builder ( flecs::world_t * world,
flecs::entity_t entity )
inline

Construct a metric builder.

Definition at line 18 of file builder.hpp.

◆ ~metric_builder()

flecs::metric_builder::~metric_builder ( )
inline

Destructor.

Finalizes the metric.

Definition at line 27 of file impl.hpp.

Member Function Documentation

◆ brief()

metric_builder & flecs::metric_builder::brief ( const char * b)
inline

Set a brief description for the metric.

Definition at line 102 of file builder.hpp.

◆ dotmember() [1/2]

metric_builder & flecs::metric_builder::dotmember ( const char * name)
inline

Set the member to use for the metric using dot notation.

Definition at line 59 of file impl.hpp.

◆ dotmember() [2/2]

template<typename T >
metric_builder & flecs::metric_builder::dotmember ( const char * name)
inline

Set the member to use for the metric by type using dot notation.

Definition at line 65 of file impl.hpp.

◆ id() [1/5]

template<typename T >
metric_builder & flecs::metric_builder::id ( )
inline

Set the ID for the metric by type.

Definition at line 61 of file builder.hpp.

◆ id() [2/5]

template<typename First , typename Second >
metric_builder & flecs::metric_builder::id ( )
inline

Set the ID for the metric as a pair with types First and Second.

Definition at line 79 of file builder.hpp.

◆ id() [3/5]

metric_builder & flecs::metric_builder::id ( flecs::entity_t first,
flecs::entity_t second )
inline

Set the ID for the metric as a pair.

Definition at line 54 of file builder.hpp.

◆ id() [4/5]

template<typename First >
metric_builder & flecs::metric_builder::id ( flecs::entity_t second)
inline

Set the ID for the metric as a pair with type First.

Definition at line 67 of file builder.hpp.

◆ id() [5/5]

metric_builder & flecs::metric_builder::id ( flecs::id_t the_id)
inline

Set the ID for the metric.

Definition at line 48 of file builder.hpp.

◆ id_second()

template<typename Second >
metric_builder & flecs::metric_builder::id_second ( flecs::entity_t first)
inline

Set the ID for the metric as a pair with type Second.

Definition at line 73 of file builder.hpp.

◆ kind() [1/2]

template<typename Kind >
metric_builder & flecs::metric_builder::kind ( )
inline

Set the metric kind by type.

Definition at line 97 of file builder.hpp.

◆ kind() [2/2]

metric_builder & flecs::metric_builder::kind ( flecs::entity_t the_kind)
inline

Set the metric kind (e.g., Counter, Gauge).

Definition at line 90 of file builder.hpp.

◆ member() [1/3]

metric_builder & flecs::metric_builder::member ( const char * name)
inline

Set the member to use for the metric by name.

Definition at line 33 of file impl.hpp.

◆ member() [2/3]

template<typename T >
metric_builder & flecs::metric_builder::member ( const char * name)
inline

Set the member to use for the metric by type and name.

Definition at line 48 of file impl.hpp.

◆ member() [3/3]

metric_builder & flecs::metric_builder::member ( flecs::entity_t e)
inline

Set the member to use for the metric by entity ID.

Definition at line 28 of file builder.hpp.

◆ operator flecs::entity()

flecs::metric_builder::operator flecs::entity ( )
inline

Finalize the metric and return the entity.

Definition at line 71 of file impl.hpp.

◆ targets()

metric_builder & flecs::metric_builder::targets ( bool value = true)
inline

Set whether to create metrics for targets.

Definition at line 84 of file builder.hpp.

Member Data Documentation

◆ created_

bool flecs::metric_builder::created_ = false
protected

Definition at line 113 of file builder.hpp.

◆ desc_

ecs_metric_desc_t flecs::metric_builder::desc_ = {}
protected

Definition at line 112 of file builder.hpp.

◆ world_

flecs::world_t* flecs::metric_builder::world_
protected

Definition at line 111 of file builder.hpp.


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