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

@@ -34,39 +34,6 @@ namespace BlackMisc
return s;
}
/*
* Compare
*/
int CAircraftMapping::compareImpl(const CValueObject &otherBase) const
{
const auto &other = static_cast<const CAircraftMapping &>(otherBase);
return compare(TupleConverter<CAircraftMapping>::toTuple(*this), TupleConverter<CAircraftMapping>::toTuple(other));
}
/*
* Marshall to DBus
*/
void CAircraftMapping::marshallToDbus(QDBusArgument &argument) const
{
argument << TupleConverter<CAircraftMapping>::toTuple(*this);
}
/*
* Unmarshall from DBus
*/
void CAircraftMapping::unmarshallFromDbus(const QDBusArgument &argument)
{
argument >> TupleConverter<CAircraftMapping>::toTuple(*this);
}
/*
* Hash
*/
uint CAircraftMapping::getValueHash() const
{
return qHash(TupleConverter<CAircraftMapping>::toTuple(*this));
}
/*
* Model string?
*/
@@ -75,73 +42,6 @@ namespace BlackMisc
return this->m_model.matchesModelString(modelString, sensitivity);
}
/*
* Equal?
*/
bool CAircraftMapping::operator ==(const CAircraftMapping &other) const
{
if (this == &other) return true;
return TupleConverter<CAircraftMapping>::toTuple(*this) == TupleConverter<CAircraftMapping>::toTuple(other);
}
/*
* Unequal?
*/
bool CAircraftMapping::operator !=(const CAircraftMapping &other) const
{
return !((*this) == other);
}
/*
* metaTypeId
*/
int CAircraftMapping::getMetaTypeId() const
{
return qMetaTypeId<CAircraftMapping>();
}
/*
* is a
*/
bool CAircraftMapping::isA(int metaTypeId) const
{
if (metaTypeId == qMetaTypeId<CAircraftMapping>()) { return true; }
return this->CValueObject::isA(metaTypeId);
}
/*
* Register metadata
*/
void CAircraftMapping::registerMetadata()
{
qRegisterMetaType<CAircraftMapping>();
qDBusRegisterMetaType<CAircraftMapping>();
}
/*
* Members
*/
const QStringList &CAircraftMapping::jsonMembers()
{
return TupleConverter<CAircraftMapping>::jsonMembers();
}
/*
* To JSON
*/
QJsonObject CAircraftMapping::toJson() const
{
return BlackMisc::serializeJson(CAircraftMapping::jsonMembers(), TupleConverter<CAircraftMapping>::toTuple(*this));
}
/*
* From Json
*/
void CAircraftMapping::convertFromJson(const QJsonObject &json)
{
BlackMisc::deserializeJson(json, CAircraftMapping::jsonMembers(), TupleConverter<CAircraftMapping>::toTuple(*this));
}
/*
* Property by index
*/