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>
29 template <
typename T,
typename = std::enable_if_t<std::is_same_v<T, Tx>>>
34 [[nodiscard]]
ID const&
87 return txs_.insert(t).second;
93 return txs_.erase(
Tx{txId}) > 0;
110 auto it =
txs_.find(
Tx{txId});
111 return it !=
txs_.end();
114 [[nodiscard]]
Tx const*
117 auto it =
txs_.find(
Tx{txId});
118 if (it !=
txs_.end())
144 auto populateDiffs = [&res](
auto const& a,
auto const& b,
bool s) {
145 auto populator = [&](
auto const& tx) { res[tx.id()] = s; };
151 boost::make_function_output_iterator(
std::ref(populator)));
154 populateDiffs(
txs_, other.
txs_,
true);
155 populateDiffs(other.
txs_,
txs_,
false);
181 bool doComma =
false;
182 for (
auto const& t : ts)
206template <
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
std::enable_if_t< IsContiguouslyHashable< T, Hasher >::value > 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