20 #ifndef RIPPLE_OVERLAY_PEER_RESERVATION_TABLE_H_INCLUDED
21 #define RIPPLE_OVERLAY_PEER_RESERVATION_TABLE_H_INCLUDED
23 #include <ripple/beast/hash/hash_append.h>
24 #include <ripple/beast/hash/uhash.h>
25 #include <ripple/beast/utility/Journal.h>
26 #include <ripple/json/json_forwards.h>
27 #include <ripple/protocol/PublicKey.h>
29 #define SOCI_USE_BOOST
30 #include <soci/soci.h>
52 template <typename Hasher>
std::optional< PeerReservation > erase(PublicKey const &nodeId)
std::unordered_set< PeerReservation, beast::uhash<>, KeyEqual > table_
DatabaseCon * connection_
static Sink & getNullSink()
Returns a Sink which does nothing.
auto toJson() const -> Json::Value
JSON (JavaScript Object Notation).
PeerReservationTable(beast::Journal journal=beast::Journal(beast::Journal::getNullSink()))
A generic endpoint for log messages.
bool operator()(PeerReservation const &lhs, PeerReservation const &rhs) const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::vector< PeerReservation > list() const
std::enable_if_t< is_contiguously_hashable< T, Hasher >::value > hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
friend bool operator<(PeerReservation const &a, PeerReservation const &b)
bool contains(PublicKey const &nodeId)
std::optional< PeerReservation > insert_or_assign(PeerReservation const &reservation)
bool load(DatabaseCon &connection)
friend void hash_append(Hasher &h, PeerReservation const &x) noexcept