xrpld
Loading...
Searching...
No Matches
AMMEntry.h
1#pragma once
2
3#include <xrpl/basics/base_uint.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/ledger/ApplyView.h>
6#include <xrpl/ledger/ReadView.h>
7#include <xrpl/ledger/entries/SLEBase.h>
8#include <xrpl/protocol/Asset.h>
9#include <xrpl/protocol/Indexes.h>
10#include <xrpl/protocol/LedgerFormats.h>
11
12namespace xrpl {
13
14template <typename ViewT>
15class AMMEntry : public SLEBase<ViewT, ltAMM>
16{
17public:
19
20 // Inherit base constructors: adopt an existing SLE, or resolve one from a
21 // Keylet against the view.
22 using Base::Base;
23
24 explicit AMMEntry(
25 Asset const& issue1,
26 Asset const& issue2,
29 : Base(keylet::amm(issue1, issue2), view, j)
30 {
31 }
32
33 explicit AMMEntry(
34 UInt256 const& ammID,
37 : Base(keylet::amm(ammID), view, j)
38 {
39 }
40};
41
44
45} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
static Sink & getNullSink()
Returns a Sink which does nothing.
AMMEntry(Asset const &issue1, Asset const &issue2, Base::ViewRefType view, beast::Journal j=beast::Journal{beast::Journal::getNullSink()})
Definition AMMEntry.h:24
AMMEntry(UInt256 const &ammID, Base::ViewRefType view, beast::Journal j=beast::Journal{beast::Journal::getNullSink()})
Definition AMMEntry.h:33
SLEBase< ViewT, ltAMM > Base
Definition AMMEntry.h:18
std::conditional_t< kIsWritable, ApplyView &, ReadView const & > ViewRefType
Definition SLEBase.h:106
SLEBase(SLEBase const &)=default
Keylet computation functions.
Definition Indexes.h:40
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
BaseUInt< 256 > UInt256
Definition base_uint.h:580
AMMEntry< ReadView > AMMEntryR
Definition AMMEntry.h:42
AMMEntry< ApplyView > AMMEntryW
Definition AMMEntry.h:43