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

@@ -16,7 +16,7 @@
namespace BlackSim
{
//! Describing a simulator
class CSimulatorInfo : public BlackMisc::CValueObject
class CSimulatorInfo : public BlackMisc::CValueObjectStdTuple<CSimulatorInfo>
{
public:
//! Default constructor
@@ -28,12 +28,6 @@ namespace BlackSim
//! Unspecified simulator
bool isUnspecified() const { return this->m_shortName.isEmpty() || this->m_shortName.startsWith("Unspecified", Qt::CaseInsensitive); }
//! Equal operator ==
bool operator ==(const CSimulatorInfo &other) const;
//! Unequal operator !=
bool operator !=(const CSimulatorInfo &other) const;
//! Single setting value
QVariant getSimulatorSetupValue(int index) const;
@@ -52,27 +46,6 @@ namespace BlackSim
//! Compare on names only, ignore setup
bool isSameSimulator(const CSimulatorInfo &otherSimulator) 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); }
//! \copydoc CValueObject::toJson
virtual QJsonObject toJson() const override;
//! \copydoc CValueObject::convertFromJson
virtual void convertFromJson(const QJsonObject &json) override;
//! JSON member names
static const QStringList &jsonMembers();
//! Register the metatypes
static void registerMetadata();
//! Simulator is FS9 - Microsoft Flight Simulator 2004
static const CSimulatorInfo &FS9()
{
@@ -105,18 +78,6 @@ namespace BlackSim
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
//! \copydoc CValueObject::getMetaTypeId
virtual int getMetaTypeId() const override;
//! \copydoc CValueObject::compareImpl
virtual int compareImpl(const CValueObject &otherBase) 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(CSimulatorInfo)
QString m_fullName;