rippled
|
This datastructure is used to keep track of the sequence of the most recent ledger validated by the network. More...
Public Member Functions | |
void | push (uint32_t idx) |
Notify the datastructure that idx has been validated by the network. More... | |
std::optional< uint32_t > | getMostRecent () const |
Get most recently validated sequence. More... | |
std::optional< uint32_t > | tryGetMostRecent () const |
Get most recently validated sequence. More... | |
bool | waitUntilValidatedByNetwork (uint32_t sequence) |
Waits for the sequence to be validated by the network. More... | |
void | stop () |
Puts the datastructure in the stopped state Future calls to this datastructure will not block This operation cannot be reversed. More... | |
Private Attributes | |
std::optional< uint32_t > | max_ |
std::mutex | m_ |
std::condition_variable | cv_ |
bool | stopping_ = false |
This datastructure is used to keep track of the sequence of the most recent ledger validated by the network.
There are two methods that will wait until certain conditions are met. This datastructure is able to be "stopped". When the datastructure is stopped, any threads currently waiting are unblocked. Any later calls to methods of this datastructure will not wait. Once the datastructure is stopped, the datastructure remains stopped for the rest of its lifetime.
Definition at line 39 of file ETLHelpers.h.
void ripple::NetworkValidatedLedgers::push | ( | uint32_t | idx | ) |
Notify the datastructure that idx has been validated by the network.
idx | sequence validated by network |
Definition at line 54 of file ETLHelpers.h.
std::optional<uint32_t> ripple::NetworkValidatedLedgers::getMostRecent | ( | ) | const |
Get most recently validated sequence.
If no ledgers are known to have been validated, this function waits until the next ledger is validated
Definition at line 67 of file ETLHelpers.h.
std::optional<uint32_t> ripple::NetworkValidatedLedgers::tryGetMostRecent | ( | ) | const |
Get most recently validated sequence.
Definition at line 78 of file ETLHelpers.h.
bool ripple::NetworkValidatedLedgers::waitUntilValidatedByNetwork | ( | uint32_t | sequence | ) |
Waits for the sequence to be validated by the network.
sequence | to wait for |
Definition at line 89 of file ETLHelpers.h.
void ripple::NetworkValidatedLedgers::stop | ( | ) |
Puts the datastructure in the stopped state Future calls to this datastructure will not block This operation cannot be reversed.
Definition at line 102 of file ETLHelpers.h.
|
private |
Definition at line 42 of file ETLHelpers.h.
|
mutableprivate |
Definition at line 44 of file ETLHelpers.h.
|
mutableprivate |
Definition at line 46 of file ETLHelpers.h.
|
private |
Definition at line 48 of file ETLHelpers.h.