blob: 40ca5116f6e508269ac9d962643ad8fe1bfc4219 [file] [log] [blame]
// Copyright 2015 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "attestation/common/database.pb.h"
namespace attestation {
// Manages a persistent database of attestation-related data.
class Database {
virtual ~Database() = default;
// Const access to the database protobuf.
virtual const AttestationDatabase& GetProtobuf() const = 0;
// Mutable access to the database protobuf. Changes made to the protobuf will
// be reflected immediately by GetProtobuf() but will not be persisted to disk
// until SaveChanges is called successfully.
virtual AttestationDatabase* GetMutableProtobuf() = 0;
// Writes the current database protobuf to disk.
virtual bool SaveChanges() = 0;
// Reloads the database protobuf from disk.
virtual bool Reload() = 0;
} // namespace attestation