Use nested namespaces (C++17 feature)

This commit is contained in:
Mat Sutcliffe
2021-09-15 21:44:54 +01:00
parent 3f2e5b0b69
commit 57d32da826
1345 changed files with 146075 additions and 150376 deletions

View File

@@ -16,70 +16,64 @@
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/propertyindexref.h"
namespace BlackMisc
namespace BlackMisc::Simulation::Settings
{
namespace Simulation
//! Settings for models
class BLACKMISC_EXPORT CModelSettings : public CValueObject<CModelSettings>
{
namespace Settings
public:
//! Properties by index
enum ColumnIndex
{
//! Settings for models
class BLACKMISC_EXPORT CModelSettings : public CValueObject<CModelSettings>
{
public:
//! Properties by index
enum ColumnIndex
{
IndexAllowExclude = CPropertyIndexRef::GlobalIndexCSimulatorSettings
};
IndexAllowExclude = CPropertyIndexRef::GlobalIndexCSimulatorSettings
};
//! Default constructor
CModelSettings();
//! Default constructor
CModelSettings();
//! Allow excluded models?
bool getAllowExcludedModels() const { return m_allowExcludeModels; }
//! Allow excluded models?
bool getAllowExcludedModels() const { return m_allowExcludeModels; }
//! Allow excluded models?
void setAllowExcludedModels(bool allow) { m_allowExcludeModels = allow; }
//! Allow excluded models?
void setAllowExcludedModels(bool allow) { m_allowExcludeModels = allow; }
//! \copydoc BlackMisc::Mixin::String::toQString
QString convertToQString(bool i18n = false) const;
//! \copydoc BlackMisc::Mixin::String::toQString
QString convertToQString(bool i18n = false) const;
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
QVariant propertyByIndex(CPropertyIndexRef index) const;
//! \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::Index::setPropertyByIndex
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant);
private:
bool m_allowExcludeModels = false; //!< Allow excluded models in sets
private:
bool m_allowExcludeModels = false; //!< Allow excluded models in sets
BLACK_METACLASS(
CModelSettings,
BLACK_METAMEMBER(allowExcludeModels)
);
};
BLACK_METACLASS(
CModelSettings,
BLACK_METAMEMBER(allowExcludeModels)
);
};
//! Trait for simulator settings
struct TModel : public TSettingTrait<CModelSettings>
{
//! Key in data cache
static const char *key() { return "Models"; }
//! Trait for simulator settings
struct TModel : public TSettingTrait<CModelSettings>
{
//! Key in data cache
static const char *key() { return "Models"; }
//! \copydoc BlackMisc::TSettingTrait::humanReadable
static const QString &humanReadable() { static const QString name("Model settings"); return name; }
};
//! \copydoc BlackMisc::TSettingTrait::humanReadable
static const QString &humanReadable() { static const QString name("Model settings"); return name; }
};
//! Mapping preferences for model distributor list
struct TDistributorListPreferences : public TSettingTrait<Simulation::CDistributorListPreferences>
{
//! \copydoc BlackMisc::TSettingTrait::humanReadable
static const QString &humanReadable() { static const QString name("Distributor preferences"); return name; }
//! Mapping preferences for model distributor list
struct TDistributorListPreferences : public TSettingTrait<Simulation::CDistributorListPreferences>
{
//! \copydoc BlackMisc::TSettingTrait::humanReadable
static const QString &humanReadable() { static const QString name("Distributor preferences"); return name; }
//! \copydoc BlackMisc::TSettingTrait::key
static const char *key() { return "mapping/distributorpreferences"; }
};
} // ns
} // ns
//! \copydoc BlackMisc::TSettingTrait::key
static const char *key() { return "mapping/distributorpreferences"; }
};
} // ns
Q_DECLARE_METATYPE(BlackMisc::Simulation::Settings::CModelSettings)