-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodem_helper_directory.h
37 lines (26 loc) · 1.01 KB
/
modem_helper_directory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2017 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.
#ifndef MODEMFWD_MODEM_HELPER_DIRECTORY_H_
#define MODEMFWD_MODEM_HELPER_DIRECTORY_H_
#include <memory>
#include <string>
#include <base/callback.h>
#include <base/files/file_path.h>
namespace modemfwd {
class ModemHelper;
class ModemHelperDirectory {
public:
virtual ~ModemHelperDirectory() = default;
// Returns a weak pointer. Ensure users do not outlive the directory.
virtual ModemHelper* GetHelperForDeviceId(const std::string& device_id) = 0;
// Calls |callback| for each pair of {device_id, helper} known to the
// ModemHelperDirectory.
virtual void ForEachHelper(
const base::Callback<void(const std::string&, ModemHelper*)>&
callback) = 0;
};
std::unique_ptr<ModemHelperDirectory> CreateModemHelperDirectory(
const base::FilePath& directory);
} // namespace modemfwd
#endif // MODEMFWD_MODEM_HELPER_DIRECTORY_H_