6 #ifndef SWIFT_MISC_PROPERTYINDEXREF_H
7 #define SWIFT_MISC_PROPERTYINDEXREF_H
25 GlobalIndexCValueObject = 10,
26 GlobalIndexCPhysicalQuantity = 100,
27 GlobalIndexCStatusMessage = 200,
28 GlobalIndexCNameVariantPair = 300,
29 GlobalIndexITimestampBased = 400,
30 GlobalIndexIOrderable = 500,
31 GlobalIndexINullable = 600,
32 GlobalIndexCIdentifier = 700,
33 GlobalIndexCRgbColor = 800,
34 GlobalIndexCCountry = 900,
35 GlobalIndexCPlatform = 1000,
36 GlobalIndexCApplicationInfo = 1100,
37 GlobalIndexCDirectories = 1200,
38 GlobalIndexCCrashInfo = 1300,
39 GlobalIndexCCrashSettings = 1400,
40 GlobalIndexCAircraftVelocity = 1900,
41 GlobalIndexCCallsign = 2000,
42 GlobalIndexCAircraftSituation = 2100,
43 GlobalIndexCAircraftSituationChange = 2200,
44 GlobalIndexCAtcStation = 2300,
45 GlobalIndexCInformationMessage = 2400,
46 GlobalIndexCAirport = 2500,
47 GlobalIndexCAircraftParts = 2600,
48 GlobalIndexCAircraftLights = 2700,
49 GlobalIndexCLivery = 2800,
50 GlobalIndexCFlightPlan = 2900,
51 GlobalIndexCSimBriefData = 3000,
52 GlobalIndexCComSystem = 3100,
53 GlobalIndexCModulator = 3200,
54 GlobalIndexCTransponder = 3300,
55 GlobalIndexCAircraftCategory = 3500,
56 GlobalIndexCAircraftIcaoCode = 3600,
57 GlobalIndexCAirlineIcaoCode = 3700,
58 GlobalIndexCAirportIcaoCode = 3800,
59 GlobalIndexCMetar = 4000,
60 GlobalIndexCCloudLayer = 4100,
61 GlobalIndexCPresentWeather = 4200,
62 GlobalIndexCWindLayer = 4300,
63 GlobalIndexCWeatherScenario = 4700,
64 GlobalIndexCOnGroundInfo = 4800,
65 GlobalIndexICoordinateGeodetic = 5000,
66 GlobalIndexICoordinateWithRelativePosition = 5100,
67 GlobalIndexCCoordinateGeodetic = 5200,
68 GlobalIndexCElevationPlane = 5300,
69 GlobalIndexCClient = 6000,
70 GlobalIndexCUser = 6100,
71 GlobalIndexCAuthenticatedUser = 6200,
72 GlobalIndexCRole = 6300,
73 GlobalIndexCServer = 6400,
74 GlobalIndexCFsdSetup = 6500,
75 GlobalIndexCUrl = 6800,
76 GlobalIndexCUrlLog = 6900,
77 GlobalIndexCRemoteFile = 7000,
78 GlobalIndexCEcosystem = 7100,
79 GlobalIndexCRawFsdMessage = 7200,
80 GlobalIndexCAircraftModel = 8000,
81 GlobalIndexCSimulatedAircraft = 8100,
82 GlobalIndexCTextMessage = 8200,
83 GlobalIndexCSimulatorInternals = 8300,
84 GlobalIndexCSimulatorSettings = 8400,
85 GlobalIndexCSwiftPluignSettings = 8500,
86 GlobalIndexCSimulatorMessageSettings = 8600,
87 GlobalIndexCModelSettings = 8700,
88 GlobalIndexCAircraftCfgEntries = 8800,
89 GlobalIndexCDistributor = 8900,
90 GlobalIndexCVPilotModelRule = 9000,
91 GlobalIndexCAudioDeviceInfo = 10000,
92 GlobalIndexCSettingKeyboardHotkey = 11000,
93 GlobalIndexCKeyboardKey = 11100,
94 GlobalIndexCJoystickButton = 11200,
95 GlobalIndexIDatastore = 12000,
96 GlobalIndexIDatastoreInteger = 12100,
97 GlobalIndexIDatastoreString = 12200,
98 GlobalIndexCDbInfo = 12300,
99 GlobalIndexCGlobalSetup = 13000,
100 GlobalIndexCArtifact = 13100,
101 GlobalIndexCDistribution = 13200,
102 GlobalIndexCUpdateInfo = 13300,
103 GlobalIndexCVatsimSetup = 13400,
104 GlobalIndexCLauncherSetup = 13500,
105 GlobalIndexCGuiStateDbOwnModelsComponent = 14000,
106 GlobalIndexCGuiStateDbOwnModelSetComponent = 14100,
107 GlobalIndexCDockWidgetSettings = 14200,
108 GlobalIndexCNavigatorSettings = 14300,
109 GlobalIndexCSettingsReaders = 14400,
110 GlobalIndexCViewUpdateSettings = 14500,
111 GlobalIndexCGeneralGuiSettings = 14600,
112 GlobalIndexCTextMessageSettings = 14700,
113 GlobalIndexCAtcStationsSettings = 14800,
114 GlobalIndexRawFsdMessageSettings = 14900,
115 GlobalIndexCInterpolatioRenderingSetup = 16000,
116 GlobalIndexCMatchingStatisticsEntry = 16100,
117 GlobalIndexCAircraftMatcherSetup = 16200,
118 GlobalIndexCXSwiftBusSettings = 16300,
119 GlobalIndexCFGSwiftBusSettings = 16400,
120 GlobalIndexSwiftPilotClient = 17000,
121 GlobalIndexSwiftCore = 17100,
122 GlobalIndexSwiftLauncher = 17200,
123 GlobalIndexLineNumber = 20000,
124 GlobalIndexEmpty = 20001
140 bool isNested()
const;
143 bool isMyself()
const;
146 bool isEmpty()
const;
149 int frontToInt()
const;
152 bool startsWith(
int index)
const;
155 QString toQString(
bool i18n =
false)
const;
158 template <
class CastType>
161 static_assert(std::is_enum_v<CastType> || std::is_integral_v<CastType>,
162 "CastType must be an enum or integer");
163 return static_cast<CastType
>(frontToInt());
167 template <
class EnumType>
170 static_assert(std::is_enum_v<EnumType>,
"Argument must be an enum");
171 return this->startsWith(
static_cast<int>(ev));
177 return [index = *
this](
const auto &a,
const auto &b) {
178 using T = std::decay_t<decltype(a)>;
182 return compare(a.propertyByIndex(index), b.propertyByIndex(index));
186 qFatal(
"Not implemented");
196 const int *m_begin =
nullptr;
197 int m_sizeOrIndex = -1;
Non-owning reference to a CPropertyIndex with a subset of its features.
auto comparator() const
Return a predicate function which can compare two objects based on this index.
static CPropertyIndexRef empty()
an empty property index
GlobalIndex
Global index, make sure the indexes are unqiue (for using them in class hierarchy)
bool startsWithPropertyIndexEnum(EnumType ev) const
Compare with index given by enum.
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
CPropertyIndexRef(QVector< int > &&)=delete
Forbid accidental constructor from an rvalue.
Free functions in swift::misc.
Trait which is true if the expression a.compareByPropertyIndex(b, i) is valid when a and b are instan...
Trait which is true if the expression a.propertyByIndex(i) is valid with a is an instance of T and i ...
#define SWIFT_MISC_EXPORT
Export a class or function from the library.