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
25#include <xrpl/protocol/Indexes.h>
26#include <xrpl/protocol/Quality.h>
27
28namespace ripple {
29
30class Logs;
31
37{
38private:
40 bool m_valid;
46 Quality m_quality;
47
48public:
50 BookTip(ApplyView& view, Book const& book);
51
52 uint256 const&
53 dir() const noexcept
54 {
55 return m_dir;
56 }
57
58 uint256 const&
59 index() const noexcept
60 {
61 return m_index;
62 }
63
64 Quality const&
65 quality() const noexcept
66 {
67 return m_quality;
68 }
69
70 SLE::pointer const&
71 entry() const noexcept
72 {
73 return m_entry;
74 }
75
80 bool
82};
83
84} // namespace ripple
85
86#endif
A generic endpoint for log messages.
Definition: Journal.h:60
Writeable view to a ledger, for applying a transaction.
Definition: ApplyView.h:144
Iterates and consumes raw offers in an order book.
Definition: BookTip.h:37
uint256 m_book
Definition: BookTip.h:41
ApplyView & view_
Definition: BookTip.h:39
uint256 m_index
Definition: BookTip.h:44
bool step(beast::Journal j)
Erases the current offer and advance to the next offer.
Definition: BookTip.cpp:33
uint256 m_end
Definition: BookTip.h:42
uint256 const & dir() const noexcept
Definition: BookTip.h:53
std::shared_ptr< SLE > m_entry
Definition: BookTip.h:45
Quality m_quality
Definition: BookTip.h:46
Quality const & quality() const noexcept
Definition: BookTip.h:65
uint256 m_dir
Definition: BookTip.h:43
bool m_valid
Definition: BookTip.h:40
SLE::pointer const & entry() const noexcept
Definition: BookTip.h:71
uint256 const & index() const noexcept
Definition: BookTip.h:59
Specifies an order book.
Definition: Book.h:36
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26