blob: d69fa436d736af99b40ae1032d1ee3a1049077cb [file] [log] [blame]
alanlxl30f15bd2020-08-11 21:26:12 +10001// Copyright 2020 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FEDERATED_STORAGE_MANAGER_IMPL_H_
6#define FEDERATED_STORAGE_MANAGER_IMPL_H_
7
8#include "federated/storage_manager.h"
9
10#include <string>
11#include <base/sequence_checker.h>
12
13namespace federated {
14
15class StorageManagerImpl : public StorageManager {
16 public:
17 StorageManagerImpl() = default;
Qijiang Fan6bc59e12020-11-11 02:51:06 +090018 StorageManagerImpl(const StorageManagerImpl&) = delete;
19 StorageManagerImpl& operator=(const StorageManagerImpl&) = delete;
20
alanlxl30f15bd2020-08-11 21:26:12 +100021 ~StorageManagerImpl() override = default;
22
23 bool OnExampleReceived(const std::string& client_name,
24 const std::string& serialized_example) override;
25
26 bool PrepareStreamingForClient(const std::string& client_name) override;
27 bool GetNextExample(std::string* example) override;
28 bool CloseStreaming() override;
29
30 private:
31 SEQUENCE_CHECKER(sequence_checker_);
alanlxl30f15bd2020-08-11 21:26:12 +100032};
33
34} // namespace federated
35
36#endif // FEDERATED_STORAGE_MANAGER_IMPL_H_