refs #345 First wave of value classes using the CValueObjectStdTuple CRTP class template.

This commit is contained in:
Mathew Sutcliffe
2014-10-30 22:08:22 +00:00
parent ecf8e6aafb
commit 4c8148acf1
68 changed files with 34 additions and 4499 deletions

View File

@@ -11,57 +11,9 @@
namespace BlackMisc
{
void CLogCategory::registerMetadata()
{
qRegisterMetaType<CLogCategory>();
qDBusRegisterMetaType<CLogCategory>();
}
uint CLogCategory::getValueHash() const
{
return qHash(TupleConverter<CLogCategory>::toMetaTuple(*this));
}
bool CLogCategory::operator ==(const CLogCategory &other) const
{
return TupleConverter<CLogCategory>::toMetaTuple(*this) == TupleConverter<CLogCategory>::toMetaTuple(other);
}
bool CLogCategory::operator !=(const CLogCategory &other) const
{
return TupleConverter<CLogCategory>::toMetaTuple(*this) != TupleConverter<CLogCategory>::toMetaTuple(other);
}
QString CLogCategory::convertToQString(bool i18n) const
{
Q_UNUSED(i18n);
return m_string;
}
int CLogCategory::getMetaTypeId() const
{
return qMetaTypeId<CLogCategory>();
}
bool CLogCategory::isA(int metaTypeId) const
{
if (metaTypeId == qMetaTypeId<CLogCategory>()) { return true; }
return this->CValueObject::isA(metaTypeId);
}
int CLogCategory::compareImpl(const CValueObject &otherBase) const
{
const auto &other = static_cast<const CLogCategory &>(otherBase);
return compare(TupleConverter<CLogCategory>::toMetaTuple(*this), TupleConverter<CLogCategory>::toMetaTuple(other));
}
void CLogCategory::marshallToDbus(QDBusArgument &argument) const
{
argument << TupleConverter<CLogCategory>::toMetaTuple(*this);
}
void CLogCategory::unmarshallFromDbus(const QDBusArgument &argument)
{
argument >> TupleConverter<CLogCategory>::toMetaTuple(*this);
}
}