Represents a single tracked statistic. More...
#include <statistics.hpp>
Public Member Functions | |
| Stat (Formatter formatter) | |
| Constructs a Stat with a specified formatter. More... | |
| bool | operator== (Stat const &o) const noexcept |
| Equality operator for Stat objects. More... | |
| double | add (double value) |
| Adds a value to this statistic. More... | |
| std::size_t | count () const noexcept |
| Returns the number of updates applied to this statistic. More... | |
| double | value () const noexcept |
| Returns the total accumulated value. More... | |
| Formatter const & | formatter () const noexcept |
| Returns the formatter used by this statistic. More... | |
Represents a single tracked statistic.
Definition at line 117 of file statistics.hpp.
|
inline |
Constructs a Stat with a specified formatter.
| formatter | Function used to format this statistic when reporting. |
Definition at line 124 of file statistics.hpp.
|
inline |
Adds a value to this statistic.
Increments the update count and adds the given value.
| value | The value to add. |
Definition at line 144 of file statistics.hpp.
|
inlinenoexcept |
Returns the number of updates applied to this statistic.
add() was called. Definition at line 154 of file statistics.hpp.
|
inlinenoexcept |
Returns the formatter used by this statistic.
Definition at line 172 of file statistics.hpp.
|
inlinenoexcept |
Equality operator for Stat objects.
| o | Another Stat instance to compare with. |
Definition at line 132 of file statistics.hpp.
|
inlinenoexcept |
Returns the total accumulated value.
Definition at line 163 of file statistics.hpp.