Class AttributesHashMap

Class Documentation

class AttributesHashMap

Public Functions

inline Aggregation *Get(size_t hash) const
inline bool Has(size_t hash) const
Returns

check if key is present in hash

inline Aggregation *GetOrSetDefault(const opentelemetry::common::KeyValueIterable &attributes, std::function<std::unique_ptr<Aggregation>()> aggregation_callback, size_t hash)
Returns

the pointer to value for given key if present. If not present, it uses the provided callback to generate value and store in the hash

inline Aggregation *GetOrSetDefault(std::function<std::unique_ptr<Aggregation>()> aggregation_callback, size_t hash)
inline Aggregation *GetOrSetDefault(const MetricAttributes &attributes, std::function<std::unique_ptr<Aggregation>()> aggregation_callback, size_t hash)
inline void Set(const opentelemetry::common::KeyValueIterable &attributes, std::unique_ptr<Aggregation> aggr, size_t hash)

Set the value for given key, overwriting the value if already present

inline void Set(const MetricAttributes &attributes, std::unique_ptr<Aggregation> aggr, size_t hash)
inline bool GetAllEnteries(nostd::function_ref<bool(const MetricAttributes&, Aggregation&)> callback) const

Iterate the hash to yield key and value stored in hash.

inline size_t Size()

Return the size of hash.