mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +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:
@@ -23,82 +23,6 @@ namespace BlackMisc
|
||||
return this->m_string;
|
||||
}
|
||||
|
||||
/*
|
||||
* is a
|
||||
*/
|
||||
bool CPqString::isA(int metaTypeId) const
|
||||
{
|
||||
if (metaTypeId == qMetaTypeId<CPqString>()) { return true; }
|
||||
return this->CValueObject::isA(metaTypeId);
|
||||
}
|
||||
|
||||
/*
|
||||
* Meta id
|
||||
*/
|
||||
int CPqString::getMetaTypeId() const
|
||||
{
|
||||
return qMetaTypeId<CPqString>();
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare
|
||||
*/
|
||||
int CPqString::compareImpl(const CValueObject &otherBase) const
|
||||
{
|
||||
const auto &other = static_cast<const CPqString &>(otherBase);
|
||||
return compare(TupleConverter<CPqString>::toTuple(*this), TupleConverter<CPqString>::toTuple(other));
|
||||
}
|
||||
|
||||
/*
|
||||
* Marshall to DBus
|
||||
*/
|
||||
void CPqString::marshallToDbus(QDBusArgument &argument) const
|
||||
{
|
||||
argument << TupleConverter<CPqString>::toTuple(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unmarshall from DBus
|
||||
*/
|
||||
void CPqString::unmarshallFromDbus(const QDBusArgument &argument)
|
||||
{
|
||||
argument >> TupleConverter<CPqString>::toTuple(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
* Equal?
|
||||
*/
|
||||
bool CPqString::operator ==(const CPqString &other) const
|
||||
{
|
||||
if (this == &other) return true;
|
||||
return TupleConverter<CPqString>::toTuple(*this) == TupleConverter<CPqString>::toTuple(other);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unequal?
|
||||
*/
|
||||
bool CPqString::operator !=(const CPqString &other) const
|
||||
{
|
||||
return !((*this) == other);
|
||||
}
|
||||
|
||||
/*
|
||||
* Hash
|
||||
*/
|
||||
uint CPqString::getValueHash() const
|
||||
{
|
||||
return qHash(TupleConverter<CPqString>::toTuple(*this));
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
void CPqString::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<CPqString>();
|
||||
qDBusRegisterMetaType<CPqString>();
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user