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

@@ -7,6 +7,7 @@
#include "blackmisc/aviocomsystem.h"
#include "blackmisc/avionavsystem.h"
#include "blackmisc/avioadfsystem.h"
#include "blackmisc/blackmiscfreefunctions.h"
using BlackMisc::PhysicalQuantities::CFrequency;
using BlackMisc::PhysicalQuantities::CFrequencyUnit;
@@ -76,6 +77,18 @@ namespace BlackMisc
argument >> this->m_digits;
}
/*
* Value hash
*/
template <class AVIO> uint CModulator<AVIO>::getValueHash() const
{
QList<uint> hashs;
hashs << this->m_frequencyActive.getValueHash();
hashs << this->m_frequencyStandby.getValueHash();
hashs << qHash(this->m_digits);
return BlackMisc::calculateHash(hashs, "CModulator");
}
// see here for the reason of thess forward instantiations
// http://www.parashift.com/c++-faq/separate-template-class-defn-from-decl.html
template class CModulator<CComSystem>;