| 39 | } |
| 40 | |
| 41 | void DeviceSet::FindMatchingDevices(const DeviceNameUtils::ParsedName& spec, |
| 42 | std::vector<Device*>* devices) const { |
| 43 | // TODO(jeff): If we are going to repeatedly lookup the set of devices |
| 44 | // for the same spec, maybe we should have a cache of some sort |
| 45 | devices->clear(); |
| 46 | for (Device* d : devices_) { |
| 47 | if (DeviceNameUtils::IsCompleteSpecification(spec, d->parsed_name())) { |
| 48 | devices->push_back(d); |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | Device* DeviceSet::FindDeviceByName(const string& name) const { |
| 54 | return gtl::FindPtrOrNull(device_by_name_, name); |
no test coverage detected