swift
Loading...
Searching...
No Matches
modelsettings.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2016 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_MISC_SIMULATION_SETTINGS_MODELSETTINGS_H
7#define SWIFT_MISC_SIMULATION_SETTINGS_MODELSETTINGS_H
8
10#include "misc/settingscache.h"
13
14SWIFT_DECLARE_VALUEOBJECT_MIXINS(swift::misc::simulation::Settings, CModelSettings)
15
16namespace swift::misc::simulation::settings
17{
19 class SWIFT_MISC_EXPORT CModelSettings : public CValueObject<CModelSettings>
20 {
21 public:
24 {
25 IndexAllowExclude = CPropertyIndexRef::GlobalIndexCSimulatorSettings
26 };
27
29 CModelSettings() = default;
30
32 bool getAllowExcludedModels() const { return m_allowExcludeModels; }
33
35 void setAllowExcludedModels(bool allow) { m_allowExcludeModels = allow; }
36
38 QString convertToQString(bool i18n = false) const;
39
41 QVariant propertyByIndex(CPropertyIndexRef index) const;
42
44 void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant);
45
46 private:
47 bool m_allowExcludeModels = false;
48
51 SWIFT_METAMEMBER(allowExcludeModels));
52 };
53
55 struct TModel : public TSettingTrait<CModelSettings>
56 {
58 static const char *key() { return "Models"; }
59
61 static const QString &humanReadable()
62 {
63 static const QString name("Model settings");
64 return name;
65 }
66 };
67
69 struct TDistributorListPreferences : public TSettingTrait<simulation::CDistributorListPreferences>
70 {
72 static const QString &humanReadable()
73 {
74 static const QString name("Distributor preferences");
75 return name;
76 }
77
79 static const char *key() { return "mapping/distributorpreferences"; }
80 };
81} // namespace swift::misc::simulation::settings
82
85
86#endif // SWIFT_MISC_SIMULATION_SETTINGS_MODELSETTINGS_H
Generic ordered container with value semantics.
Definition collection.h:113
Non-owning reference to a CPropertyIndex with a subset of its features.
CModelSettings()=default
Default constructor.
void setAllowExcludedModels(bool allow)
Allow excluded models?
bool getAllowExcludedModels() const
Allow excluded models?
#define SWIFT_METAMEMBER(MEMBER,...)
Macro to define an element within a metaclass.
Definition metaclass.h:72
#define SWIFT_METACLASS(CLASS,...)
Macro to define a nested metaclass that describes the attributes of its enclosing class.
Definition metaclass.h:52
Mapping preferences for model distributor list.
static const char * key()
Key string of the value. Reimplemented in derived class.
static const QString & humanReadable()
Optional human readable name.
Trait for simulator settings.
static const QString & humanReadable()
Optional human readable name.
static const char * key()
Key in data cache.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...
Definition valueobject.h:65