rippled
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 <ripple/beast/clock/abstract_clock.h>
24 #include <ripple/overlay/Peer.h>
25 #include <ripple/shamap/SHAMap.h>
26 #include <memory>
27 
28 namespace ripple {
29 
30 class Application;
31 
36 {
37 public:
39 
40  InboundTransactions() = default;
43  operator=(InboundTransactions const&) = delete;
44 
45  virtual ~InboundTransactions() = 0;
46 
56  getSet(uint256 const& setHash, bool acquire) = 0;
57 
64  virtual void
65  gotData(
66  uint256 const& setHash,
69 
77  virtual void
78  giveSet(
79  uint256 const& setHash,
81  bool acquired) = 0;
82 
85  virtual void
86  newRound(std::uint32_t seq) = 0;
87 
88  virtual void
89  stop() = 0;
90 };
91 
94  Application& app,
95  beast::insight::Collector::ptr const& collector,
96  std::function<void(std::shared_ptr<SHAMap> const&, bool)> gotSet);
97 
98 } // namespace ripple
99 
100 #endif
ripple::Application
Definition: Application.h:115
std::shared_ptr
STL class.
std::function
ripple::make_InboundTransactions
std::unique_ptr< InboundTransactions > make_InboundTransactions(Application &app, beast::insight::Collector::ptr const &collector, std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet)
Definition: InboundTransactions.cpp:269
ripple::base_uint< 256 >
ripple::InboundTransactions::getSet
virtual std::shared_ptr< SHAMap > getSet(uint256 const &setHash, bool acquire)=0
Find and return a transaction set, or nullptr if it is missing.
ripple::InboundTransactions::operator=
InboundTransactions & operator=(InboundTransactions const &)=delete
ripple::set
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,...
Definition: BasicConfig.h:313
std::uint32_t
ripple::InboundTransactions::InboundTransactions
InboundTransactions()=default
beast::abstract_clock< std::chrono::steady_clock >
memory
ripple::InboundTransactions::newRound
virtual void newRound(std::uint32_t seq)=0
Informs the container if a new consensus round.
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::InboundTransactions::stop
virtual void stop()=0
ripple::InboundTransactions::~InboundTransactions
virtual ~InboundTransactions()=0
ripple::InboundTransactions::giveSet
virtual void giveSet(uint256 const &setHash, std::shared_ptr< SHAMap > const &set, bool acquired)=0
Add a transaction set.
std::unique_ptr
STL class.
ripple::InboundTransactions::gotData
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.
ripple::InboundTransactions
Manages the acquisition and lifetime of transaction sets.
Definition: InboundTransactions.h:35