xrpld
Loading...
Searching...
No Matches
Event.h
1#pragma once
2
3#include <xrpl/beast/insight/EventImpl.h>
4
5#include <chrono>
6#include <memory>
7#include <utility>
8
9namespace beast::insight {
10
21class Event final
22{
23public:
25
30 Event() = default;
31
39 {
40 }
41
45 template <class Rep, class Period>
46 void
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
60private:
62};
63
64} // namespace beast::insight
T ceil(T... args)
std::chrono::milliseconds value_type
Definition EventImpl.h:13
EventImpl::value_type value_type
Definition Event.h:24
Event(std::shared_ptr< EventImpl > impl)
Create the metric reference the specified implementation.
Definition Event.h:38
Event()=default
Create a null metric.
std::shared_ptr< EventImpl > const & impl() const
Definition Event.h:55
std::shared_ptr< EventImpl > impl_
Definition Event.h:61
void notify(std::chrono::duration< Rep, Period > const &value) const
Push an event notification.
Definition Event.h:47
STL namespace.