Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
MonitorProvider.hpp
1//------------------------------------------------------------------------------
2/*
3 This file is part of clio: https://github.com/XRPLF/clio
4 Copyright (c) 2025, the clio developers.
5
6 Permission to use, copy, modify, and distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#pragma once
21
22#include "data/BackendInterface.hpp"
24#include "etlng/MonitorInterface.hpp"
25#include "etlng/MonitorProviderInterface.hpp"
26#include "etlng/impl/Monitor.hpp"
27#include "util/async/AnyExecutionContext.hpp"
28
29#include <chrono>
30#include <cstdint>
31#include <memory>
32#include <utility>
33
34namespace etlng::impl {
35
37public:
38 std::unique_ptr<MonitorInterface>
41 std::shared_ptr<BackendInterface> backend,
42 std::shared_ptr<etl::NetworkValidatedLedgersInterface> validatedLedgers,
43 uint32_t startSequence,
44 std::chrono::steady_clock::duration dbStalledReportDelay
45 ) override
46 {
47 return std::make_unique<Monitor>(
48 std::move(ctx), std::move(backend), std::move(validatedLedgers), startSequence, dbStalledReportDelay
49 );
50 }
51};
52
53} // namespace etlng::impl
Definition MonitorProvider.hpp:36
std::unique_ptr< MonitorInterface > make(util::async::AnyExecutionContext ctx, std::shared_ptr< BackendInterface > backend, std::shared_ptr< etl::NetworkValidatedLedgersInterface > validatedLedgers, uint32_t startSequence, std::chrono::steady_clock::duration dbStalledReportDelay) override
Create a new Monitor instance.
Definition MonitorProvider.hpp:39
A type-erased execution context.
Definition AnyExecutionContext.hpp:41
An interface for providing Monitor instances.
Definition MonitorProviderInterface.hpp:36