Mind: Implement initialize/finalizeBodyReq()

We've done a lot of general work on the init sequencing.
This commit is contained in:
2025-09-12 16:09:26 -04:00
parent b99b147959
commit 25a9721f92
10 changed files with 294 additions and 163 deletions
+11 -3
View File
@@ -37,6 +37,14 @@ struct DeviceAttachmentContinuation {
> cb)
: spec(s), callback(cb)
{}
void callOriginalCallback(
bool success,
std::shared_ptr<Device> device,
std::shared_ptr<DeviceAttachmentSpec> deviceSpec)
{
callback(success, device, deviceSpec);
}
};
const std::string DeviceManager::stringifyDeviceSpecs(void)
@@ -71,7 +79,7 @@ void DeviceManager::newDeviceAttachmentSpecInd(
{
if (!(*existingSpec == *spec)) { continue; }
// Already exists, callback with error
callback(false, nullptr, nullptr);
continuation->callOriginalCallback(false, nullptr, nullptr);
return;
}
@@ -104,10 +112,10 @@ void DeviceManager::newDeviceAttachmentSpecInd(
deviceAttachmentSpecs.push_back(spec);
// Callback with success
callback(true, device, spec);
continuation->callOriginalCallback(true, device, spec);
} catch (const std::exception& e) {
// Attach failed, callback with error
callback(false, nullptr, nullptr);
continuation->callOriginalCallback(false, nullptr, nullptr);
}
}
#endif