20 #ifndef RIPPLE_APP_REPORTING_ETLHELPERS_H_INCLUDED
21 #define RIPPLE_APP_REPORTING_ETLHELPERS_H_INCLUDED
22 #include <ripple/app/main/Application.h>
23 #include <ripple/ledger/ReadView.h>
92 cv_.
wait(lck, [sequence,
this]() {
155 queue_.push(std::move(elt));
165 T ret = std::move(
queue_.front());
179 assert(numMarkers <= 256);
181 unsigned char incr = 256 / numMarkers;
186 for (
size_t i = 0; i < numMarkers; ++i)
189 base.
data()[0] += incr;
Generic thread-safe queue with an optional maximum size Note, we can't use a lockfree queue here,...
std::condition_variable cv_
void push(uint32_t idx)
Notify the datastructure that idx has been validated by the network.
bool waitUntilValidatedByNetwork(uint32_t sequence)
Waits for the sequence to be validated by the network.
void stop()
Puts the datastructure in the stopped state Future calls to this datastructure will not block This op...
This datastructure is used to keep track of the sequence of the most recent ledger validated by the n...
ThreadSafeQueue()=default
Create a queue with no maximum size.
std::optional< uint32_t > getMostRecent() const
Get most recently validated sequence.
std::optional< uint32_t > max_
std::optional< uint32_t > maxSize_
std::optional< uint32_t > tryGetMostRecent() const
Get most recently validated sequence.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
ThreadSafeQueue(uint32_t maxSize)
std::vector< uint256 > getMarkers(size_t numMarkers)
Parititions the uint256 keyspace into numMarkers partitions, each of equal size.
std::condition_variable cv_