MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / FindDevice

Method FindDevice

src/device/device_manager.cpp:49–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49auto DeviceManager::FindDevice(const char* name) -> Expected<DeviceNode*> {
50 assert(name != nullptr && "FindDevice: name must not be null");
51 LockGuard guard(lock_);
52 const auto it = name_index_.find(name);
53 if (it != name_index_.end()) {
54 return &devices_[it->second];
55 }
56 return std::unexpected(Error(ErrorCode::kDeviceNotFound));
57}
58
59auto DeviceManager::FindDevicesByType(DeviceType type, DeviceNode** out,
60 size_t max) -> size_t {

Callers

nothing calls this directly

Calls 1

ErrorClass · 0.85

Tested by

no test coverage detected