20 #ifndef RIPPLE_APP_PENDINGSAVES_H_INCLUDED
21 #define RIPPLE_APP_PENDINGSAVES_H_INCLUDED
23 #include <ripple/protocol/Protocol.h>
55 auto it =
map_.find(seq);
57 if ((it ==
map_.end()) || it->second)
104 auto it =
map_.find(seq);
106 if (it ==
map_.end())
108 map_.emplace(seq,
false);
bool pending(LedgerIndex seq)
Return true if a ledger is in the progress of being saved.
Keeps track of which ledgers haven't been fully saved.
bool startWork(LedgerIndex seq)
Start working on a ledger.
std::condition_variable await_
void finishWork(LedgerIndex seq)
Finish working on a ledger.
bool shouldWork(LedgerIndex seq, bool isSynchronous)
Check if a ledger should be dispatched.
std::map< LedgerIndex, bool > getSnapshot() const
Get a snapshot of the pending saves.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::map< LedgerIndex, bool > map_