22#include "data/LedgerCacheInterface.hpp"
51 [[nodiscard]]
virtual bool
65 [[nodiscard]]
virtual bool
74 [[nodiscard]]
virtual std::unique_ptr<LedgerCacheLoadingStateInterface>
85 std::reference_wrapper<LedgerCacheInterface const> cache_;
86 std::shared_ptr<std::atomic_bool> isLoadingAllowed_ = std::make_shared<std::atomic_bool>(
false);
112 [[nodiscard]] std::unique_ptr<LedgerCacheLoadingStateInterface>
113 clone()
const override;
Cache for an entire ledger.
Definition LedgerCacheInterface.hpp:40
Interface for coordinating cache loading permissions across a cluster.
Definition LedgerCacheLoadingState.hpp:37
virtual void waitForLoadingAllowed() const =0
Block until loading is permitted.
virtual std::unique_ptr< LedgerCacheLoadingStateInterface > clone() const =0
Create a clone that shares the same loading-allowed flag.
virtual bool isCurrentlyLoading() const =0
Check whether the cache is currently being loaded from the backend.
virtual bool isLoadingAllowed() const =0
Check whether loading has been permitted.
virtual void allowLoading()=0
Allow this node to begin loading the cache from the backend.
bool isCurrentlyLoading() const override
Check whether the cache is currently being loaded from the backend.
Definition LedgerCacheLoadingState.cpp:52
std::unique_ptr< LedgerCacheLoadingStateInterface > clone() const override
Create a clone that shares the same loading-allowed flag.
Definition LedgerCacheLoadingState.cpp:58
LedgerCacheLoadingState(LedgerCacheInterface const &cache)
Construct a new LedgerCacheLoadingState.
Definition LedgerCacheLoadingState.cpp:28
void allowLoading() override
Allow this node to begin loading the cache from the backend.
Definition LedgerCacheLoadingState.cpp:33
bool isLoadingAllowed() const override
Check whether loading has been permitted.
Definition LedgerCacheLoadingState.cpp:40
void waitForLoadingAllowed() const override
Block until loading is permitted.
Definition LedgerCacheLoadingState.cpp:46
This namespace implements the data access layer and related components.
Definition AmendmentCenter.cpp:75