Merge channels from config to device, instead of replace

This commit is contained in:
Alexey Rybalchenko 2017-06-30 10:19:59 +02:00 committed by Mohammad Al-Turany
parent a26925cbf5
commit 6f18cf23da

View File

@ -968,7 +968,13 @@ void FairMQDevice::SetConfig(FairMQProgOptions& config)
{
fExternalConfig = true;
fConfig = &config;
fChannels = config.GetFairMQMap();
for (auto& c : config.GetFairMQMap())
{
if (!fChannels.insert(c).second)
{
LOG(WARN) << "FairMQDevice::SetConfig: did not insert channel '" << c.first << "', it is already in the device.";
}
}
fDefaultTransport = config.GetValue<string>("transport");
SetTransport(fDefaultTransport);
fId = config.GetValue<string>("id");