mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
using hashes to perform comparisons between blackmisc value objects stored inside of QVariant
refs #81
This commit is contained in:
committed by
Mathew Sutcliffe
parent
67a5dbfe48
commit
a280d239e6
@@ -138,6 +138,23 @@ namespace BlackMisc
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hash
|
||||
*/
|
||||
template <class ImplMatrix, int Rows, int Columns> uint CMatrixBase<ImplMatrix, Rows, Columns>::getValueHash() const
|
||||
{
|
||||
const QList<double> l = this->toList();
|
||||
QList<uint> hashs;
|
||||
|
||||
// there is an issue with the signature of QList, so I use
|
||||
// individual values
|
||||
foreach(double v, l)
|
||||
{
|
||||
hashs << qHash(static_cast<long>(v));
|
||||
}
|
||||
return BlackMisc::calculateHash(hashs, "CMatrixBase");
|
||||
}
|
||||
|
||||
/*
|
||||
* To DBus
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user