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/overlay/Peer.h>
24 #include <ripple/shamap/SHAMap.h>
25 #include <ripple/beast/clock/abstract_clock.h>
26 #include <ripple/core/Stoppable.h>
27 #include <memory>
28 
29 namespace ripple {
30 
31 class Application;
32 
37 {
38 public:
40 
41  InboundTransactions() = default;
44 
45  virtual ~InboundTransactions() = 0;
46 
50  uint256 const& setHash,
51  bool acquire) = 0;
52 
55  virtual void gotData (uint256 const& setHash,
58 
61  virtual void giveSet (uint256 const& setHash,
63  bool acquired) = 0;
64 
67  virtual void newRound (std::uint32_t seq) = 0;
68 
69  virtual Json::Value getInfo() = 0;
70 
71  virtual void onStop() = 0;
72 };
73 
76  Application& app,
78  Stoppable& parent,
79  beast::insight::Collector::ptr const& collector,
81  <void (std::shared_ptr <SHAMap> const&,
82  bool)> gotSet);
83 
84 
85 } // ripple
86 
87 #endif
ripple::Application
Definition: Application.h:85
std::shared_ptr
STL class.
std::function
ripple::base_uint< 256 >
ripple::InboundTransactions::onStop
virtual void onStop()=0
ripple::Stoppable
Provides an interface for starting and stopping.
Definition: Stoppable.h:200
ripple::InboundTransactions::getInfo
virtual Json::Value getInfo()=0
ripple::InboundTransactions::getSet
virtual std::shared_ptr< SHAMap > getSet(uint256 const &setHash, bool acquire)=0
Retrieves a transaction set by hash.
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:271
ripple::make_InboundTransactions
std::unique_ptr< InboundTransactions > make_InboundTransactions(Application &app, InboundLedgers::clock_type &clock, Stoppable &parent, beast::insight::Collector::ptr const &collector, std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet)
Definition: InboundTransactions.cpp:294
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
Gives set to the container.
std::unique_ptr
STL class.
Json::Value
Represents a JSON value.
Definition: json_value.h:141
ripple::InboundTransactions
Manages the acquisition and lifetime of transaction sets.
Definition: InboundTransactions.h:36
ripple::InboundTransactions::gotData
virtual void gotData(uint256 const &setHash, std::shared_ptr< Peer >, std::shared_ptr< protocol::TMLedgerData >)=0
Gives data to an inbound transaction set.