rippled
BookTip.h
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2014 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_BOOK_BOOKTIP_H_INCLUDED
21 #define RIPPLE_APP_BOOK_BOOKTIP_H_INCLUDED
22 
23 #include <ripple/ledger/View.h>
24 #include <ripple/protocol/Indexes.h>
25 #include <ripple/protocol/Quality.h>
26 
27 #include <functional>
28 
29 namespace ripple {
30 
31 class Logs;
32 
37 class BookTip
38 {
39 private:
41  bool m_valid;
47  Quality m_quality;
48 
49 public:
51  BookTip(ApplyView& view, Book const& book);
52 
53  uint256 const&
54  dir() const noexcept
55  {
56  return m_dir;
57  }
58 
59  uint256 const&
60  index() const noexcept
61  {
62  return m_index;
63  }
64 
65  Quality const&
66  quality() const noexcept
67  {
68  return m_quality;
69  }
70 
71  SLE::pointer const&
72  entry() const noexcept
73  {
74  return m_entry;
75  }
76 
81  bool
83 };
84 
85 } // namespace ripple
86 
87 #endif
std::shared_ptr
STL class.
functional
ripple::BookTip::m_end
uint256 m_end
Definition: BookTip.h:43
ripple::ApplyView
Writeable view to a ledger, for applying a transaction.
Definition: ApplyView.h:134
ripple::base_uint< 256 >
ripple::BookTip::index
uint256 const & index() const noexcept
Definition: BookTip.h:60
ripple::BookTip::BookTip
BookTip(ApplyView &view, Book const &book)
Create the iterator.
Definition: BookTip.cpp:25
ripple::BookTip::quality
Quality const & quality() const noexcept
Definition: BookTip.h:66
ripple::BookTip::view_
ApplyView & view_
Definition: BookTip.h:40
ripple::BookTip::m_book
uint256 m_book
Definition: BookTip.h:42
ripple::BookTip
Iterates and consumes raw offers in an order book.
Definition: BookTip.h:37
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
ripple::BookTip::m_quality
Quality m_quality
Definition: BookTip.h:47
ripple::BookTip::m_index
uint256 m_index
Definition: BookTip.h:45
ripple::BookTip::m_valid
bool m_valid
Definition: BookTip.h:41
ripple::BookTip::entry
SLE::pointer const & entry() const noexcept
Definition: BookTip.h:72
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::BookTip::dir
uint256 const & dir() const noexcept
Definition: BookTip.h:54
ripple::BookTip::step
bool step(beast::Journal j)
Erases the current offer and advance to the next offer.
Definition: BookTip.cpp:34
ripple::BookTip::m_entry
std::shared_ptr< SLE > m_entry
Definition: BookTip.h:46
ripple::Book
Specifies an order book.
Definition: Book.h:33
ripple::BookTip::m_dir
uint256 m_dir
Definition: BookTip.h:44