rippled
Loading...
Searching...
No Matches
BookDirs.h
1#ifndef XRPL_LEDGER_BOOK_DIRS_H_INCLUDED
2#define XRPL_LEDGER_BOOK_DIRS_H_INCLUDED
3
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/ledger/ReadView.h>
6
7namespace ripple {
8
10{
11private:
12 ReadView const* view_ = nullptr;
17 unsigned int entry_ = 0;
19
20public:
21 class const_iterator;
23
24 BookDirs(ReadView const&, Book const&);
25
27 begin() const;
28
30 end() const;
31};
32
34{
35public:
37 using pointer = value_type const*;
38 using reference = value_type const&;
41
42 const_iterator() = default;
43
44 bool
45 operator==(const_iterator const& other) const;
46
47 bool
48 operator!=(const_iterator const& other) const
49 {
50 return !(*this == other);
51 }
52
54 operator*() const;
55
57 operator->() const
58 {
59 return &**this;
60 }
61
63 operator++();
64
66 operator++(int);
67
68private:
69 friend class BookDirs;
70
72 ReadView const& view,
73 uint256 const& root,
74 uint256 const& dir_key)
75 : view_(&view), root_(root), key_(dir_key), cur_key_(dir_key)
76 {
77 }
78
79 ReadView const* view_ = nullptr;
85 unsigned int entry_ = 0;
88
90};
91
92} // namespace ripple
93
94#endif
A generic endpoint for log messages.
Definition Journal.h:41
bool operator==(const_iterator const &other) const
Definition BookDirs.cpp:50
const_iterator & operator++()
Definition BookDirs.cpp:76
const_iterator(ReadView const &view, uint256 const &root, uint256 const &dir_key)
Definition BookDirs.h:71
std::optional< value_type > cache_
Definition BookDirs.h:87
value_type const & reference
Definition BookDirs.h:38
static beast::Journal j_
Definition BookDirs.h:89
bool operator!=(const_iterator const &other) const
Definition BookDirs.h:48
value_type const * pointer
Definition BookDirs.h:37
std::shared_ptr< SLE const > sle_
Definition BookDirs.h:84
uint256 const next_quality_
Definition BookDirs.h:14
unsigned int entry_
Definition BookDirs.h:17
ReadView const * view_
Definition BookDirs.h:12
uint256 const root_
Definition BookDirs.h:13
std::shared_ptr< SLE const > sle_
Definition BookDirs.h:16
const_iterator begin() const
Definition BookDirs.cpp:27
std::shared_ptr< SLE const > value_type
Definition BookDirs.h:22
const_iterator end() const
Definition BookDirs.cpp:41
uint256 index_
Definition BookDirs.h:18
uint256 const key_
Definition BookDirs.h:15
Specifies an order book.
Definition Book.h:17
A view into a ledger.
Definition ReadView.h:32
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Number root(Number f, unsigned d)
Definition Number.cpp:617