mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
refs #345 First wave of value classes using the CValueObjectStdTuple CRTP class template.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user