mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-22 14:50:54 +00:00
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
37 lines
680 B
C++
37 lines
680 B
C++
#pragma once
|
|
|
|
#include <xrpl/beast/net/IPEndpoint.h>
|
|
|
|
#include <cstddef>
|
|
#include <functional>
|
|
#include <vector>
|
|
|
|
namespace xrpl::peer_finder {
|
|
|
|
/**
|
|
* Abstract persistence for PeerFinder data.
|
|
*/
|
|
class Store
|
|
{
|
|
public:
|
|
virtual ~Store() = default;
|
|
|
|
// load the bootstrap cache
|
|
using load_callback = std::function<void(beast::ip::Endpoint, int)>;
|
|
virtual std::size_t
|
|
load(load_callback const& cb) = 0;
|
|
|
|
// save the bootstrap cache
|
|
struct Entry
|
|
{
|
|
explicit Entry() = default;
|
|
|
|
beast::ip::Endpoint endpoint;
|
|
int valence{};
|
|
};
|
|
virtual void
|
|
save(std::vector<Entry> const& v) = 0;
|
|
};
|
|
|
|
} // namespace xrpl::peer_finder
|