25 lines
506 B
C++
25 lines
506 B
C++
#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
|