rippled
Loading...
Searching...
No Matches
InboundTransactions.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012-2015 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_APP_LEDGER_INBOUNDTRANSACTIONS_H_INCLUDED
21#define RIPPLE_APP_LEDGER_INBOUNDTRANSACTIONS_H_INCLUDED
22
23#include <xrpld/overlay/Peer.h>
24#include <xrpld/shamap/SHAMap.h>
25
26#include <xrpl/beast/clock/abstract_clock.h>
27
28#include <memory>
29
30namespace ripple {
31
32class Application;
33
38{
39public:
41
46
47 virtual ~InboundTransactions() = 0;
48
58 getSet(uint256 const& setHash, bool acquire) = 0;
59
66 virtual void
68 uint256 const& setHash,
71
79 virtual void
81 uint256 const& setHash,
82 std::shared_ptr<SHAMap> const& set,
83 bool acquired) = 0;
84
87 virtual void
89
90 virtual void
91 stop() = 0;
92};
93
96 Application& app,
97 beast::insight::Collector::ptr const& collector,
98 std::function<void(std::shared_ptr<SHAMap> const&, bool)> gotSet);
99
100} // namespace ripple
101
102#endif
Manages the acquisition and lifetime of transaction sets.
InboundTransactions(InboundTransactions const &)=delete
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 giveSet(uint256 const &setHash, std::shared_ptr< SHAMap > const &set, bool acquired)=0
Add a transaction set.
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.
InboundTransactions & operator=(InboundTransactions const &)=delete
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26
std::unique_ptr< InboundTransactions > make_InboundTransactions(Application &app, beast::insight::Collector::ptr const &collector, std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet)
Set the sequence number on a JTx.
Definition: seq.h:34