mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
refs #345 First wave of value classes using the CValueObjectStdTuple CRTP class template.
This commit is contained in:
@@ -137,104 +137,5 @@ namespace BlackMisc
|
||||
return CSelcal::allCodePairs;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare
|
||||
*/
|
||||
int CSelcal::compareImpl(const CValueObject &otherBase) const
|
||||
{
|
||||
const auto &other = static_cast<const CSelcal &>(otherBase);
|
||||
return compare(TupleConverter<CSelcal>::toTuple(*this), TupleConverter<CSelcal>::toTuple(other));
|
||||
}
|
||||
|
||||
/*
|
||||
* Marshall to DBus
|
||||
*/
|
||||
void CSelcal::marshallToDbus(QDBusArgument &argument) const
|
||||
{
|
||||
argument << TupleConverter<CSelcal>::toTuple(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unmarshall from DBus
|
||||
*/
|
||||
void CSelcal::unmarshallFromDbus(const QDBusArgument &argument)
|
||||
{
|
||||
argument >> TupleConverter<CSelcal>::toTuple(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
* Hash
|
||||
*/
|
||||
uint CSelcal::getValueHash() const
|
||||
{
|
||||
return qHash(TupleConverter<CSelcal>::toTuple(*this));
|
||||
}
|
||||
|
||||
/*
|
||||
* Equal?
|
||||
*/
|
||||
bool CSelcal::operator ==(const CSelcal &other) const
|
||||
{
|
||||
if (this == &other) return true;
|
||||
return TupleConverter<CSelcal>::toTuple(*this) == TupleConverter<CSelcal>::toTuple(other);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unequal?
|
||||
*/
|
||||
bool CSelcal::operator !=(const CSelcal &other) const
|
||||
{
|
||||
return !((*this) == other);
|
||||
}
|
||||
|
||||
/*
|
||||
* metaTypeId
|
||||
*/
|
||||
int CSelcal::getMetaTypeId() const
|
||||
{
|
||||
return qMetaTypeId<CSelcal>();
|
||||
}
|
||||
|
||||
/*
|
||||
* is a
|
||||
*/
|
||||
bool CSelcal::isA(int metaTypeId) const
|
||||
{
|
||||
if (metaTypeId == qMetaTypeId<CSelcal>()) { return true; }
|
||||
return this->CValueObject::isA(metaTypeId);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
void CSelcal::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<CSelcal>();
|
||||
qDBusRegisterMetaType<CSelcal>();
|
||||
}
|
||||
|
||||
/*
|
||||
* Members
|
||||
*/
|
||||
const QStringList &CSelcal::jsonMembers()
|
||||
{
|
||||
return TupleConverter<CSelcal>::jsonMembers();
|
||||
}
|
||||
|
||||
/*
|
||||
* To JSON
|
||||
*/
|
||||
QJsonObject CSelcal::toJson() const
|
||||
{
|
||||
return BlackMisc::serializeJson(CSelcal::jsonMembers(), TupleConverter<CSelcal>::toTuple(*this));
|
||||
}
|
||||
|
||||
/*
|
||||
* From Json
|
||||
*/
|
||||
void CSelcal::convertFromJson(const QJsonObject &json)
|
||||
{
|
||||
BlackMisc::deserializeJson(json, CSelcal::jsonMembers(), TupleConverter<CSelcal>::toTuple(*this));
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user