refs #140, changed CValueObject classes to tupel concept

Remarks: Changes looking like an added file result from the shift of namespace voice -> audio
This commit is contained in:
Klaus Basan
2014-03-10 14:48:56 +01:00
parent 8f6a22e833
commit 34320ad3e1
43 changed files with 1293 additions and 768 deletions

View File

@@ -51,10 +51,61 @@ namespace BlackMisc
CFrequency f(frequencyMHz, CFrequencyUnit::MHz());
if (f == this->getFrequencyStandby()) return; // save all the comparisons / rounding
CComSystem::roundToChannelSpacing(f, this->m_channelSpacing);
this->CModulator::setFrequencyStandby(f);
CModulator::setFrequencyStandby(f);
this->validate(true);
}
/*
* Marshall
*/
void CComSystem::marshallToDbus(QDBusArgument &argument) const
{
CModulator::marshallToDbus(argument);
argument << TupleConverter<CComSystem>::toTuple(*this);
}
/*
* Unmarshall
*/
void CComSystem::unmarshallFromDbus(const QDBusArgument &argument)
{
CModulator::unmarshallFromDbus(argument);
argument >> TupleConverter<CComSystem>::toTuple(*this);
}
/*
* Hash
*/
uint CComSystem::getValueHash() const
{
QList<uint> hashs;
hashs << CModulator::getValueHash();
hashs << qHash(TupleConverter<CComSystem>::toTuple(*this));
return BlackMisc::calculateHash(hashs, "CComSystem");
}
/*
* Compare
*/
int CComSystem::compareImpl(const CValueObject &otherBase) const
{
const auto &other = static_cast<const CComSystem &>(otherBase);
int result = compare(TupleConverter<CComSystem>::toTuple(*this), TupleConverter<CComSystem>::toTuple(other));
return result == 0 ? CModulator::compareImpl(otherBase) : result;
}
bool CComSystem::operator ==(const CComSystem &other) const
{
if (this == &other) return true;
if (!CModulator::operator ==(other)) return false;
return TupleConverter<CComSystem>::toTuple(*this) == TupleConverter<CComSystem>::toTuple(other);
}
bool CComSystem::operator !=(const CComSystem &other) const
{
return !((*this) == other);
}
/*
* Round to channel spacing
*/
@@ -97,27 +148,5 @@ namespace BlackMisc
default: qFatal("Wrong channel spacing"); return 0.0; // return just supressing compiler warning
}
}
/*
* Marshall
*/
void CComSystem::marshallToDbus(QDBusArgument &argument) const
{
CModulator::marshallToDbus(argument);
argument << static_cast<uint>(this->m_channelSpacing);
}
/*
* Unmarshall
*/
void CComSystem::unmarshallFromDbus(const QDBusArgument &argument)
{
CModulator::unmarshallFromDbus(argument);
uint cs;
argument >> cs;
this->m_channelSpacing = static_cast<ChannelSpacing>(cs);
}
} // namespace
}
} // namespace