mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
refs #345 Third and final wave of value classes using the CValueObjectStdTuple CRTP class template, with policy classes.
This commit is contained in:
@@ -30,34 +30,6 @@ namespace BlackMisc
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
* metaTypeId
|
||||
*/
|
||||
template <class ImplVector> int CVector3DBase<ImplVector>::getMetaTypeId() const
|
||||
{
|
||||
return qMetaTypeId<ImplVector>();
|
||||
}
|
||||
|
||||
/*
|
||||
* is a
|
||||
*/
|
||||
template <class ImplVector> bool CVector3DBase<ImplVector>::isA(int metaTypeId) const
|
||||
{
|
||||
if (metaTypeId == qMetaTypeId<ImplVector>()) { return true; }
|
||||
|
||||
return this->CValueObject::isA(metaTypeId);
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare
|
||||
*/
|
||||
template <class ImplVector> int CVector3DBase<ImplVector>::compareImpl(const CValueObject &otherBase) const
|
||||
{
|
||||
const auto &other = static_cast<const CVector3DBase &>(otherBase);
|
||||
|
||||
return compare(TupleConverter<CVector3DBase>::toTuple(*this), TupleConverter<CVector3DBase>::toTuple(other));
|
||||
}
|
||||
|
||||
/*
|
||||
* Vector to zero
|
||||
*/
|
||||
@@ -154,22 +126,6 @@ namespace BlackMisc
|
||||
return CMatrix3x1(this->m_i, this->m_j, this->m_k);
|
||||
}
|
||||
|
||||
/*
|
||||
* Stream to DBus
|
||||
*/
|
||||
template <class ImplVector> void CVector3DBase<ImplVector>::marshallToDbus(QDBusArgument &argument) const
|
||||
{
|
||||
argument << TupleConverter<CVector3DBase>::toTuple(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
* Stream from DBus
|
||||
*/
|
||||
template <class ImplVector> void CVector3DBase<ImplVector>::unmarshallFromDbus(const QDBusArgument &argument)
|
||||
{
|
||||
argument >> TupleConverter<CVector3DBase>::toTuple(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
* getValueHash()
|
||||
*/
|
||||
@@ -182,15 +138,6 @@ namespace BlackMisc
|
||||
return BlackMisc::calculateHash(hashs, "CVector3DBase");
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
template <class ImplVector> void CVector3DBase<ImplVector>::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<ImplVector>();
|
||||
qDBusRegisterMetaType<ImplVector>();
|
||||
}
|
||||
|
||||
/*
|
||||
* To JSON
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user