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/core/Stoppable.h>
25 #include <ripple/overlay/Peer.h>
26 #include <ripple/shamap/SHAMap.h>
27 #include <memory>
28 
29 namespace ripple {
30 
31 class Application;
32 
37 {
38 public:
40 
41  InboundTransactions() = default;
44  operator=(InboundTransactions const&) = delete;
45 
46  virtual ~InboundTransactions() = 0;
47 
57  getSet(uint256 const& setHash, bool acquire) = 0;
58 
65  virtual void
66  gotData(
67  uint256 const& setHash,
70 
78  virtual void
79  giveSet(
80  uint256 const& setHash,
82  bool acquired) = 0;
83 
86  virtual void
87  newRound(std::uint32_t seq) = 0;
88 };
89 
92  Application& app,
93  Stoppable& parent,
94  beast::insight::Collector::ptr const& collector,
95  std::function<void(std::shared_ptr<SHAMap> const&, bool)> gotSet);
96 
97 } // namespace ripple
98 
99 #endif
ripple::Application
Definition: Application.h:97
std::shared_ptr
STL class.
std::function
ripple::base_uint< 256 >
ripple::Stoppable
Provides an interface for starting and stopping.
Definition: Stoppable.h:201
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:276
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::~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.
ripple::make_InboundTransactions
std::unique_ptr< InboundTransactions > make_InboundTransactions(Application &app, Stoppable &parent, beast::insight::Collector::ptr const &collector, std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet)
Definition: InboundTransactions.cpp:270
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:36