Add in simulator info returns delta

This commit is contained in:
Klaus Basan
2018-11-27 02:29:14 +01:00
parent 2ad293fbad
commit 9c46cab133
2 changed files with 8 additions and 3 deletions

View File

@@ -181,10 +181,15 @@ namespace BlackMisc
return CValueObject::toIcon();
}
void CSimulatorInfo::add(const CSimulatorInfo &other)
CSimulatorInfo CSimulatorInfo::add(const CSimulatorInfo &other)
{
if (other.isUnspecified()) { return; }
// anything to add?
if (other.isUnspecified()) { return None; }
if (this->matchesAll(other)) { return None; }
this->setSimulator(this->getSimulator() | other.getSimulator());
const CSimulatorInfo delta(this->getSimulator() & other.getSimulator());
return delta;
}
QSet<CSimulatorInfo> CSimulatorInfo::asSingleSimulatorSet() const