20 #include <ripple/basics/Log.h>
21 #include <ripple/basics/StringUtilities.h>
22 #include <ripple/basics/contract.h>
23 #include <ripple/basics/strHex.h>
24 #include <ripple/protocol/STPathSet.h>
25 #include <ripple/protocol/jss.h>
41 hash_account += (hash_account * 257) ^ x;
44 hash_currency += (hash_currency * 509) ^ x;
47 hash_issuer += (hash_issuer * 911) ^ x;
49 return (hash_account ^ hash_currency ^ hash_issuer);
57 int iType = sit.
get8();
64 JLOG(
debugLog().error()) <<
"Empty path in pathset";
65 Throw<std::runtime_error>(
"empty path");
77 <<
"Bad path element " << iType <<
" in pathset";
78 Throw<std::runtime_error>(
"bad path element");
99 path.emplace_back(account, currency, issuer, hasCurrency);
113 return emplace(n, buf, std::move(*
this));
119 value.push_back(base);
126 while (++it !=
value.rend())
147 return value.empty();
156 for (
auto& p :
mPath)
158 if (p.getAccountID() == account && p.getCurrency() == currency &&
159 p.getIssuerID() == issuer)
170 for (
auto it :
mPath)
173 auto const iType = it.getNodeType();
175 elem[jss::type] = iType;
178 elem[jss::account] =
to_string(it.getAccountID());
181 elem[jss::currency] =
to_string(it.getCurrency());
184 elem[jss::issuer] =
to_string(it.getIssuerID());
196 for (
auto it :
value)
197 ret.
append(it.getJson(options));
215 for (
auto const& spPath :
value)
220 for (
auto const& speElement : spPath)
222 int iType = speElement.getNodeType();
void push_back(STPathElement const &e)
static std::size_t get_hash(STPathElement const &element)
@ arrayValue
array value (ordered list)
std::vector< STPathElement > mPath
SerializedTypeID getSType() const override
Currency const & getCurrency() const
int add8(unsigned char i)
STBase * copy(std::size_t n, void *buf) const override
beast::Journal debugLog()
Returns a debug journal.
bool isEquivalent(const STBase &t) const override
Value & append(const Value &value)
Append value to array at the end.
@ objectValue
object value (collection of name/value pairs).
static STBase * emplace(std::size_t n, void *buf, T &&val)
void add(Serializer &s) const override
bool isDefault() const override
AccountID const & getIssuerID() const
SField const & getFName() const
Json::Value getJson(JsonOptions) const
bool hasSeen(AccountID const &account, Currency const ¤cy, AccountID const &issuer) const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
int addBitString(base_uint< Bits, Tag > const &v)
std::vector< STPath > value
A type which can be exported to a well known binary format.
Json::Value getJson(JsonOptions) const override
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
bool assembleAdd(STPath const &base, STPathElement const &tail)
STBase * move(std::size_t n, void *buf) override
void push_back(STPath const &e)
AccountID const & getAccountID() const