xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
beast
insight
Event.h
1
#pragma once
2
3
#include <xrpl/beast/insight/EventImpl.h>
4
5
#include <
chrono
>
6
#include <
memory
>
7
#include <
utility
>
8
9
namespace
beast::insight
{
10
21
class
Event
final
22
{
23
public
:
24
using
value_type
=
EventImpl::value_type
;
25
30
Event
() =
default
;
31
38
explicit
Event
(
std::shared_ptr<EventImpl>
impl
) :
impl_
(
std
::move(
impl
))
39
{
40
}
41
45
template
<
class
Rep,
class
Period>
46
void
47
notify
(
std::chrono::duration<Rep, Period>
const
& value)
const
48
{
49
using namespace
std::chrono
;
50
if
(
impl_
)
51
impl_
->notify(
ceil<value_type>
(value));
52
}
53
54
[[nodiscard]]
std::shared_ptr<EventImpl>
const
&
55
impl
()
const
56
{
57
return
impl_
;
58
}
59
60
private
:
61
std::shared_ptr<EventImpl>
impl_
;
62
};
63
64
}
// namespace beast::insight
std::ceil
T ceil(T... args)
chrono
beast::insight::EventImpl::value_type
std::chrono::milliseconds value_type
Definition
EventImpl.h:13
beast::insight::Event::value_type
EventImpl::value_type value_type
Definition
Event.h:24
beast::insight::Event::Event
Event(std::shared_ptr< EventImpl > impl)
Create the metric reference the specified implementation.
Definition
Event.h:38
beast::insight::Event::Event
Event()=default
Create a null metric.
beast::insight::Event::impl
std::shared_ptr< EventImpl > const & impl() const
Definition
Event.h:55
beast::insight::Event::impl_
std::shared_ptr< EventImpl > impl_
Definition
Event.h:61
beast::insight::Event::notify
void notify(std::chrono::duration< Rep, Period > const &value) const
Push an event notification.
Definition
Event.h:47
std::chrono::duration
memory
beast::insight
Definition
Collector.h:13
std::chrono
std
STL namespace.
std::shared_ptr
utility
Generated by
1.17.0