mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
refs #345 First wave of value classes using the CValueObjectStdTuple CRTP class template.
This commit is contained in:
@@ -25,7 +25,7 @@ namespace BlackMisc
|
||||
* Value object encapsulating information message.
|
||||
* ATIS, METAR, TAF
|
||||
*/
|
||||
class CInformationMessage : public BlackMisc::CValueObject
|
||||
class CInformationMessage : public CValueObjectStdTuple<CInformationMessage>
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
@@ -53,18 +53,6 @@ namespace BlackMisc
|
||||
: m_type(type), m_message(message)
|
||||
{}
|
||||
|
||||
//! \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); }
|
||||
|
||||
//! Equal operator ==
|
||||
bool operator ==(const CInformationMessage &other) const;
|
||||
|
||||
//! operator !=
|
||||
bool operator !=(const CInformationMessage &other) const;
|
||||
|
||||
//! Get message.
|
||||
const QString &getMessage() const { return m_message; }
|
||||
|
||||
@@ -106,40 +94,10 @@ namespace BlackMisc
|
||||
//! Is empty?
|
||||
bool isEmpty() const { return this->m_message.isEmpty(); }
|
||||
|
||||
//! \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;
|
||||
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
//! JSON member names
|
||||
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::unmarshallFromDbus
|
||||
virtual void unmarshallFromDbus(const QDBusArgument &argument) override;
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CInformationMessage)
|
||||
InformationType m_type;
|
||||
|
||||
Reference in New Issue
Block a user