20 #ifndef RIPPLE_LEDGER_APPLYVIEW_H_INCLUDED
21 #define RIPPLE_LEDGER_APPLYVIEW_H_INCLUDED
23 #include <ripple/basics/safe_cast.h>
24 #include <ripple/ledger/RawView.h>
25 #include <ripple/ledger/ReadView.h>
47 return safe_cast<ApplyFlags>(
54 "ApplyFlags operator |");
57 "ApplyFlags operator |");
62 return safe_cast<ApplyFlags>(
73 return safe_cast<ApplyFlags>(
78 ~
tapRETRY == safe_cast<ApplyFlags>(0xFFFFFFDFu),
79 "ApplyFlags operator ~");
279 assert(!
"Only Offers are appended to book directories. "
280 "Call dirInsert() instead.");
283 return dirAdd(
true, directory, key.
key, describe);
311 return dirAdd(
false, directory, key, describe);
320 return dirAdd(
false, directory, key.
key, describe);
ApplyFlags operator&=(ApplyFlags &lhs, ApplyFlags const &rhs)
A pair of SHAMap key and LedgerEntryType.
constexpr base_uint< Bits, Tag > operator|(base_uint< Bits, Tag > const &a, base_uint< Bits, Tag > const &b)
std::optional< std::uint64_t > dirInsert(Keylet const &directory, Keylet const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
virtual void erase(std::shared_ptr< SLE > const &sle)=0
Remove a peeked SLE.
virtual void creditHook(AccountID const &from, AccountID const &to, STAmount const &amount, STAmount const &preCreditBalance)
virtual void update(std::shared_ptr< SLE > const &sle)=0
Indicate changes to a peeked SLE.
Writeable view to a ledger, for applying a transaction.
bool dirRemove(Keylet const &directory, std::uint64_t page, uint256 const &key, bool keepRoot)
Remove an entry from a directory.
ApplyFlags operator|=(ApplyFlags &lhs, ApplyFlags const &rhs)
@ ltOFFER
A ledger object which describes an offer on the DEX.
std::optional< std::uint64_t > dirAppend(Keylet const &directory, Keylet const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
Append an entry to a directory.
constexpr std::enable_if_t< std::is_same_v< typename Dest::unit_type, typename Src::unit_type > &&std::is_integral_v< typename Dest::value_type > &&std::is_integral_v< typename Src::value_type >, Dest > safe_cast(Src s) noexcept
std::optional< std::uint64_t > dirAdd(bool preserveOrder, Keylet const &directory, uint256 const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
Add an entry to a directory using the specified insert strategy.
bool dirDelete(Keylet const &directory, std::function< void(uint256 const &)> const &)
Remove the specified directory, invoking the callback for every node.
virtual void adjustOwnerCountHook(AccountID const &account, std::uint32_t cur, std::uint32_t next)
bool dirRemove(Keylet const &directory, std::uint64_t page, Keylet const &key, bool keepRoot)
virtual void insert(std::shared_ptr< SLE > const &sle)=0
Insert a new state SLE.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr base_uint< Bits, Tag > operator&(base_uint< Bits, Tag > const &a, base_uint< Bits, Tag > const &b)
bool emptyDirDelete(Keylet const &directory)
Remove the specified directory, if it is empty.
virtual ApplyFlags flags() const =0
Returns the tx apply flags.
std::optional< std::uint64_t > dirInsert(Keylet const &directory, uint256 const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
Insert an entry to a directory.
constexpr ApplyFlags operator~(ApplyFlags const &flags)