rippled
Loading...
Searching...
No Matches
Meter.h
1#pragma once
2
3#include <xrpl/beast/insight/MeterImpl.h>
4
5#include <memory>
6
7namespace beast {
8namespace insight {
9
17class Meter final
18{
19public:
21
26 {
27 }
28
35 {
36 }
37
40 void
41 increment(value_type amount) const
42 {
43 if (m_impl)
44 m_impl->increment(amount);
45 }
46
47 Meter const&
48 operator+=(value_type amount) const
49 {
50 increment(amount);
51 return *this;
52 }
53
54 Meter const&
55 operator++() const
56 {
57 increment(1);
58 return *this;
59 }
60
61 Meter const&
62 operator++(int) const
63 {
64 increment(1);
65 return *this;
66 }
70 impl() const
71 {
72 return m_impl;
73 }
74
75private:
77};
78
79} // namespace insight
80} // namespace beast
std::uint64_t value_type
Definition MeterImpl.h:14
A metric for measuring an integral value.
Definition Meter.h:18
void increment(value_type amount) const
Increment the meter.
Definition Meter.h:41
Meter()
Create a null metric.
Definition Meter.h:25
std::shared_ptr< MeterImpl > m_impl
Definition Meter.h:76
Meter(std::shared_ptr< MeterImpl > const &impl)
Create the metric reference the specified implementation.
Definition Meter.h:34
Meter const & operator++(int) const
Definition Meter.h:62
Meter const & operator+=(value_type amount) const
Definition Meter.h:48
Meter const & operator++() const
Definition Meter.h:55
std::shared_ptr< MeterImpl > const & impl() const
Definition Meter.h:70