19#ifndef RIPPLE_TEST_CSF_TX_H_INCLUDED
20#define RIPPLE_TEST_CSF_TX_H_INCLUDED
21#include <xrpl/beast/hash/hash_append.h>
22#include <xrpl/beast/hash/uhash.h>
23#include <boost/container/flat_set.hpp>
24#include <boost/iterator/function_output_iterator.hpp>
46 template <
typename T,
typename = std::enable_if_t<std::is_same_v<T, Tx>>>
104 return txs_.insert(t).second;
110 return txs_.erase(
Tx{txId}) > 0;
126 auto it =
txs_.find(
Tx{txId});
127 return it !=
txs_.end();
133 auto it =
txs_.find(
Tx{txId});
134 if (it !=
txs_.end())
160 auto populate_diffs = [&res](
auto const& a,
auto const& b,
bool s) {
161 auto populator = [&](
auto const& tx) { res[tx.id()] = s; };
167 boost::make_function_output_iterator(
std::ref(populator)));
170 populate_diffs(
txs_, other.
txs_,
true);
171 populate_diffs(other.
txs_,
txs_,
false);
197 bool do_comma =
false;
198 for (
auto const& t : ts)
218template <
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.
boost::container::flat_set< Tx > TxSetType
std::string to_string(TxSetType const &txs)
void hash_append(Hasher &h, Tx const &tx)
std::ostream & operator<<(std::ostream &o, const Tx &t)
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