xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
beast
insight
Meter.h
1
#pragma once
2
3
#include <xrpl/beast/insight/MeterImpl.h>
4
5
#include <
memory
>
6
#include <
utility
>
7
8
namespace
beast::insight
{
9
18
class
Meter
final
19
{
20
public
:
21
using
value_type
=
MeterImpl::value_type
;
22
27
Meter
() =
default
;
28
35
explicit
Meter
(
std::shared_ptr<MeterImpl>
impl
) :
impl_
(
std
::move(
impl
))
36
{
37
}
38
43
void
44
increment
(
value_type
amount)
const
45
{
46
if
(
impl_
)
47
impl_
->increment(amount);
48
}
49
50
Meter
const
&
51
operator+=
(
value_type
amount)
const
52
{
53
increment
(amount);
54
return
*
this
;
55
}
56
57
Meter
const
&
58
operator++
()
const
59
{
60
increment
(1);
61
return
*
this
;
62
}
63
64
Meter
const
&
65
operator++
(
int
)
const
66
{
67
increment
(1);
68
return
*
this
;
69
}
70
71
72
[[nodiscard]]
std::shared_ptr<MeterImpl>
const
&
73
impl
()
const
74
{
75
return
impl_
;
76
}
77
78
private
:
79
std::shared_ptr<MeterImpl>
impl_
;
80
};
81
82
}
// namespace beast::insight
beast::insight::MeterImpl::value_type
std::uint64_t value_type
Definition
MeterImpl.h:13
beast::insight::Meter
A metric for measuring an integral value.
Definition
Meter.h:19
beast::insight::Meter::increment
void increment(value_type amount) const
Increment the meter.
Definition
Meter.h:44
beast::insight::Meter::Meter
Meter()=default
Create a null metric.
beast::insight::Meter::operator++
Meter const & operator++(int) const
Definition
Meter.h:65
beast::insight::Meter::Meter
Meter(std::shared_ptr< MeterImpl > impl)
Create the metric reference the specified implementation.
Definition
Meter.h:35
beast::insight::Meter::operator+=
Meter const & operator+=(value_type amount) const
Definition
Meter.h:51
beast::insight::Meter::operator++
Meter const & operator++() const
Definition
Meter.h:58
beast::insight::Meter::impl
std::shared_ptr< MeterImpl > const & impl() const
Definition
Meter.h:73
beast::insight::Meter::impl_
std::shared_ptr< MeterImpl > impl_
Definition
Meter.h:79
beast::insight::Meter::value_type
MeterImpl::value_type value_type
Definition
Meter.h:21
memory
beast::insight
Definition
Collector.h:13
std
STL namespace.
std::shared_ptr
utility
Generated by
1.17.0