mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
refs #345 First wave of value classes using the CValueObjectStdTuple CRTP class template.
This commit is contained in:
@@ -36,97 +36,6 @@ namespace BlackMisc
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
* metaTypeId
|
||||
*/
|
||||
int CSettingsAudio::getMetaTypeId() const
|
||||
{
|
||||
return qMetaTypeId<CSettingsAudio>();
|
||||
}
|
||||
|
||||
/*
|
||||
* is a
|
||||
*/
|
||||
bool CSettingsAudio::isA(int metaTypeId) const
|
||||
{
|
||||
if (metaTypeId == qMetaTypeId<CSettingsAudio>()) { return true; }
|
||||
return this->CValueObject::isA(metaTypeId);
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare
|
||||
*/
|
||||
int CSettingsAudio::compareImpl(const CValueObject &otherBase) const
|
||||
{
|
||||
const auto &other = static_cast<const CSettingsAudio &>(otherBase);
|
||||
return compare(TupleConverter<CSettingsAudio>::toTuple(*this), TupleConverter<CSettingsAudio>::toTuple(other));
|
||||
}
|
||||
|
||||
/*
|
||||
* Marshall
|
||||
*/
|
||||
void CSettingsAudio::marshallToDbus(QDBusArgument &argument) const
|
||||
{
|
||||
argument << TupleConverter<CSettingsAudio>::toTuple(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unmarshall
|
||||
*/
|
||||
void CSettingsAudio::unmarshallFromDbus(const QDBusArgument &argument)
|
||||
{
|
||||
argument >> TupleConverter<CSettingsAudio>::toTuple(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
* Equal?
|
||||
*/
|
||||
bool CSettingsAudio::operator ==(const CSettingsAudio &other) const
|
||||
{
|
||||
if (this == &other) return true;
|
||||
return compare(*this, other) == 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unequal?
|
||||
*/
|
||||
bool CSettingsAudio::operator !=(const CSettingsAudio &other) const
|
||||
{
|
||||
return !((*this) == other);
|
||||
}
|
||||
|
||||
/*
|
||||
* Hash
|
||||
*/
|
||||
uint CSettingsAudio::getValueHash() const
|
||||
{
|
||||
return qHash(TupleConverter<CSettingsAudio>::toTuple(*this));
|
||||
}
|
||||
|
||||
/*
|
||||
* To JSON
|
||||
*/
|
||||
QJsonObject CSettingsAudio::toJson() const
|
||||
{
|
||||
return BlackMisc::serializeJson(CSettingsAudio::jsonMembers(), TupleConverter<CSettingsAudio>::toTuple(*this));
|
||||
}
|
||||
|
||||
/*
|
||||
* From JSON
|
||||
*/
|
||||
void CSettingsAudio::convertFromJson(const QJsonObject &json)
|
||||
{
|
||||
BlackMisc::deserializeJson(json, CSettingsAudio::jsonMembers(), TupleConverter<CSettingsAudio>::toTuple(*this));
|
||||
}
|
||||
|
||||
/*
|
||||
* Members
|
||||
*/
|
||||
const QStringList &CSettingsAudio::jsonMembers()
|
||||
{
|
||||
return TupleConverter<CSettingsAudio>::jsonMembers();
|
||||
}
|
||||
|
||||
/*
|
||||
* Default values
|
||||
*/
|
||||
@@ -149,15 +58,6 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
void CSettingsAudio::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<CSettingsAudio>();
|
||||
qDBusRegisterMetaType<CSettingsAudio>();
|
||||
}
|
||||
|
||||
/*
|
||||
* Value
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user