20#ifndef RIPPLE_TEST_CSF_TX_H_INCLUDED
21#define RIPPLE_TEST_CSF_TX_H_INCLUDED
23#include <xrpl/beast/hash/hash_append.h>
24#include <xrpl/beast/hash/uhash.h>
26#include <boost/container/flat_set.hpp>
27#include <boost/iterator/function_output_iterator.hpp>
50 template <
typename T,
typename = std::enable_if_t<std::is_same_v<T, Tx>>>
108 return txs_.insert(t).second;
114 return txs_.erase(
Tx{txId}) > 0;
130 auto it =
txs_.find(
Tx{txId});
131 return it !=
txs_.end();
137 auto it =
txs_.find(
Tx{txId});
138 if (it !=
txs_.end())
164 auto populate_diffs = [&res](
auto const& a,
auto const& b,
bool s) {
165 auto populator = [&](
auto const& tx) { res[tx.id()] = s; };
171 boost::make_function_output_iterator(
std::ref(populator)));
174 populate_diffs(
txs_, other.
txs_,
true);
175 populate_diffs(other.
txs_,
txs_,
false);
201 bool do_comma =
false;
202 for (
auto const& t : ts)
222template <
class Hasher>
bool erase(Tx::ID const &txId)
MutableTxSet(TxSet const &s)
TxSet is a set of transactions to consider including in the ledger.
std::map< Tx::ID, bool > compare(TxSet const &other) const
TxSet(TxSetType const &s)
TxSetType const & txs() const
ID id_
The unique ID of this tx set.
beast::uhash<>::result_type ID
static ID calcID(TxSetType const &txs)
Tx const * find(Tx::ID const &txId) const
bool exists(Tx::ID const txId) const
TxSetType txs_
The set contains the actual transactions.
bool operator<(Tx const &o) const
bool operator==(Tx const &o) const
std::enable_if_t< is_contiguously_hashable< T, Hasher >::value > hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
std::ostream & operator<<(std::ostream &o, Tx const &t)
boost::container::flat_set< Tx > TxSetType
std::string to_string(TxSetType const &txs)
void hash_append(Hasher &h, Tx const &tx)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
T set_difference(T... args)
typename Hasher::result_type result_type