Files
pilotclient/src/blackmisc/coordinatened.cpp
Klaus Basan 34320ad3e1 refs #140, changed CValueObject classes to tupel concept
Remarks: Changes looking like an added file result from the shift of namespace voice -> audio
2014-03-10 14:48:56 +01:00

57 lines
1.7 KiB
C++

#include "blackmisc/coordinatened.h"
using namespace BlackMisc::Math;
namespace BlackMisc
{
namespace Geo
{
bool CCoordinateNed::operator ==(const CCoordinateNed &other) const
{
if (this == &other) return true;
if (!CVector3DBase::operator ==(other)) return false;
return TupleConverter<CCoordinateNed>::toTuple(*this) == TupleConverter<CCoordinateNed>::toTuple(other);
}
/*
* Marshall
*/
void CCoordinateNed::marshallToDbus(QDBusArgument &argument) const
{
CVector3DBase::marshallToDbus(argument);
argument << TupleConverter<CCoordinateNed>::toTuple(*this);
}
/*
* Unmarshall
*/
void CCoordinateNed::unmarshallFromDbus(const QDBusArgument &argument)
{
CVector3DBase::unmarshallFromDbus(argument);
argument >> TupleConverter<CCoordinateNed>::toTuple(*this);
}
/*
* Hash
*/
uint CCoordinateNed::getValueHash() const
{
QList<uint> hashs;
hashs << CVector3DBase::getValueHash();
hashs << qHash(TupleConverter<CCoordinateNed>::toTuple(*this));
return BlackMisc::calculateHash(hashs, "CCoordinateNed");
}
/*
* Compare
*/
int CCoordinateNed::compareImpl(const CValueObject &otherBase) const
{
const auto &other = static_cast<const CCoordinateNed &>(otherBase);
int result = compare(TupleConverter<CCoordinateNed>::toTuple(*this), TupleConverter<CCoordinateNed>::toTuple(other));
return result == 0 ? CVector3DBase::compareImpl(otherBase) : result;
}
}
}