xrpld
Loading...
Searching...
No Matches
Store.h
1#pragma once
2
3#include <xrpl/beast/net/IPEndpoint.h>
4
5#include <cstddef>
6#include <functional>
7#include <vector>
8
9namespace xrpl::peer_finder {
10
14class Store
15{
16public:
17 virtual ~Store() = default;
18
19 // load the bootstrap cache
21 virtual std::size_t
22 load(load_callback const& cb) = 0;
23
24 // save the bootstrap cache
25 struct Entry
26 {
27 explicit Entry() = default;
28
30 int valence{};
31 };
32 virtual void
33 save(std::vector<Entry> const& v) = 0;
34};
35
36} // namespace xrpl::peer_finder
A version-independent IP address and port combination.
Definition IPEndpoint.h:24
Abstract persistence for PeerFinder data.
Definition Store.h:15
std::function< void(beast::ip::Endpoint, int)> load_callback
Definition Store.h:20
virtual ~Store()=default
virtual std::size_t load(load_callback const &cb)=0
virtual void save(std::vector< Entry > const &v)=0
beast::ip::Endpoint endpoint
Definition Store.h:29