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

@@ -27,73 +27,6 @@ namespace BlackMisc
this->setVoiceRoomUrl(voiceRoomUrl);
}
/*
* Compare
*/
int CVoiceRoom::compareImpl(const CValueObject &otherBase) const
{
const auto &other = static_cast<const CVoiceRoom &>(otherBase);
return compare(TupleConverter<CVoiceRoom>::toTuple(*this), TupleConverter<CVoiceRoom>::toTuple(other));
}
/*
* Marshall to DBus
*/
void CVoiceRoom::marshallToDbus(QDBusArgument &argument) const
{
argument << TupleConverter<CVoiceRoom>::toTuple(*this);
}
/*
* Unmarshall from DBus
*/
void CVoiceRoom::unmarshallFromDbus(const QDBusArgument &argument)
{
argument >> TupleConverter<CVoiceRoom>::toTuple(*this);
}
/*
* Hash
*/
uint CVoiceRoom::getValueHash() const
{
return qHash(TupleConverter<CVoiceRoom>::toTuple(*this));
}
/*
* Equal?
*/
bool CVoiceRoom::operator ==(const CVoiceRoom &other) const
{
if (this == &other) return true;
return TupleConverter<CVoiceRoom>::toTuple(*this) == TupleConverter<CVoiceRoom>::toTuple(other);
}
/*
* Unequal?
*/
bool CVoiceRoom::operator !=(const CVoiceRoom &other) const
{
return !((*this) == other);
}
/*
* Metadata
*/
void CVoiceRoom::registerMetadata()
{
qRegisterMetaType<CVoiceRoom>();
qDBusRegisterMetaType<CVoiceRoom>();
}
/*
* To JSON
*/
QJsonObject CVoiceRoom::toJson() const
{
return BlackMisc::serializeJson(CVoiceRoom::jsonMembers(), TupleConverter<CVoiceRoom>::toTuple(*this));
}
/*
* Property by index
*/
@@ -153,22 +86,6 @@ namespace BlackMisc
}
}
/*
* To JSON
*/
void CVoiceRoom::convertFromJson(const QJsonObject &json)
{
BlackMisc::deserializeJson(json, CVoiceRoom::jsonMembers(), TupleConverter<CVoiceRoom>::toTuple(*this));
}
/*
* Members
*/
const QStringList &CVoiceRoom::jsonMembers()
{
return TupleConverter<CVoiceRoom>::jsonMembers();
}
/*
* To string
*/
@@ -181,24 +98,6 @@ namespace BlackMisc
return s;
}
/*
* metaTypeId
*/
int CVoiceRoom::getMetaTypeId() const
{
return qMetaTypeId<CVoiceRoom>();
}
/*
* is a
*/
bool CVoiceRoom::isA(int metaTypeId) const
{
if (metaTypeId == qMetaTypeId<CVoiceRoom>()) { return true; }
return CValueObject::isA(metaTypeId);
}
/*
* Server URL
*/