metrics_metricset_empty, metrics_metricset_fill, metrics_metricset_add, metrics_metricset_del, metrics_metricset_ismember — Manipulate metric sets
Metrics
#include <metrics.h>
int metrics_metricset_empty ( | set) ; |
metrics_metricset_t * | set; |
int metrics_metricset_fill ( | set) ; |
metrics_metricset_t * | set; |
int metrics_metricset_add ( | metric_id, | |
set) ; |
metrics_metric_id_t | metric_id; |
metrics_metricset_t * | set; |
int metrics_metricset_del ( | metric_id, | |
set) ; |
metrics_metric_id_t | metric_id; |
metrics_metricset_t * | set; |
int metrics_metricset_ismember ( | metric_id, | |
set, | ||
ismember) ; |
metrics_metric_id_t | metric_id; |
const metrics_metricset_t * | set; |
int * | ismember; |
These primitives manipulate sets of metrics.
The metrics_metricset_add() and metrics_metricset_add() functions, respectively, shall add or delete the individual metric specified by the value of the argument metric_id to or from the metrics set pointed to by the argument set. Adding a metric already in the set or deleting a metric not in the set shall not be considered an error.
The metric_metricset_empty() function shall initialize the metric set pointed to by the set argument such that all metrics defined shall be excluded from the set.
The metric_metricset_fill() function shall initialize the metric set pointed to by the set argument such that all metrics defined shall be included into the set.
Applications shall call either metrics_metricset_empty() or metrics_metricset_fill() at least once for each object of type metrics_metricset_t prior to any other use of that object. If such an object is not initialized in this way, but is nonetheless supplied as an argument to any of the metrics_metricset_add(), metrics_metricset_del(), metrics_metricset_ismember(), metrics_metricset_iterator_getnext() or metrics_metricset_iterator_rewind() functions, the results are undefined.
The metrics_metricset_ismember() function shall test whether the metric specified by the value of the argument metric_id is a member of the set pointed to by the argument set. The value returned in the object pointed to by ismember argument is zero if the metric identifier is not a member of the set and a value different from zero if it is a member of the set.
Upon successful completion, these functions shall return a value of zero. Otherwise, they shall return the corresponding error number.
These functions may fail if:
[EINVAL]:
The metric_id argument was not a valid metric identifier.
The argument set was NULL.
The argument ismember was NULL.
Agustin Espinosa <aespinos@dsic.upv.es>, Andrés Terrasa <aterrasa@dsic.upv.es>, Ana García <agarcia@dsic.upv.es>.