| #ifndef PRODUCTION_SUSHID_SAFEPOWER_AGENT_PERSISTENT_STORAGE_H_ |
| #define PRODUCTION_SUSHID_SAFEPOWER_AGENT_PERSISTENT_STORAGE_H_ |
| |
| #include "state_persistence.pb.h" |
| #include "absl/status/status.h" |
| #include "absl/status/statusor.h" |
| namespace safepower_agent { |
| |
| // This class is responsible for reading and writing saved state from |
| // persistent storage. It should manage a single persistent instance of |
| // SavedActions consisting of all saved actions. |
| class PersistentStorageManager { |
| public: |
| virtual ~PersistentStorageManager() = default; |
| |
| // Writes a delta to the saved actions to persistent storage. |
| virtual absl::Status WriteSavedActionsChange( |
| const safepower_agent_persistence_proto::SavedActions& actions) = 0; |
| |
| // Reads all saved actions from persistent storage. |
| virtual absl::StatusOr<safepower_agent_persistence_proto::SavedActions> |
| ReadSavedActions() = 0; |
| }; |
| |
| } // namespace safepower_agent |
| |
| #endif // PRODUCTION_SUSHID_SAFEPOWER_AGENT_PERSISTENT_STORAGE_H_ |