Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
NetworkValidatedLedgersInterface.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include <boost/signals2/connection.hpp>
5#include <boost/signals2/signal.hpp>
6#include <boost/signals2/variadic_signal.hpp>
7
8#include <cstdint>
9#include <optional>
10
11namespace etl {
12
17public:
18 using SignalType = boost::signals2::signal<void(uint32_t)>;
19
20 virtual ~NetworkValidatedLedgersInterface() = default;
21
27 virtual void
28 push(uint32_t idx) = 0;
29
39 [[nodiscard]] virtual std::optional<uint32_t>
41
51 virtual bool
52 waitUntilValidatedByNetwork(uint32_t sequence, std::optional<uint32_t> maxWaitMs = {}) = 0;
53
60 [[nodiscard]] virtual boost::signals2::scoped_connection
61 subscribe(SignalType::slot_type const& subscriber) = 0;
62};
63
64} // namespace etl
An interface for NetworkValidatedLedgers.
Definition NetworkValidatedLedgersInterface.hpp:16
virtual void push(uint32_t idx)=0
Notify the datastructure that idx has been validated by the network.
virtual bool waitUntilValidatedByNetwork(uint32_t sequence, std::optional< uint32_t > maxWaitMs={})=0
Waits for the sequence to be validated by the network.
virtual std::optional< uint32_t > getMostRecent()=0
Get most recently validated sequence.
virtual boost::signals2::scoped_connection subscribe(SignalType::slot_type const &subscriber)=0
Allows clients to get notified when a new validated ledger becomes known to Clio.