DAP.yy: use cmdlineDASpecs; DevMgr: add attachAllUnattachedDevicesFromCmdlineReq
This method wraps around attachAllUnattachedDevicesFromReq and supplies it with a sh_ptr<> collection of all DASpecs parsed by the DAP parser from the cmdline. The initialization sequence now correctly initializes all DAP specs given on the cmdline again.
This commit is contained in:
@@ -87,7 +87,7 @@ interoceptor_spec:
|
||||
*static_cast<smo::device::InteroceptorDevAttachmentSpec *>($3));
|
||||
|
||||
spec->sensorType = $1;
|
||||
smo::device::DeviceManager::deviceAttachmentSpecs.push_back(spec);
|
||||
smo::device::DeviceManager::commandLineDASpecs.push_back(*spec);
|
||||
|
||||
delete $3;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ extrospector_spec:
|
||||
*static_cast<smo::device::ExtrospectorDevAttachmentSpec *>($3));
|
||||
|
||||
spec->sensorType = $1;
|
||||
smo::device::DeviceManager::deviceAttachmentSpecs.push_back(spec);
|
||||
smo::device::DeviceManager::commandLineDASpecs.push_back(*spec);
|
||||
|
||||
delete $3;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ std::vector<std::shared_ptr<Device>>
|
||||
DeviceManager::devices;
|
||||
std::vector<std::shared_ptr<DeviceRole>>
|
||||
DeviceManager::attachedDeviceRoles;
|
||||
std::vector<DeviceAttachmentSpec>
|
||||
DeviceManager::commandLineDASpecs;
|
||||
|
||||
const std::string DeviceManager::stringifyDeviceSpecs(void)
|
||||
{
|
||||
@@ -573,6 +575,15 @@ void DeviceManager::attachAllUnattachedDevicesFromReq(
|
||||
request.get(), request));
|
||||
}
|
||||
|
||||
void DeviceManager::attachAllUnattachedDevicesFromCmdlineReq(
|
||||
Callback<attachAllUnattachedDevicesFromReqCbFn> cb
|
||||
)
|
||||
{
|
||||
auto specs = std::make_shared<std::vector<DeviceAttachmentSpec>>(
|
||||
commandLineDASpecs);
|
||||
attachAllUnattachedDevicesFromReq(specs, std::move(cb));
|
||||
}
|
||||
|
||||
class DeviceManager::DetachAllAttachedDeviceRoles
|
||||
: public PostedAsynchronousContinuation<
|
||||
detachAllAttachedDeviceRolesCbFn>
|
||||
|
||||
Reference in New Issue
Block a user