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

Method removeGpsDevice

Tactility/Source/service/gps/GpsService.cpp:47–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void GpsService::removeGpsDevice(const std::shared_ptr<GpsDevice>& device) {
48 auto lock = mutex.asScopedLock();
49 lock.lock();
50
51 GpsDeviceRecord* record = findGpsRecord(device);
52
53 if (getState() == State::On) { // Ignore during OnPending due to risk of data corruption
54 stopGpsDevice(*record);
55 }
56
57 std::erase_if(deviceRecords, [&device](auto& reference) {
58 return reference.device.get() == device.get();
59 });
60}
61
62bool GpsService::onStart(ServiceContext& serviceContext) {
63 auto lock = mutex.asScopedLock();

Callers

nothing calls this directly

Calls 4

getStateFunction · 0.85
asScopedLockMethod · 0.80
lockMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected