Files
clio/src/data/LedgerCacheLoadingState.cpp
Alex Kremer 4e85398aed chore: Remove more copyrights from code (#3012)
More copyrights detected following #2975
2026-03-24 15:33:12 +00:00

45 lines
823 B
C++

#include "data/LedgerCacheLoadingState.hpp"
#include "data/LedgerCacheInterface.hpp"
#include <memory>
namespace data {
LedgerCacheLoadingState::LedgerCacheLoadingState(LedgerCacheInterface const& cache) : cache_(cache)
{
}
void
LedgerCacheLoadingState::allowLoading()
{
*isLoadingAllowed_ = true;
isLoadingAllowed_->notify_all();
}
bool
LedgerCacheLoadingState::isLoadingAllowed() const
{
return *isLoadingAllowed_;
}
void
LedgerCacheLoadingState::waitForLoadingAllowed() const
{
isLoadingAllowed_->wait(false);
}
bool
LedgerCacheLoadingState::isCurrentlyLoading() const
{
return cache_.get().isCurrentlyLoading();
}
std::unique_ptr<LedgerCacheLoadingStateInterface>
LedgerCacheLoadingState::clone() const
{
return std::make_unique<LedgerCacheLoadingState>(*this);
}
} // namespace data