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