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>
26 #include <boost/optional.hpp>
53 return safe_cast<ApplyFlags>(
60 "ApplyFlags operator |");
63 "ApplyFlags operator |");
68 return safe_cast<ApplyFlags>(
79 return safe_cast<ApplyFlags>(
84 ~
tapRETRY == safe_cast<ApplyFlags>(0xFFFFFFDFu),
85 "ApplyFlags operator ~");
144 boost::optional<std::uint64_t>
277 boost::optional<std::uint64_t>
283 return dirAdd(
true, directory, key, describe);
286 boost::optional<std::uint64_t>
314 boost::optional<std::uint64_t>
320 return dirAdd(
false, directory, key, describe);
323 boost::optional<std::uint64_t>
ApplyFlags operator&=(ApplyFlags &lhs, ApplyFlags const &rhs)
A pair of SHAMap key and LedgerEntryType.
const base_uint< Bits, Tag > operator|(base_uint< Bits, Tag > const &a, base_uint< Bits, Tag > const &b)
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.
boost::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.
boost::optional< std::uint64_t > dirInsert(Keylet const &directory, Keylet const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
virtual void creditHook(AccountID const &from, AccountID const &to, STAmount const &amount, STAmount const &preCreditBalance)
boost::optional< std::uint64_t > dirAppend(Keylet const &directory, uint256 const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
Append an entry to a directory.
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.
boost::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 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)
boost::optional< std::uint64_t > dirAppend(Keylet const &directory, Keylet const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
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
virtual void adjustOwnerCountHook(AccountID const &account, std::uint32_t cur, std::uint32_t next)
const base_uint< Bits, Tag > operator&(base_uint< Bits, Tag > const &a, base_uint< Bits, Tag > const &b)
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.
bool emptyDirDelete(Keylet const &directory)
Remove the specified directory, if it is empty.
virtual ApplyFlags flags() const =0
Returns the tx apply flags.
constexpr ApplyFlags operator~(ApplyFlags const &flags)