[M73 Dev][Tizen] Fix linker errors
[platform/framework/web/chromium-efl.git] / services / device / serial / serial_device_enumerator.h
1 // Copyright 2014 The Chromium 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 SERVICES_DEVICE_SERIAL_SERIAL_DEVICE_ENUMERATOR_H_
6 #define SERVICES_DEVICE_SERIAL_SERIAL_DEVICE_ENUMERATOR_H_
7
8 #include <map>
9 #include <memory>
10 #include <vector>
11
12 #include "base/optional.h"
13 #include "services/device/public/mojom/serial.mojom.h"
14 #include "services/device/serial/serial_io_handler.h"
15
16 namespace base {
17 class FilePath;
18 }
19
20 namespace device {
21
22 // Discovers and enumerates serial devices available to the host.
23 class SerialDeviceEnumerator {
24  public:
25   using TokenPathMap = std::map<base::UnguessableToken, base::FilePath>;
26
27   static std::unique_ptr<SerialDeviceEnumerator> Create();
28
29   SerialDeviceEnumerator();
30   virtual ~SerialDeviceEnumerator();
31
32   virtual std::vector<mojom::SerialPortInfoPtr> GetDevices() = 0;
33
34   base::Optional<base::FilePath> GetPathFromToken(
35       const base::UnguessableToken& token);
36
37  protected:
38   const base::UnguessableToken& GetTokenFromPath(const base::FilePath& path);
39
40  private:
41   TokenPathMap token_path_map_;
42 };
43
44 }  // namespace device
45
46 #endif  // SERVICES_DEVICE_SERIAL_SERIAL_DEVICE_ENUMERATOR_H_