3#include <xrpl/beast/hash/hash_append.h>
4#include <xrpl/beast/hash/uhash.h>
6#include <boost/container/flat_set.hpp>
7#include <boost/iterator/function_output_iterator.hpp>
39 [[nodiscard]]
ID const&
96 return txs_.insert(t).second;
102 return txs_.erase(
Tx{txId}) > 0;
119 auto it =
txs_.find(
Tx{txId});
120 return it !=
txs_.end();
123 [[nodiscard]]
Tx const*
126 auto it =
txs_.find(
Tx{txId});
127 if (it !=
txs_.end())
154 auto populateDiffs = [&res](
auto const& a,
auto const& b,
bool s) {
155 auto populator = [&](
auto const& tx) { res[tx.id()] = s; };
161 boost::make_function_output_iterator(
std::ref(populator)));
164 populateDiffs(
txs_, other.
txs_,
true);
165 populateDiffs(other.
txs_,
txs_,
false);
195 bool doComma =
false;
196 for (
auto const& t : ts)
220template <
class Hasher>
MutableTxSet(TxSet const &s)
bool erase(Tx::ID const &txId)
TxSetType txs_
The set contains the actual transactions.
beast::Uhash<>::result_type ID
static ID calcID(TxSetType const &txs)
ID id_
The unique ID of this tx set.
std::map< Tx::ID, bool > compare(TxSet const &other) const
Tx const * find(Tx::ID const &txId) const
TxSetType const & txs() const
bool exists(Tx::ID const txId) const
bool operator<(Tx const &o) const
bool operator==(Tx const &o) const
void hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
std::string to_string(TxSetType const &txs)
boost::container::flat_set< Tx > TxSetType
std::ostream & operator<<(std::ostream &o, Tx const &t)
void hash_append(Hasher &h, Tx const &tx)
T set_difference(T... args)
Hasher::result_type result_type