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> |
(...skipping 17 matching lines...) Expand all Loading... |
28 bool operator==(const InterfaceProviderSpec& other) const; | 28 bool operator==(const InterfaceProviderSpec& other) const; |
29 bool operator<(const InterfaceProviderSpec& other) const; | 29 bool operator<(const InterfaceProviderSpec& other) const; |
30 std::map<Capability, InterfaceSet> provides; | 30 std::map<Capability, InterfaceSet> provides; |
31 std::map<Name, CapabilitySet> requires; | 31 std::map<Name, CapabilitySet> requires; |
32 }; | 32 }; |
33 | 33 |
34 // Map of spec name -> spec. | 34 // Map of spec name -> spec. |
35 using InterfaceProviderSpecMap = | 35 using InterfaceProviderSpecMap = |
36 std::unordered_map<std::string, InterfaceProviderSpec>; | 36 std::unordered_map<std::string, InterfaceProviderSpec>; |
37 | 37 |
| 38 // Convenience for reading a spec named |spec_name| out of |map|. If such a spec |
| 39 // is found, |spec| is modified and this function returns true. If a spec is not |
| 40 // found, |spec| is unmodified and this function returns false. |
| 41 bool GetInterfaceProviderSpec(const std::string& spec_name, |
| 42 const InterfaceProviderSpecMap& map, |
| 43 InterfaceProviderSpec* spec); |
| 44 |
38 } // namespace service_manager | 45 } // namespace service_manager |
39 | 46 |
40 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_PROVIDER_SPEC_H_ | 47 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_PROVIDER_SPEC_H_ |
OLD | NEW |