refs #345 Third and final wave of value classes using the CValueObjectStdTuple CRTP class template, with policy classes.

This commit is contained in:
Mathew Sutcliffe
2014-11-08 00:17:13 +00:00
parent 2b9d4098d4
commit f219d290f1
48 changed files with 326 additions and 1389 deletions

View File

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