Mind: Implement initialize/finalizeBodyReq()
We've done a lot of general work on the init sequencing.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user