mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
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:
56
src/blackmisc/coordinatened.cpp
Normal file
56
src/blackmisc/coordinatened.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user