Class AttributesHashMap

Class Documentation

class AttributesHashMap

Public Functions

inline Aggregation *Get(const MetricAttributes &attributes) const
inline bool Has(const MetricAttributes &attributes) const

check if key is present in hash

inline Aggregation *GetOrSetDefault(const MetricAttributes &attributes, std::function<std::unique_ptr<Aggregation>()> aggregation_callback)

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 void Set(const MetricAttributes &attributes, std::unique_ptr<Aggregation> value)

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

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.