MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / getDevices

Function getDevices

Modules/hal-device-module/source/hal/Device.cpp:123–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123std::vector<std::shared_ptr<Device>> getDevices() {
124 std::vector<std::shared_ptr<Device>> devices;
125 device_for_each_of_type(&HAL_DEVICE_TYPE, &devices ,[](auto* kernelDevice, auto* context) {
126 auto devices_ptr = static_cast<std::vector<std::shared_ptr<Device>>*>(context);
127 auto hal_device = hal_device_get_device(kernelDevice);
128 (*devices_ptr).push_back(hal_device);
129 return true;
130 });
131 return devices;
132}
133
134bool hasDevice(Device::Type type) {
135 auto scoped_mutex = mutex.asScopedLock();

Callers 4

addDevicesFunction · 0.85
findDevicesFunction · 0.85
findDeviceFunction · 0.85
hasDeviceFunction · 0.85

Calls 2

device_for_each_of_typeFunction · 0.85
hal_device_get_deviceFunction · 0.85

Tested by

no test coverage detected