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
20class Event final
21{
22public:
24
28 Event() = default;
29
36 {
37 }
38
40 template <class Rep, class Period>
41 void
43 {
44 using namespace std::chrono;
45 if (impl_)
46 impl_->notify(ceil<value_type>(value));
47 }
48
49 [[nodiscard]] std::shared_ptr<EventImpl> const&
50 impl() const
51 {
52 return impl_;
53 }
54
55private:
57};
58
59} // namespace beast::insight
T ceil(T... args)
std::chrono::milliseconds value_type
Definition EventImpl.h:13
EventImpl::value_type value_type
Definition Event.h:23
Event(std::shared_ptr< EventImpl > impl)
Create the metric reference the specified implementation.
Definition Event.h:35
Event()=default
Create a null metric.
std::shared_ptr< EventImpl > const & impl() const
Definition Event.h:50
std::shared_ptr< EventImpl > impl_
Definition Event.h:56
void notify(std::chrono::duration< Rep, Period > const &value) const
Push an event notification.
Definition Event.h:42
STL namespace.