xrpld
Loading...
Searching...
No Matches
Book.cpp
1#include <xrpl/protocol/Book.h>
2
3#include <xrpl/protocol/Asset.h>
4
5#include <ostream>
6#include <string>
7
8namespace xrpl {
9
10bool
11isConsistent(Book const& book)
12{
13 return isConsistent(book.in) && isConsistent(book.out) && book.in != book.out;
14}
15
17to_string(Book const& book)
18{
19 return to_string(book.in) + "->" + to_string(book.out);
20}
21
23operator<<(std::ostream& os, Book const& x)
24{
25 os << to_string(x);
26 return os;
27}
28
29Book
30reversed(Book const& book)
31{
32 return Book(book.out, book.in, book.domain);
33}
34
35} // namespace xrpl
Specifies an order book.
Definition Book.h:16
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::ostream & operator<<(std::ostream &out, BaseUInt< Bits, Tag > const &u)
Definition base_uint.h:648
std::string to_string(BaseUInt< Bits, Tag > const &a)
Definition base_uint.h:633
Book reversed(Book const &book)
Definition Book.cpp:30
bool isConsistent(Asset const &asset)
Definition Asset.h:312