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

@@ -161,89 +161,6 @@ namespace BlackMisc
(void)QT_TRANSLATE_NOOP("Network", "voiceroom");
}
/*
* Register metadata
*/
void CAtcStation::registerMetadata()
{
qRegisterMetaType<CAtcStation>();
qDBusRegisterMetaType<CAtcStation>();
}
/*
* Members
*/
const QStringList &CAtcStation::jsonMembers()
{
return TupleConverter<CAtcStation>::jsonMembers();
}
/*
* To JSON
*/
QJsonObject CAtcStation::toJson() const
{
return BlackMisc::serializeJson(CAtcStation::jsonMembers(), TupleConverter<CAtcStation>::toTuple(*this));
}
/*
* From Json
*/
void CAtcStation::convertFromJson(const QJsonObject &json)
{
BlackMisc::deserializeJson(json, CAtcStation::jsonMembers(), TupleConverter<CAtcStation>::toTuple(*this));
}
/*
* Compare
*/
int CAtcStation::compareImpl(const CValueObject &otherBase) const
{
const auto &other = static_cast<const CAtcStation &>(otherBase);
return compare(TupleConverter<CAtcStation>::toTuple(*this), TupleConverter<CAtcStation>::toTuple(other));
}
/*
* Marshall to DBus
*/
void CAtcStation::marshallToDbus(QDBusArgument &argument) const
{
argument << TupleConverter<CAtcStation>::toTuple(*this);
}
/*
* Unmarshall from DBus
*/
void CAtcStation::unmarshallFromDbus(const QDBusArgument &argument)
{
argument >> TupleConverter<CAtcStation>::toTuple(*this);
}
/*
* Equal?
*/
bool CAtcStation::operator ==(const CAtcStation &other) const
{
if (this == &other) return true;
return TupleConverter<CAtcStation>::toTuple(*this) == TupleConverter<CAtcStation>::toTuple(other);
}
/*
* Hash
*/
uint CAtcStation::getValueHash() const
{
return qHash(TupleConverter<CAtcStation>::toTuple(*this));
}
/*
* Unequal?
*/
bool CAtcStation::operator !=(const CAtcStation &other) const
{
return !((*this) == other);
}
/*
* Frequency
*/
@@ -407,22 +324,5 @@ namespace BlackMisc
}
}
/*
* metaTypeId
*/
int CAtcStation::getMetaTypeId() const
{
return qMetaTypeId<CAtcStation>();
}
/*
* is a
*/
bool CAtcStation::isA(int metaTypeId) const
{
if (metaTypeId == qMetaTypeId<CAtcStation>()) { return true; }
return this->CValueObject::isA(metaTypeId);
}
} // namespace
} // namespace