OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_PROVIDER_SPEC_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_PROVIDER_SPEC_H_ |
6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_PROVIDER_SPEC_H_ | 6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_PROVIDER_SPEC_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
| 11 #include <unordered_map> |
11 | 12 |
12 namespace service_manager { | 13 namespace service_manager { |
13 | 14 |
14 using Capability = std::string; | 15 using Capability = std::string; |
15 using CapabilitySet = std::set<std::string>; | 16 using CapabilitySet = std::set<std::string>; |
16 using Interface = std::string; | 17 using Interface = std::string; |
17 using InterfaceSet = std::set<std::string>; | 18 using InterfaceSet = std::set<std::string>; |
18 using Name = std::string; | 19 using Name = std::string; |
19 | 20 |
20 // See comments in | 21 // See comments in |
21 // services/service_manager/public/interfaces/interface_provider_spec.mojom for | 22 // services/service_manager/public/interfaces/interface_provider_spec.mojom for |
22 // a description of InterfaceProviderSpec. | 23 // a description of InterfaceProviderSpec. |
23 struct InterfaceProviderSpec { | 24 struct InterfaceProviderSpec { |
24 InterfaceProviderSpec(); | 25 InterfaceProviderSpec(); |
25 InterfaceProviderSpec(const InterfaceProviderSpec& other); | 26 InterfaceProviderSpec(const InterfaceProviderSpec& other); |
26 ~InterfaceProviderSpec(); | 27 ~InterfaceProviderSpec(); |
27 bool operator==(const InterfaceProviderSpec& other) const; | 28 bool operator==(const InterfaceProviderSpec& other) const; |
28 bool operator<(const InterfaceProviderSpec& other) const; | 29 bool operator<(const InterfaceProviderSpec& other) const; |
29 std::map<Capability, InterfaceSet> provides; | 30 std::map<Capability, InterfaceSet> provides; |
30 std::map<Name, CapabilitySet> requires; | 31 std::map<Name, CapabilitySet> requires; |
31 }; | 32 }; |
32 | 33 |
| 34 // Map of spec name -> spec. |
| 35 using InterfaceProviderSpecMap = |
| 36 std::unordered_map<std::string, InterfaceProviderSpec>; |
| 37 |
33 } // namespace service_manager | 38 } // namespace service_manager |
34 | 39 |
35 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_PROVIDER_SPEC_H_ | 40 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_PROVIDER_SPEC_H_ |
OLD | NEW |