mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +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 of a text message
|
||||
*/
|
||||
class CTextMessage : public BlackMisc::CValueObject
|
||||
class CTextMessage : public CValueObjectStdTuple<CTextMessage>
|
||||
{
|
||||
public:
|
||||
//! \brief Default constructor.
|
||||
@@ -158,43 +158,10 @@ namespace BlackMisc
|
||||
//! \brief Get SELCAL code (if applicable, e.g. ABCD), otherwise ""
|
||||
QString getSelcalCode() const;
|
||||
|
||||
//! \brief Equal operator ==
|
||||
bool operator ==(const CTextMessage &other) const;
|
||||
|
||||
//! \brief Unequal operator !=
|
||||
bool operator !=(const CTextMessage &other) const;
|
||||
|
||||
//! \copydoc CValueObject::getValueHash()
|
||||
virtual uint getValueHash() const override;
|
||||
|
||||
//! \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); }
|
||||
|
||||
//! \brief Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
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::unmarshallFomDbus
|
||||
virtual void unmarshallFromDbus(const QDBusArgument &argument) override;
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CTextMessage)
|
||||
QString m_message;
|
||||
|
||||
Reference in New Issue
Block a user