3 #include <unordered_map>
15 using IteratorType = std::unordered_map<std::string, double>::iterator;
22 std::size_t
size() const noexcept;
27 double &operator[](const
std::
string metric_key);
34 double &
at(const
std::
string metric_key);
41 const
double &
at(const
std::
string metric_key) const;
46 bool contains(const
std::
string metric_key) const noexcept;
52 bool emplace(const
std::
string metric_key, const
double value);
57 bool erase(const
std::
string metric_key);
60 void clear() noexcept;
63 void reset() noexcept;
67 bool empty() const noexcept;
94 std::unordered_map<std::string, double> metrics_;
Defines the Simulation run-time metrics container data type.
Definition: runtime_metric.h:12
std::unordered_map< std::string, double >::iterator IteratorType
Metric iterator.
Definition: runtime_metric.h:15
IteratorType end() noexcept
Gets an iterator to the element following the last metric.
Definition: runtime_metric.h:75
ConstIteratorType cbegin() const noexcept
Gets a read-only iterator to the beginning of the metrics.
Definition: runtime_metric.h:87
bool erase(const std::string metric_key)
Removes a specified metric from the container.
Definition: runtime_metric.cpp:24
std::size_t size() const noexcept
Gets the number of metrics in the container.
Definition: runtime_metric.cpp:5
ConstIteratorType cend() const noexcept
Gets a read-only iterator to the element following the last metric.
Definition: runtime_metric.h:91
std::unordered_map< std::string, double >::const_iterator ConstIteratorType
Read-only metric iterator.
Definition: runtime_metric.h:18
bool empty() const noexcept
Checks if the container has no metrics.
Definition: runtime_metric.cpp:37
bool emplace(const std::string metric_key, const double value)
Inserts a new metric into the container constructed in-place with arguments.
Definition: runtime_metric.cpp:19
bool contains(const std::string metric_key) const noexcept
Checks if the container contains a metric with specific identifier.
Definition: runtime_metric.cpp:15
void reset() noexcept
Resets the values of all metrics in the container to zero.
Definition: runtime_metric.cpp:31
void clear() noexcept
Erases all metrics from the container.
Definition: runtime_metric.cpp:29
double & at(const std::string metric_key)
Gets a reference to a metric value by identifier with bounds checking.
Definition: runtime_metric.cpp:9
ConstIteratorType end() const noexcept
Gets a read-only iterator to the element following the last metric.
Definition: runtime_metric.h:83
IteratorType begin() noexcept
Gets an iterator to the beginning of the metrics.
Definition: runtime_metric.h:71
ConstIteratorType begin() const noexcept
Gets a read-only iterator to the beginning of the metrics.
Definition: runtime_metric.h:79
Top-level namespace for Health-GPS C++ API.
Definition: analysis_definition.h:8
Global namespace.
Definition: jsonparser.h:88