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

@@ -12,25 +12,6 @@ namespace BlackMisc
return this->m_callsign;
}
/*
* Marshall to DBus
*/
void CCallsign::marshallToDbus(QDBusArgument &argument) const
{
argument << this->m_callsignAsSet;
argument << this->m_telephonyDesignator;
}
/*
* Unmarshall from DBus
*/
void CCallsign::unmarshallFromDbus(const QDBusArgument &argument)
{
argument >> this->m_callsignAsSet;
argument >> this->m_telephonyDesignator;
this->m_callsign = CCallsign::unifyCallsign(this->m_callsignAsSet);
}
/*
* Unify the callsign
*/
@@ -96,13 +77,40 @@ namespace BlackMisc
return false;
}
/*
* Compare
*/
int CCallsign::compareImpl(const CValueObject &otherBase) const
{
const auto &other = static_cast<const CCallsign &>(otherBase);
return compare(TupleConverter<CCallsign>::toTuple(*this), TupleConverter<CCallsign>::toTuple(other));
}
/*
* Marshall to DBus
*/
void CCallsign::marshallToDbus(QDBusArgument &argument) const
{
argument << TupleConverter<CCallsign>::toTuple(*this);
}
/*
* Unmarshall from DBus
*/
void CCallsign::unmarshallFromDbus(const QDBusArgument &argument)
{
argument >> TupleConverter<CCallsign>::toTuple(*this);
}
/*
* Equal?
*/
bool CCallsign::operator ==(const CCallsign &other) const
{
if (this == &other) return true;
return other.asString() == this->asString();
// intentionally not via Tupel converter, compare on string only
return this->asString().compare(other.asString(), Qt::CaseInsensitive) == 0;
}
/*
@@ -113,6 +121,14 @@ namespace BlackMisc
return !((*this) == other);
}
/*
* Hash
*/
uint CCallsign::getValueHash() const
{
return qHash(TupleConverter<CCallsign>::toTuple(*this));
}
/*
* Less than?
*/
@@ -121,14 +137,6 @@ namespace BlackMisc
return this->m_callsign < other.m_callsign;
}
/*
* Hash
*/
uint CCallsign::getValueHash() const
{
return qHash(this->m_callsign);
}
/*
* metaTypeId
*/
@@ -147,16 +155,6 @@ namespace BlackMisc
return this->CValueObject::isA(metaTypeId);
}
/*
* Compare
*/
int CCallsign::compareImpl(const CValueObject &otherBase) const
{
const auto &other = static_cast<const CCallsign &>(otherBase);
return this->m_callsign.compare(other.asString(), Qt::CaseInsensitive);
}
/*
* Register metadata
*/