3#include <xrpl/basics/CountedObject.h>
4#include <xrpl/basics/UnorderedContainers.h>
5#include <xrpl/beast/utility/instrumentation.h>
6#include <xrpl/json/json_value.h>
7#include <xrpl/protocol/AccountID.h>
8#include <xrpl/protocol/PathAsset.h>
9#include <xrpl/protocol/SField.h>
10#include <xrpl/protocol/STBase.h>
11#include <xrpl/protocol/Serializer.h>
12#include <xrpl/protocol/UintTypes.h>
62 bool forceAsset =
false);
105 [[nodiscard]]
MPTID const&
122template <
class Hasher>
151 template <
typename... Args>
160 [[nodiscard]] std::vector<STPathElement>::const_iterator
163 [[nodiscard]] std::vector<STPathElement>::const_iterator
185template <
class Hasher>
190 for (
auto const& e : p)
268 [[nodiscard]] std::vector<STPath>::const_iterator
271 [[nodiscard]] std::vector<STPath>::const_iterator
309 template <
typename... Args>
331 template <
typename Append>
377 XRPL_ASSERT(
issuerID_ !=
noAccount(),
"xrpl::STPathElement::STPathElement : issuer is set");
447 return (
type_ & pe) != 0u;
534 return path_.empty();
543template <
typename... Args>
550inline std::vector<STPathElement>::const_iterator
553 return path_.begin();
556inline std::vector<STPathElement>::const_iterator
577 return path_.front();
611inline std::vector<STPath>::const_iterator
617inline std::vector<STPath>::const_iterator
635template <
typename Append>
644 if (
seen_ ==
nullptr)
671 return appendUnique([&](
auto& value) { value.push_back(e); });
674template <
typename... Args>
constexpr bool holds() const
static std::size_t getHash(STPathElement const &element)
std::uint32_t getNodeType() const
AccountID const & getAccountID() const
PathAsset const & getPathAsset() const
MPTID const & getMPTID() const
STPathElement(STPathElement const &)=default
Currency const & getCurrency() const
bool operator==(STPathElement const &t) const
STPathElement & operator=(STPathElement const &)=default
AccountID const & getIssuerID() const
bool isType(Type const &pe) const
void add(Serializer &s) const override
std::vector< STPath >::const_iterator begin() const
bool assembleAdd(STPath const &base, STPathElement const &tail)
assembleAdd adds a path to the set by combining a base path and a tail element.
~STPathSet() override=default
std::vector< STPath >::const_reference operator[](std::vector< STPath >::size_type n) const
STBase * copy(std::size_t n, void *buf) const override
std::vector< STPath >::size_type size() const
json::Value getJson(JsonOptions) const override
bool pushBack(STPath const &e)
pushBack adds a path to the set.
std::vector< STPath > value_
STBase * move(std::size_t n, void *buf) override
bool emplaceBack(Args &&... args)
emplaceBack adds a path to the set.
std::vector< STPath >::const_iterator end() const
STPathSet & operator=(STPathSet &&)=default
bool isEquivalent(STBase const &t) const override
std::unique_ptr< HardenedHashSet< STPath > > seen_
Deduplication index over value_, for pathfinding.
bool isDefault() const override
SerializedTypeID getSType() const override
STPathSet(STPathSet &&)=default
STPathSet & operator=(STPathSet const &other)
bool appendUnique(Append &&append)
Append a path via append, then register it in the deduplication index.
std::vector< STPathElement > path_
std::vector< STPathElement >::size_type size() const
bool hasSeen(AccountID const &account, PathAsset const &asset, AccountID const &issuer) const
bool operator==(STPath const &t) const
STPathElement & operator[](int i)
void pushBack(STPathElement const &e)
std::vector< STPathElement >::const_iterator end() const
std::vector< STPathElement >::const_reference front() const
void emplaceBack(Args &&... args)
std::vector< STPathElement >::const_reference back() const
std::vector< STPathElement >::const_iterator begin() const
json::Value getJson(JsonOptions) const
void hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool isXRP(AccountID const &c)
BaseUInt< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
BaseUInt< 192 > MPTID
MPTID is a 192-bit value representing MPT Issuance ID, which is a concatenation of a 32-bit sequence ...
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
AccountID const & noAccount()
A placeholder for empty accounts.
void hash_append(Hasher &h, Slice const &v)
Note, should be treated as flags that can be | and &.