using hashes to perform comparisons between blackmisc value objects stored inside of QVariant

refs #81
This commit is contained in:
Klaus Basan
2013-12-22 20:40:30 +00:00
committed by Mathew Sutcliffe
parent 67a5dbfe48
commit a280d239e6
22 changed files with 416 additions and 0 deletions

View File

@@ -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
*/