1 #ifndef CACHEDDATASTORAGE_H 2 #define CACHEDDATASTORAGE_H 7 template <
typename Data>
14 std::shared_ptr<Data>
data =
nullptr;
29 d.data = std::make_shared<Data>(std::move(n));
61 if (!d.dirty && d.cachedTstep ==
tstep)
72 #endif // CACHEDDATASTORAGE_H
CachedDataStorage()
Definition: cacheddatastorage.h:33
std::vector< Record > cachedData
Definition: cacheddatastorage.h:17
utils::StrongType< uint16_t, TStepTag > tstep_t
Definition: modeltypes.h:12
virtual ~CachedDataStorage() noexcept=default
void updateData(types::tstep_t step, Data n)
Definition: cacheddatastorage.h:25
std::shared_ptr< Data > getData(types::NodeId nodeId, types::tstep_t tstep)
Definition: cacheddatastorage.h:57
int tstep
Definition: main.cpp:205
bool dirty
Definition: cacheddatastorage.h:12
void invalidateAllCache()
Definition: cacheddatastorage.h:36
Definition: cacheddatastorage.h:8
std::shared_ptr< Data > data
Definition: cacheddatastorage.h:14
Definition: cacheddatastorage.h:11
C toIndex() const
Definition: idtypes.h:26
types::tstep_t cachedTstep
Definition: cacheddatastorage.h:13
Record & getRecord(types::NodeId nodeId)
Definition: cacheddatastorage.h:19
virtual void queryAllData(types::tstep_t step)=0
void refreshAllData(types::tstep_t step)
Definition: cacheddatastorage.h:46