xrpld
Loading...
Searching...
No Matches
InboundTransactions.h
1#pragma once
2
3#include <xrpld/overlay/Peer.h>
4
5#include <xrpl/basics/base_uint.h>
6#include <xrpl/beast/clock/abstract_clock.h>
7#include <xrpl/beast/insight/Collector.h>
8#include <xrpl/shamap/SHAMap.h>
9
10#include <xrpl.pb.h>
11
12#include <chrono>
13#include <cstdint>
14#include <functional>
15#include <memory>
16
17namespace xrpl {
18
19class Application;
20
24
26{
27public:
29
34
35 virtual ~InboundTransactions() = 0;
36
47 getSet(uint256 const& setHash, bool acquire) = 0;
48
56 virtual void
58 uint256 const& setHash,
61
70 virtual void
71 giveSet(uint256 const& setHash, std::shared_ptr<SHAMap> const& set, bool acquired) = 0;
72
76 virtual void
78
79 virtual void
80 stop() = 0;
81};
82
85 Application& app,
86 beast::insight::Collector::ptr const& collector,
87 std::function<void(std::shared_ptr<SHAMap> const&, bool)> gotSet);
88
89} // namespace xrpl
Abstract interface to a clock.
std::shared_ptr< Collector > ptr
Definition Collector.h:29
InboundTransactions(InboundTransactions const &)=delete
virtual ~InboundTransactions()=0
beast::AbstractClock< std::chrono::steady_clock > clock_type
virtual void newRound(std::uint32_t seq)=0
Informs the container if a new consensus round.
virtual std::shared_ptr< SHAMap > getSet(uint256 const &setHash, bool acquire)=0
Find and return a transaction set, or nullptr if it is missing.
virtual void gotData(uint256 const &setHash, std::shared_ptr< Peer > peer, std::shared_ptr< protocol::TMLedgerData > message)=0
Add a transaction set from a LedgerData message.
virtual void giveSet(uint256 const &setHash, std::shared_ptr< SHAMap > const &set, bool acquired)=0
Add a transaction set.
InboundTransactions & operator=(InboundTransactions const &)=delete
virtual void stop()=0
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::unique_ptr< InboundTransactions > makeInboundTransactions(Application &app, beast::insight::Collector::ptr const &collector, std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet)
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
BaseUInt< 256 > uint256
Definition base_uint.h:580