xrpld
Loading...
Searching...
No Matches
OfferEntry.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/AccountID.h>
9#include <xrpl/protocol/Indexes.h>
10#include <xrpl/protocol/LedgerFormats.h>
11#include <xrpl/protocol/SeqProxy.h>
12
13namespace xrpl {
14
15template <typename ViewT>
16class OfferEntry : public SLEBase<ViewT, ltOFFER>
17{
18public:
20
21 // Inherit base constructors: adopt an existing SLE, or resolve one from a
22 // Keylet against the view.
23 using Base::Base;
24
25 explicit OfferEntry(
26 AccountID const& id,
27 SeqProxy const& seq,
30 : Base(keylet::offer(id, seq), view, j)
31 {
32 }
33
34 explicit OfferEntry(
35 UInt256 const& offerID,
38 : Base(keylet::offer(offerID), view, j)
39 {
40 }
41};
42
45
46} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
static Sink & getNullSink()
Returns a Sink which does nothing.
SLEBase< ViewT, ltOFFER > Base
Definition OfferEntry.h:19
OfferEntry(AccountID const &id, SeqProxy const &seq, Base::ViewRefType view, beast::Journal j=beast::Journal{beast::Journal::getNullSink()})
Definition OfferEntry.h:25
OfferEntry(UInt256 const &offerID, Base::ViewRefType view, beast::Journal j=beast::Journal{beast::Journal::getNullSink()})
Definition OfferEntry.h:34
std::conditional_t< kIsWritable, ApplyView &, ReadView const & > ViewRefType
Definition SLEBase.h:106
SLEBase(SLEBase const &)=default
A type that represents either a sequence value or a ticket value.
Definition SeqProxy.h:37
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
OfferEntry< ApplyView > OfferEntryW
Definition OfferEntry.h:44
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:34
OfferEntry< ReadView > OfferEntryR
Definition OfferEntry.h:43