bolar_2 backup
This commit is contained in:
24
main/memory/memory_cache.h
Normal file
24
main/memory/memory_cache.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "ports/memory_cache.h"
|
||||
|
||||
#include <mutex>
|
||||
|
||||
namespace borla {
|
||||
|
||||
class NvsMemoryCache final : public IMemoryCache {
|
||||
public:
|
||||
bool Load() override;
|
||||
void CopySnapshot(MemorySnapshot* output) const override;
|
||||
bool Update(const MemorySnapshot& snapshot) override;
|
||||
|
||||
private:
|
||||
bool LoadNvsLocked();
|
||||
bool LoadLegacyPartitionLocked();
|
||||
bool SaveLocked(const MemorySnapshot& snapshot);
|
||||
|
||||
mutable std::mutex mutex_;
|
||||
MemorySnapshot snapshot_{};
|
||||
};
|
||||
|
||||
} // namespace borla
|
||||
Reference in New Issue
Block a user