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

@@ -26,7 +26,7 @@ namespace BlackMisc
/*!
* Value object for a flight plan
*/
class CFlightPlan : public BlackMisc::CValueObject
class CFlightPlan : public CValueObjectStdTuple<CFlightPlan>
{
public:
/*!
@@ -181,55 +181,13 @@ namespace BlackMisc
//! Get remarks string
const QString &getRemarks() const { return m_remarks; }
//! Equals operator
bool operator ==(const CFlightPlan &other) const;
//! Not equals operator
bool operator !=(const CFlightPlan &other) const;
//! \copydoc CValueObject::toQVariant
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
//! \copydoc CValueObject::convertFromQVariant
virtual void convertFromQVariant(const QVariant &variant) override { BlackMisc::setFromQVariant(this, variant); }
//! \copydoc CValueObject::getValueHash
virtual uint getValueHash() const override;
//! \copydoc CValueObject::toJson
virtual QJsonObject toJson() const override;
//! \copydoc CValueObject::convertFromJson
virtual void convertFromJson(const QJsonObject &json) override;
//! \copydoc CValueObject::toIcon
virtual CIcon toIcon() const override;
//! Register metadata
static void registerMetadata();
//! Members
static const QStringList &jsonMembers();
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;
//! \copydoc CValueObject::getMetaTypeId
virtual int getMetaTypeId() const override;
//! \copydoc CValueObject::isA
virtual bool isA(int metaTypeId) const override;
//! \copydoc CValueObject::compareImpl
virtual int compareImpl(const CValueObject &other) const override;
//! \copydoc CValueObject::marshallToDbus()
virtual void marshallToDbus(QDBusArgument &argument) const override;
//! \copydoc CValueObject::marshallFromDbus()
virtual void unmarshallFromDbus(const QDBusArgument &argument) override;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CFlightPlan)
QString m_equipmentIcao;