rippled
Loading...
Searching...
No Matches
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 <xrpld/ledger/View.h>
24#include <xrpl/protocol/Indexes.h>
25#include <xrpl/protocol/Quality.h>
26
27#include <functional>
28
29namespace ripple {
30
31class Logs;
32
38{
39private:
41 bool m_valid;
47 Quality m_quality;
48
49public:
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
A generic endpoint for log messages.
Definition: Journal.h:59
Writeable view to a ledger, for applying a transaction.
Definition: ApplyView.h:140
Iterates and consumes raw offers in an order book.
Definition: BookTip.h:38
uint256 m_book
Definition: BookTip.h:42
ApplyView & view_
Definition: BookTip.h:40
uint256 m_index
Definition: BookTip.h:45
bool step(beast::Journal j)
Erases the current offer and advance to the next offer.
Definition: BookTip.cpp:34
uint256 m_end
Definition: BookTip.h:43
uint256 const & dir() const noexcept
Definition: BookTip.h:54
std::shared_ptr< SLE > m_entry
Definition: BookTip.h:46
Quality m_quality
Definition: BookTip.h:47
Quality const & quality() const noexcept
Definition: BookTip.h:66
uint256 m_dir
Definition: BookTip.h:44
bool m_valid
Definition: BookTip.h:41
SLE::pointer const & entry() const noexcept
Definition: BookTip.h:72
uint256 const & index() const noexcept
Definition: BookTip.h:60
Specifies an order book.
Definition: Book.h:34
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26