mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
Use nested namespaces (C++17 feature)
This commit is contained in:
@@ -24,90 +24,87 @@
|
||||
#include <QString>
|
||||
#include <tuple>
|
||||
|
||||
namespace BlackMisc
|
||||
namespace BlackMisc::Simulation
|
||||
{
|
||||
namespace Simulation
|
||||
//! Simulator internals for flight simulators.
|
||||
//! Those are obtained from a running simulator and represent information about the simulator (like a small registry)
|
||||
class BLACKMISC_EXPORT CSimulatorInternals : public CValueObject<CSimulatorInternals>
|
||||
{
|
||||
//! Simulator internals for flight simulators.
|
||||
//! Those are obtained from a running simulator and represent information about the simulator (like a small registry)
|
||||
class BLACKMISC_EXPORT CSimulatorInternals : public CValueObject<CSimulatorInternals>
|
||||
public:
|
||||
//! Specific values
|
||||
enum ColumnIndex
|
||||
{
|
||||
public:
|
||||
//! Specific values
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexData = CPropertyIndexRef::GlobalIndexCSimulatorInternals
|
||||
};
|
||||
|
||||
//! Default constructor
|
||||
CSimulatorInternals() {}
|
||||
|
||||
//! All values
|
||||
BlackMisc::CNameVariantPairList getData() const { return this->m_data;}
|
||||
|
||||
//! Settings
|
||||
void setData(const BlackMisc::CNameVariantPairList &data) { this->m_data = data; }
|
||||
|
||||
//! Set value
|
||||
void setValue(const QString &name, const QString &value);
|
||||
|
||||
//! Set value
|
||||
void setValue(const QString &name, int value);
|
||||
|
||||
//! Get value
|
||||
CVariant getVariantValue(const QString &name) const;
|
||||
|
||||
//! Get string value
|
||||
QString getStringValue(const QString &name) const;
|
||||
|
||||
//! Get sorted names
|
||||
QStringList getSortedNames() const;
|
||||
|
||||
//! Get the simulator name
|
||||
QString getSimulatorName() const;
|
||||
|
||||
//! Set simulator name
|
||||
void setSimulatorName(const QString &name);
|
||||
|
||||
//! Plugin name
|
||||
QString getSimulatorSwiftPluginName() const;
|
||||
|
||||
//! Set plugin name
|
||||
void setSwiftPluginName(const QString &name);
|
||||
|
||||
//! Simulator version info, something like "10.3.2"
|
||||
QString getSimulatorVersion() const;
|
||||
|
||||
//! Simulator version info, something like "10.3.2"
|
||||
void setSimulatorVersion(const QString &versionInfo);
|
||||
|
||||
//! Path where simulator is installed
|
||||
QString getSimulatorInstallationDirectory() const;
|
||||
|
||||
//! Path where simulator is installed
|
||||
void setSimulatorInstallationDirectory(const QString &fullFilePath);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
QVariant propertyByIndex(CPropertyIndexRef index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString()
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
private:
|
||||
BlackMisc::CNameVariantPairList m_data;
|
||||
|
||||
BLACK_METACLASS(
|
||||
CSimulatorInternals,
|
||||
BLACK_METAMEMBER(data)
|
||||
);
|
||||
IndexData = CPropertyIndexRef::GlobalIndexCSimulatorInternals
|
||||
};
|
||||
} // namespace
|
||||
|
||||
//! Default constructor
|
||||
CSimulatorInternals() {}
|
||||
|
||||
//! All values
|
||||
BlackMisc::CNameVariantPairList getData() const { return this->m_data;}
|
||||
|
||||
//! Settings
|
||||
void setData(const BlackMisc::CNameVariantPairList &data) { this->m_data = data; }
|
||||
|
||||
//! Set value
|
||||
void setValue(const QString &name, const QString &value);
|
||||
|
||||
//! Set value
|
||||
void setValue(const QString &name, int value);
|
||||
|
||||
//! Get value
|
||||
CVariant getVariantValue(const QString &name) const;
|
||||
|
||||
//! Get string value
|
||||
QString getStringValue(const QString &name) const;
|
||||
|
||||
//! Get sorted names
|
||||
QStringList getSortedNames() const;
|
||||
|
||||
//! Get the simulator name
|
||||
QString getSimulatorName() const;
|
||||
|
||||
//! Set simulator name
|
||||
void setSimulatorName(const QString &name);
|
||||
|
||||
//! Plugin name
|
||||
QString getSimulatorSwiftPluginName() const;
|
||||
|
||||
//! Set plugin name
|
||||
void setSwiftPluginName(const QString &name);
|
||||
|
||||
//! Simulator version info, something like "10.3.2"
|
||||
QString getSimulatorVersion() const;
|
||||
|
||||
//! Simulator version info, something like "10.3.2"
|
||||
void setSimulatorVersion(const QString &versionInfo);
|
||||
|
||||
//! Path where simulator is installed
|
||||
QString getSimulatorInstallationDirectory() const;
|
||||
|
||||
//! Path where simulator is installed
|
||||
void setSimulatorInstallationDirectory(const QString &fullFilePath);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
QVariant propertyByIndex(CPropertyIndexRef index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString()
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
private:
|
||||
BlackMisc::CNameVariantPairList m_data;
|
||||
|
||||
BLACK_METACLASS(
|
||||
CSimulatorInternals,
|
||||
BLACK_METAMEMBER(data)
|
||||
);
|
||||
};
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatorInternals)
|
||||
|
||||
Reference in New Issue
Block a user