rippled
Loading...
Searching...
No Matches
Store.h
1
2//------------------------------------------------------------------------------
3/*
4 This file is part of rippled: https://github.com/ripple/rippled
5 Copyright (c) 2012, 2013 Ripple Labs Inc.
6
7 Permission to use, copy, modify, and/or distribute this software for any
8 purpose with or without fee is hereby granted, provided that the above
9 copyright notice and this permission notice appear in all copies.
10
11 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18*/
19//==============================================================================
20
21#ifndef RIPPLE_PEERFINDER_STORE_H_INCLUDED
22#define RIPPLE_PEERFINDER_STORE_H_INCLUDED
23
24namespace ripple {
25namespace PeerFinder {
26
28class Store
29{
30public:
31 virtual ~Store()
32 {
33 }
34
35 // load the bootstrap cache
37 virtual std::size_t
38 load(load_callback const& cb) = 0;
39
40 // save the bootstrap cache
41 struct Entry
42 {
43 explicit Entry() = default;
44
47 };
48 virtual void
49 save(std::vector<Entry> const& v) = 0;
50};
51
52} // namespace PeerFinder
53} // namespace ripple
54
55#endif
A version-independent IP address and port combination.
Definition IPEndpoint.h:38
Abstract persistence for PeerFinder data.
Definition Store.h:29
virtual void save(std::vector< Entry > const &v)=0
virtual std::size_t load(load_callback const &cb)=0
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25
beast::IP::Endpoint endpoint
Definition Store.h:45