5#include <boost/signals2/connection.hpp>
6#include <boost/signals2/signal.hpp>
7#include <boost/signals2/variadic_signal.hpp>
9#include <condition_variable>
27 std::optional<uint32_t> latest_;
29 mutable std::mutex mtx_;
30 std::condition_variable cv_;
32 SignalType notificationChannel_;
40 static std::shared_ptr<NetworkValidatedLedgers>
49 push(uint32_t idx)
final;
60 std::optional<uint32_t>
75 boost::signals2::scoped_connection
76 subscribe(SignalType::slot_type
const& subscriber)
override;
An interface for NetworkValidatedLedgers.
Definition NetworkValidatedLedgersInterface.hpp:16
This datastructure is used to keep track of the sequence of the most recent ledger validated by the n...
Definition NetworkValidatedLedgers.hpp:26
void push(uint32_t idx) final
Notify the datastructure that idx has been validated by the network.
Definition NetworkValidatedLedgers.cpp:19
bool waitUntilValidatedByNetwork(uint32_t sequence, std::optional< uint32_t > maxWaitMs={}) final
Waits for the sequence to be validated by the network.
Definition NetworkValidatedLedgers.cpp:38
static std::shared_ptr< NetworkValidatedLedgers > makeValidatedLedgers()
A factory function for NetworkValidatedLedgers.
Definition NetworkValidatedLedgers.cpp:13
std::optional< uint32_t > getMostRecent() final
Get most recently validated sequence.
Definition NetworkValidatedLedgers.cpp:30
boost::signals2::scoped_connection subscribe(SignalType::slot_type const &subscriber) override
Allows clients to get notified when a new validated ledger becomes known to Clio.
Definition NetworkValidatedLedgers.cpp:54