Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
Cache.hpp
1#pragma once
2
3#include "etl/CacheUpdaterInterface.hpp"
4#include "etl/Models.hpp"
5#include "etl/impl/CacheUpdater.hpp"
6#include "util/log/Logger.hpp"
7
8#include <cstdint>
9#include <memory>
10#include <string>
11#include <vector>
12
13namespace etl::impl {
14
15class CacheExt {
16 std::shared_ptr<CacheUpdaterInterface> cacheUpdater_;
17
18 util::Logger log_{"ETL"};
19
20public:
21 CacheExt(std::shared_ptr<CacheUpdaterInterface> cacheUpdater);
22
23 void
24 onLedgerData(model::LedgerData const& data);
25
26 void
27 onInitialData(model::LedgerData const& data);
28
29 void
30 onInitialObjects(
31 uint32_t seq,
32 std::vector<model::Object> const& objs,
33 [[maybe_unused]] std::string lastKey
34 );
35
36 // We want cache updates through ETL if we are a potential writer but currently are not writing
37 // to DB
38 static bool
39 allowInReadonly()
40 {
41 return true;
42 }
43};
44
45} // namespace etl::impl
A simple thread-safe logger for the channel specified in the constructor.
Definition Logger.hpp:77
This namespace implements the data access layer and related components.
Definition AmendmentCenter.cpp:56
Represents an entire ledger diff worth of transactions and objects.
Definition Models.hpp:124