refs #628 Use the metaclass mixins in all value classes.

This commit is contained in:
Mathew Sutcliffe
2016-04-02 17:34:18 +01:00
parent 4f3637a046
commit 4bd4baa535
82 changed files with 629 additions and 560 deletions

View File

@@ -148,8 +148,6 @@ namespace BlackCore
static CGlobalSetup fromJsonFile(const QString &fileNameAndPath);
private:
BLACK_ENABLE_TUPLE_CONVERSION(BlackCore::Data::CGlobalSetup)
bool m_wasLoaded = false; //!< Loaded from web
int m_dbHttpPort = 80; //!< port
int m_dbHttpsPort = 443; //!< SSL port
@@ -165,6 +163,23 @@ namespace BlackCore
// transient members, to be switched on/off via GUI or set from reader
bool m_dbDebugFlag = false; //!< can trigger DEBUG on the server, so you need to know what you are doing
BLACK_METACLASS(CGlobalSetup,
BLACK_METAMEMBER(wasLoaded),
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(dbRootDirectoryUrl),
BLACK_METAMEMBER(dbHttpPort),
BLACK_METAMEMBER(dbHttpsPort),
BLACK_METAMEMBER(vatsimStatusFileUrls),
BLACK_METAMEMBER(vatsimDataFileUrls),
BLACK_METAMEMBER(vatsimBookingsUrl),
BLACK_METAMEMBER(vatsimMetarsUrls),
BLACK_METAMEMBER(sharedUrls),
BLACK_METAMEMBER(newsUrls),
BLACK_METAMEMBER(fsdTestServers),
BLACK_METAMEMBER(development),
BLACK_METAMEMBER(dbDebugFlag, BlackMisc::DisabledForJson)
);
};
//! Trait for global setup data
@@ -185,20 +200,5 @@ namespace BlackCore
} // ns
Q_DECLARE_METATYPE(BlackCore::Data::CGlobalSetup)
BLACK_DECLARE_TUPLE_CONVERSION(BlackCore::Data::CGlobalSetup, (
attr(o.m_wasLoaded),
attr(o.m_timestampMSecsSinceEpoch),
attr(o.m_dbRootDirectoryUrl),
attr(o.m_dbHttpPort),
attr(o.m_dbHttpsPort),
attr(o.m_vatsimStatusFileUrls),
attr(o.m_vatsimDataFileUrls),
attr(o.m_vatsimBookingsUrl),
attr(o.m_vatsimMetarsUrls),
attr(o.m_sharedUrls),
attr(o.m_newsUrls),
attr(o.m_fsdTestServers),
attr(o.m_development),
attr(o.m_dbDebugFlag, flags < DisabledForJson > ())
))
#endif // guard

View File

@@ -91,8 +91,6 @@ namespace BlackCore
void setPropertyByIndex(const BlackMisc::CVariant &variant, const BlackMisc::CPropertyIndex &index);
private:
BLACK_ENABLE_TUPLE_CONVERSION(BlackCore::Data::CUpdateInfo)
bool m_development = false; //!< for development
BlackMisc::Network::CUrlList m_downloadsStableUrls; //!< Download URLs, here I get the installer
BlackMisc::Network::CUrlList m_downloadsBetaUrls; //!< Download URLs, here I get the installer
@@ -100,6 +98,17 @@ namespace BlackCore
QString m_lastSupportedVersionStable; //!< last supported version
QString m_latestVersionBeta; //!< latest version
QString m_lastSupportedVersionBeta; //!< last supported version
BLACK_METACLASS(CUpdateInfo,
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(development),
BLACK_METAMEMBER(downloadsStableUrls),
BLACK_METAMEMBER(downloadsBetaUrls),
BLACK_METAMEMBER(latestVersionStable),
BLACK_METAMEMBER(lastSupportedVersionStable),
BLACK_METAMEMBER(latestVersionBeta),
BLACK_METAMEMBER(lastSupportedVersionBeta)
);
};
//! Trait for global setup data
@@ -120,14 +129,5 @@ namespace BlackCore
} // ns
Q_DECLARE_METATYPE(BlackCore::Data::CUpdateInfo)
BLACK_DECLARE_TUPLE_CONVERSION(BlackCore::Data::CUpdateInfo, (
attr(o.m_timestampMSecsSinceEpoch),
attr(o.m_development),
attr(o.m_downloadsStableUrls),
attr(o.m_downloadsBetaUrls),
attr(o.m_latestVersionStable),
attr(o.m_lastSupportedVersionStable),
attr(o.m_latestVersionBeta),
attr(o.m_lastSupportedVersionBeta)
))
#endif // guard

View File

@@ -96,14 +96,22 @@ namespace BlackCore
void setPropertyByIndex(const BlackMisc::CVariant &variant, const BlackMisc::CPropertyIndex &index);
private:
BLACK_ENABLE_TUPLE_CONVERSION(BlackCore::Data::CVatsimSetup)
BlackMisc::Network::CUrlList m_serverFileUrls; //!< only the FSD servers
BlackMisc::Network::CUrlList m_dataFileUrls; //!< Full VATSIM files
BlackMisc::Network::CUrlList m_metarFileUrls; //!< METAR files
BlackMisc::Network::CServerList m_fsdServers; //!< FSD test servers
BlackMisc::Network::CServerList m_voiceServers; //!< voice servers
BlackMisc::Network::CUser m_lastLoginUser; //!< last login user
BLACK_METACLASS(CVatsimSetup,
BLACK_METAMEMBER(serverFileUrls),
BLACK_METAMEMBER(dataFileUrls),
BLACK_METAMEMBER(metarFileUrls),
BLACK_METAMEMBER(fsdServers),
BLACK_METAMEMBER(voiceServers),
BLACK_METAMEMBER(lastLoginUser),
BLACK_METAMEMBER(timestampMSecsSinceEpoch)
);
};
//! Trait for global setup data
@@ -124,13 +132,5 @@ namespace BlackCore
} // ns
Q_DECLARE_METATYPE(BlackCore::Data::CVatsimSetup)
BLACK_DECLARE_TUPLE_CONVERSION(BlackCore::Data::CVatsimSetup, (
attr(o.m_serverFileUrls),
attr(o.m_dataFileUrls),
attr(o.m_metarFileUrls),
attr(o.m_fsdServers),
attr(o.m_voiceServers),
attr(o.m_lastLoginUser),
attr(o.m_timestampMSecsSinceEpoch)
))
#endif // guard

View File

@@ -57,8 +57,11 @@ namespace BlackGui
int comparePropertyByIndex(const CDbOwnModelsComponent &compareValue, const BlackMisc::CPropertyIndex &index) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CDbOwnModelsComponent)
BlackMisc::Simulation::CSimulatorInfo m_simulator; //!< Last simulator selection
BLACK_METACLASS(CDbOwnModelsComponent,
BLACK_METAMEMBER(simulator)
);
};
//! Trait for model cache
@@ -79,9 +82,6 @@ namespace BlackGui
} // ns
Q_DECLARE_METATYPE(BlackGui::Components::Data::CDbOwnModelsComponent)
BLACK_DECLARE_TUPLE_CONVERSION(BlackGui::Components::Data::CDbOwnModelsComponent, (
attr(o.m_simulator)
))
#endif // guard

View File

@@ -81,17 +81,21 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAudioDeviceInfo)
DeviceType m_type; //!< Device type, @see CAudioDeviceInfo::DeviceType
int m_deviceIndex; //!< deviceIndex is the number is the reference for the VVL. The device is selected by this index. The managing class needs to take care, that indexes are valid.
QString m_deviceName; //!< Device name
QString m_hostName; //!< We use a DBus based system. Hence an audio device can reside on a differen computers, this here is its name
BLACK_METACLASS(CAudioDeviceInfo,
BLACK_METAMEMBER(type),
BLACK_METAMEMBER(deviceIndex),
BLACK_METAMEMBER(deviceName),
BLACK_METAMEMBER(hostName)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Audio::CAudioDeviceInfo, (o.m_type, o.m_deviceIndex, o.m_deviceName, o.m_hostName))
Q_DECLARE_METATYPE(BlackMisc::Audio::CAudioDeviceInfo)
#endif // guard

View File

@@ -47,9 +47,12 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CSettingsAudio)
QString m_notificationFlags; //!< play notification for notification x, a little trick to use a string here (streamable, hashable, ..)
void initNotificationFlags(); //!< init flags
BLACK_METACLASS(CSettingsAudio,
BLACK_METAMEMBER(notificationFlags)
);
};
} // namespace
@@ -57,6 +60,5 @@ namespace BlackMisc
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Audio::Settings::CSettingsAudio)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Audio::Settings::CSettingsAudio, (o.m_notificationFlags))
#endif // guard

View File

@@ -104,16 +104,21 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CVoiceRoom)
QString m_hostname;
QString m_channel;
bool m_connected;
bool m_audioPlaying;
BLACK_METACLASS(CVoiceRoom,
BLACK_METAMEMBER(hostname),
BLACK_METAMEMBER(channel),
BLACK_METAMEMBER(connected),
BLACK_METAMEMBER(audioPlaying)
);
};
} // Voice
} // BlackMisc
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Audio::CVoiceRoom, (o.m_hostname, o.m_channel, o.m_connected, o.m_audioPlaying))
Q_DECLARE_METATYPE(BlackMisc::Audio::CVoiceRoom)
#endif // guard

View File

@@ -46,18 +46,17 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftEngine)
int m_number = 1;
bool m_on = true;
BLACK_METACLASS(CAircraftEngine,
BLACK_METAMEMBER(number, 0, DisabledForJson),
BLACK_METAMEMBER(on)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftEngine)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAircraftEngine, (
attr(o.m_number, flags<DisabledForJson>()),
attr(o.m_on, "on")
))
#endif // guard

View File

@@ -46,10 +46,10 @@ namespace BlackMisc
//! Engine number 1..x on?
bool isEngineOn(int engineNumber) const;
//! \copydoc BlackMisc::Mixin::JsonByTuple::toJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::toJson
QJsonObject toJson() const;
//! \copydoc BlackMisc::Mixin::JsonByTuple::convertFromJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::convertFromJson
void convertFromJson(const QJsonObject &json);
};

View File

@@ -255,7 +255,6 @@ namespace BlackMisc
static CAircraftIcaoCode fromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftIcaoCode)
QString m_designator; //!< "B737"
QString m_iataCode; //!< "320"
QString m_family; //!< "A350" (not a real ICAO code, but a family)
@@ -273,25 +272,26 @@ namespace BlackMisc
//! Create a combined string like L2J
static QString createdCombinedString(const QString &type, int engineCount, const QString &engine);
BLACK_METACLASS(CAircraftIcaoCode,
BLACK_METAMEMBER(dbKey),
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(designator),
BLACK_METAMEMBER(iataCode),
BLACK_METAMEMBER(family),
BLACK_METAMEMBER(combinedType),
BLACK_METAMEMBER(manufacturer),
BLACK_METAMEMBER(modelDescription),
BLACK_METAMEMBER(wtc),
BLACK_METAMEMBER(military),
BLACK_METAMEMBER(realWorld),
BLACK_METAMEMBER(legacy),
BLACK_METAMEMBER(rank)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftIcaoCode)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAircraftIcaoCode, (
o.m_dbKey,
o.m_timestampMSecsSinceEpoch,
o.m_designator,
o.m_iataCode,
o.m_family,
o.m_combinedType,
o.m_manufacturer,
o.m_modelDescription,
o.m_wtc,
o.m_military,
o.m_realWorld,
o.m_legacy,
o.m_rank
))
#endif // guard

View File

@@ -100,7 +100,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftLights)
bool m_strobeOn = false;
bool m_landingOn = false;
bool m_taxiOn = false;
@@ -108,18 +107,18 @@ namespace BlackMisc
bool m_navOn = false;
bool m_logoOn = false;
BLACK_METACLASS(CAircraftLights,
BLACK_METAMEMBER_NAMED(strobeOn, "strobe_on"),
BLACK_METAMEMBER_NAMED(landingOn, "landing_on"),
BLACK_METAMEMBER_NAMED(taxiOn, "taxi_on"),
BLACK_METAMEMBER_NAMED(beaconOn, "beacon_on"),
BLACK_METAMEMBER_NAMED(navOn, "nav_on"),
BLACK_METAMEMBER_NAMED(logoOn, "logo_on")
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftLights)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAircraftLights, (
attr(o.m_strobeOn, "strobe_on"),
attr(o.m_landingOn, "landing_on"),
attr(o.m_taxiOn, "taxi_on"),
attr(o.m_beaconOn, "beacon_on"),
attr(o.m_navOn, "nav_on"),
attr(o.m_logoOn, "logo_on")
))
#endif // guard

View File

@@ -114,7 +114,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftParts)
CAircraftLights m_lights;
CAircraftEngineList m_engines;
int m_flapsPercentage = 0;
@@ -122,19 +121,19 @@ namespace BlackMisc
bool m_spoilersOut = false;
bool m_isOnGround = false;
BLACK_METACLASS(CAircraftParts,
BLACK_METAMEMBER_NAMED(lights, "lights"),
BLACK_METAMEMBER_NAMED(gearDown, "gear_down"),
BLACK_METAMEMBER_NAMED(flapsPercentage, "flaps_pct"),
BLACK_METAMEMBER_NAMED(spoilersOut, "spoilers_out"),
BLACK_METAMEMBER_NAMED(engines, "engines"),
BLACK_METAMEMBER_NAMED(isOnGround, "on_ground"),
BLACK_METAMEMBER(timestampMSecsSinceEpoch, 0, DisabledForJson | DisabledForComparison)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAircraftParts, (
attr(o.m_lights, "lights"),
attr(o.m_gearDown, "gear_down"),
attr(o.m_flapsPercentage, "flaps_pct"),
attr(o.m_spoilersOut, "spoilers_out"),
attr(o.m_engines, "engines"),
attr(o.m_isOnGround, "on_ground"),
attr(o.m_timestampMSecsSinceEpoch, flags < DisabledForJson | DisabledForComparison > ())
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftParts)
#endif // guard

View File

@@ -147,7 +147,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftSituation)
CCallsign m_correspondingCallsign;
BlackMisc::Geo::CCoordinateGeodetic m_position;
BlackMisc::Aviation::CAltitude m_altitude;
@@ -155,21 +154,21 @@ namespace BlackMisc
BlackMisc::PhysicalQuantities::CAngle m_pitch;
BlackMisc::PhysicalQuantities::CAngle m_bank;
BlackMisc::PhysicalQuantities::CSpeed m_groundspeed;
BLACK_METACLASS(CAircraftSituation,
BLACK_METAMEMBER(correspondingCallsign),
BLACK_METAMEMBER(position),
BLACK_METAMEMBER(altitude),
BLACK_METAMEMBER(heading),
BLACK_METAMEMBER(pitch),
BLACK_METAMEMBER(bank),
BLACK_METAMEMBER(groundspeed),
BLACK_METAMEMBER(timestampMSecsSinceEpoch)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAircraftSituation, (
o.m_correspondingCallsign,
o.m_position,
o.m_altitude,
o.m_heading,
o.m_pitch,
o.m_bank,
o.m_groundspeed,
o.m_timestampMSecsSinceEpoch
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftSituation)
#endif // guard

View File

@@ -177,7 +177,6 @@ namespace BlackMisc
static CAirlineIcaoCode fromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAirlineIcaoCode)
QString m_designator; //!< "DLH"
QString m_iataCode; //!< "LH"
QString m_name; //!< "Lufthansa"
@@ -186,21 +185,22 @@ namespace BlackMisc
bool m_isVa = false; //!< virtual airline
bool m_isOperating = true; //!< still operating?
bool m_isMilitary = false; //!< air force or such
BLACK_METACLASS(CAirlineIcaoCode,
BLACK_METAMEMBER(dbKey),
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(designator),
BLACK_METAMEMBER(name),
BLACK_METAMEMBER(country),
BLACK_METAMEMBER(telephonyDesignator),
BLACK_METAMEMBER(isVa),
BLACK_METAMEMBER(isOperating),
BLACK_METAMEMBER(isMilitary)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAirlineIcaoCode)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAirlineIcaoCode, (
o.m_dbKey,
o.m_timestampMSecsSinceEpoch,
o.m_designator,
o.m_name,
o.m_country,
o.m_telephonyDesignator,
o.m_isVa,
o.m_isOperating,
o.m_isMilitary
))
#endif // guard

View File

@@ -115,22 +115,21 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAirport)
CAirportIcaoCode m_icao;
QString m_descriptiveName;
BlackMisc::Geo::CCoordinateGeodetic m_position;
BLACK_METACLASS(CAirport,
BLACK_METAMEMBER(icao),
BLACK_METAMEMBER(descriptiveName),
BLACK_METAMEMBER(position),
BLACK_METAMEMBER(distanceToOwnAircraft),
BLACK_METAMEMBER(bearingToOwnAircraft)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAirport, (
o.m_icao,
o.m_descriptiveName,
o.m_position,
o.m_distanceToOwnAircraft,
o.m_bearingToOwnAircraft
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAirport)
#endif // guard

View File

@@ -57,15 +57,15 @@ namespace BlackMisc
int comparePropertyByIndex(const CAirportIcaoCode &compareValue, const CPropertyIndex &index) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAirportIcaoCode)
QString m_icaoCode;
BLACK_METACLASS(CAirportIcaoCode,
BLACK_METAMEMBER(icaoCode, 0, CaseInsensitiveComparison)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAirportIcaoCode, (
attr(o.m_icaoCode, flags<CaseInsensitiveComparison>())
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAirportIcaoCode)
#endif // guard

View File

@@ -14,6 +14,7 @@
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/pq/length.h"
#include "blackmisc/metaclass.h"
namespace BlackMisc
{
@@ -27,11 +28,11 @@ namespace BlackMisc
class BLACKMISC_EXPORT CAltitude :
public PhysicalQuantities::CLength,
public Mixin::MetaType<CAltitude>,
public Mixin::EqualsByTuple<CAltitude>,
public Mixin::CompareByTuple<CAltitude>,
public Mixin::HashByTuple<CAltitude>,
public Mixin::DBusByTuple<CAltitude>,
public Mixin::JsonByTuple<CAltitude>,
public Mixin::EqualsByMetaClass<CAltitude>,
public Mixin::CompareByMetaClass<CAltitude>,
public Mixin::HashByMetaClass<CAltitude>,
public Mixin::DBusByMetaClass<CAltitude>,
public Mixin::JsonByMetaClass<CAltitude>,
public Mixin::String<CAltitude>,
public Mixin::Icon<CAltitude>,
public Mixin::Index<CAltitude>
@@ -100,13 +101,15 @@ namespace BlackMisc
BlackMisc::CIcon toIcon() const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAltitude)
ReferenceDatum m_datum; //!< MSL or AGL?
BLACK_METACLASS(CAltitude,
BLACK_METAMEMBER(datum)
);
};
}
}
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAltitude, (o.m_datum))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAltitude)
#endif // guard

View File

@@ -246,7 +246,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAtcStation)
CCallsign m_callsign;
BlackMisc::Network::CUser m_controller;
BlackMisc::PhysicalQuantities::CFrequency m_frequency;
@@ -258,25 +257,26 @@ namespace BlackMisc
CInformationMessage m_atis { CInformationMessage::ATIS };
CInformationMessage m_metar { CInformationMessage::METAR };
BlackMisc::Audio::CVoiceRoom m_voiceRoom;
BLACK_METACLASS(CAtcStation,
BLACK_METAMEMBER(callsign),
BLACK_METAMEMBER(controller),
BLACK_METAMEMBER(frequency),
BLACK_METAMEMBER(position),
BLACK_METAMEMBER(range),
BLACK_METAMEMBER(isOnline),
BLACK_METAMEMBER(atis),
BLACK_METAMEMBER(bookedFromUtc),
BLACK_METAMEMBER(bookedUntilUtc),
BLACK_METAMEMBER(metar),
BLACK_METAMEMBER(voiceRoom),
BLACK_METAMEMBER(distanceToOwnAircraft),
BLACK_METAMEMBER(bearingToOwnAircraft)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAtcStation, (
o.m_callsign,
o.m_controller,
o.m_frequency,
o.m_position,
o.m_range,
o.m_isOnline,
o.m_atis,
o.m_bookedFromUtc,
o.m_bookedUntilUtc,
o.m_metar,
o.m_voiceRoom,
o.m_distanceToOwnAircraft,
o.m_bearingToOwnAircraft
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAtcStation)
#endif // guard

View File

@@ -154,21 +154,21 @@ namespace BlackMisc
static QString unifyCallsign(const QString &callsign);
private:
BLACK_ENABLE_TUPLE_CONVERSION(CCallsign)
QString m_callsignAsSet;
QString m_callsign;
QString m_telephonyDesignator;
TypeHint m_typeHint = NoHint;
BLACK_METACLASS(CCallsign,
BLACK_METAMEMBER(callsign, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(callsignAsSet, 0, DisabledForComparison | DisabledForHashing),
BLACK_METAMEMBER(telephonyDesignator, 0, DisabledForComparison | DisabledForHashing),
BLACK_METAMEMBER(typeHint, 0, DisabledForComparison | DisabledForHashing)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CCallsign, (
attr(o.m_callsign, flags <CaseInsensitiveComparison> ()),
attr(o.m_callsignAsSet, flags <DisabledForComparison | DisabledForHashing>()),
attr(o.m_telephonyDesignator, flags <DisabledForComparison | DisabledForHashing>()),
attr(o.m_typeHint, flags <DisabledForComparison | DisabledForHashing>())
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CCallsign)
#endif // guard

View File

@@ -166,13 +166,14 @@ namespace BlackMisc
//! \remarks Just a helper method, that is why no CFrequency is returned
static double channelSpacingToFrequencyKHz(ChannelSpacing channelSpacing);
BLACK_ENABLE_TUPLE_CONVERSION(CComSystem)
BLACK_METACLASS(CComSystem,
BLACK_METAMEMBER(channelSpacing)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CComSystem, (o.m_channelSpacing))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CComSystem)
Q_DECLARE_METATYPE(BlackMisc::Aviation::CComSystem::ChannelSpacing)
Q_DECLARE_METATYPE(BlackMisc::Aviation::CComSystem::ComUnit)

View File

@@ -186,7 +186,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CFlightPlan)
QString m_equipmentIcao;
CAirportIcaoCode m_originAirportIcao;
CAirportIcaoCode m_destinationAirportIcao;
@@ -201,26 +200,27 @@ namespace BlackMisc
QString m_route;
QString m_remarks;
QDateTime m_lastSentOrLoaded;
BLACK_METACLASS(CFlightPlan,
BLACK_METAMEMBER(equipmentIcao),
BLACK_METAMEMBER(originAirportIcao),
BLACK_METAMEMBER(destinationAirportIcao),
BLACK_METAMEMBER(alternateAirportIcao),
BLACK_METAMEMBER(takeoffTimePlanned),
BLACK_METAMEMBER(takeoffTimeActual),
BLACK_METAMEMBER(enrouteTime),
BLACK_METAMEMBER(fuelTime),
BLACK_METAMEMBER(cruiseAltitude),
BLACK_METAMEMBER(cruiseTrueAirspeed),
BLACK_METAMEMBER(flightRules),
BLACK_METAMEMBER(route),
BLACK_METAMEMBER(remarks),
BLACK_METAMEMBER(lastSentOrLoaded)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Aviation::CFlightPlan)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CFlightPlan, (
o.m_equipmentIcao,
o.m_originAirportIcao,
o.m_destinationAirportIcao,
o.m_alternateAirportIcao,
o.m_takeoffTimePlanned,
o.m_takeoffTimeActual,
o.m_enrouteTime,
o.m_fuelTime,
o.m_cruiseAltitude,
o.m_cruiseTrueAirspeed,
o.m_flightRules,
o.m_route,
o.m_remarks,
o.m_lastSentOrLoaded
))
#endif // guard

View File

@@ -14,6 +14,7 @@
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/pq/angle.h"
#include "blackmisc/metaclass.h"
namespace BlackMisc
{
@@ -27,11 +28,11 @@ namespace BlackMisc
class BLACKMISC_EXPORT CHeading :
public PhysicalQuantities::CAngle,
public Mixin::MetaType<CHeading>,
public Mixin::EqualsByTuple<CHeading>,
public Mixin::CompareByTuple<CHeading>,
public Mixin::HashByTuple<CHeading>,
public Mixin::DBusByTuple<CHeading>,
public Mixin::JsonByTuple<CHeading>,
public Mixin::EqualsByMetaClass<CHeading>,
public Mixin::CompareByMetaClass<CHeading>,
public Mixin::HashByMetaClass<CHeading>,
public Mixin::DBusByMetaClass<CHeading>,
public Mixin::JsonByMetaClass<CHeading>,
public Mixin::String<CHeading>,
public Mixin::Index<CHeading>
{
@@ -74,13 +75,15 @@ namespace BlackMisc
ReferenceNorth getReferenceNorth() const { return m_north; }
private:
BLACK_ENABLE_TUPLE_CONVERSION(CHeading)
ReferenceNorth m_north; //!< magnetic or true?
BLACK_METACLASS(CHeading,
BLACK_METAMEMBER(north)
);
};
}
}
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CHeading, (o.m_north))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CHeading)
#endif // guard

View File

@@ -93,20 +93,19 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CInformationMessage)
InformationType m_type;
QString m_message;
QDateTime m_receivedTimestamp;
BLACK_METACLASS(CInformationMessage,
BLACK_METAMEMBER(type),
BLACK_METAMEMBER(message),
BLACK_METAMEMBER(receivedTimestamp)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CInformationMessage, (
o.m_type,
o.m_message,
o.m_receivedTimestamp
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CInformationMessage)
#endif // guard

View File

@@ -158,27 +158,26 @@ namespace BlackMisc
static const QString &colorLiveryMarker();
private:
BLACK_ENABLE_TUPLE_CONVERSION(CLivery)
CAirlineIcaoCode m_airline; //!< corresponding airline, if any
QString m_combinedCode; //!< livery code and pseudo airline ICAO code
QString m_description; //!< describes the livery
BlackMisc::CRgbColor m_colorFuselage; //! color of fuselage
BlackMisc::CRgbColor m_colorTail; //! color of tail
bool m_military = false; //! Military livery?
BLACK_METACLASS(CLivery,
BLACK_METAMEMBER(dbKey),
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(airline),
BLACK_METAMEMBER(combinedCode, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(description),
BLACK_METAMEMBER(colorFuselage),
BLACK_METAMEMBER(colorTail)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CLivery, (
attr(o.m_dbKey),
attr(o.m_timestampMSecsSinceEpoch),
attr(o.m_airline),
attr(o.m_combinedCode, flags <CaseInsensitiveComparison> ()),
attr(o.m_description),
attr(o.m_colorFuselage),
attr(o.m_colorTail)
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CLivery)
#endif // guard

View File

@@ -136,7 +136,6 @@ namespace BlackMisc
static const BlackMisc::PhysicalQuantities::CFrequency &FrequencyNotSet();
private:
BLACK_ENABLE_TUPLE_CONVERSION(CModulator)
QString m_name; //!< name of the unit
BlackMisc::PhysicalQuantities::CFrequency m_frequencyActive; //!< active frequency
BlackMisc::PhysicalQuantities::CFrequency m_frequencyStandby; //!< standby frequency
@@ -149,6 +148,15 @@ namespace BlackMisc
//! Easy access to derived class (CRTP template parameter)
AVIO *derived();
BLACK_METACLASS(CModulator,
BLACK_METAMEMBER(name),
BLACK_METAMEMBER(frequencyActive),
BLACK_METAMEMBER(frequencyStandby),
BLACK_METAMEMBER(volumeInput),
BLACK_METAMEMBER(volumeOutput),
BLACK_METAMEMBER(enabled)
);
};
//! \cond PRIVATE
@@ -164,12 +172,4 @@ namespace BlackMisc
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION_TEMPLATE(BlackMisc::Aviation::CModulator, (
o.m_name,
o.m_frequencyActive,
o.m_frequencyStandby,
o.m_volumeInput ,
o.m_volumeOutput,
o.m_enabled))
#endif // guard

View File

@@ -74,15 +74,17 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CSelcal)
QString m_code;
static QList<BlackMisc::PhysicalQuantities::CFrequency> frequencyEquivalents;
static QStringList allCodePairs;
BLACK_METACLASS(CSelcal,
BLACK_METAMEMBER(code)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CSelcal, (o.m_code))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CSelcal)
#endif // guard

View File

@@ -14,6 +14,7 @@
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/pq/angle.h"
#include "blackmisc/metaclass.h"
namespace BlackMisc
{
@@ -28,11 +29,11 @@ namespace BlackMisc
class BLACKMISC_EXPORT CTrack :
public PhysicalQuantities::CAngle,
public Mixin::MetaType<CTrack>,
public Mixin::EqualsByTuple<CTrack>,
public Mixin::CompareByTuple<CTrack>,
public Mixin::HashByTuple<CTrack>,
public Mixin::DBusByTuple<CTrack>,
public Mixin::JsonByTuple<CTrack>,
public Mixin::EqualsByMetaClass<CTrack>,
public Mixin::CompareByMetaClass<CTrack>,
public Mixin::HashByMetaClass<CTrack>,
public Mixin::DBusByMetaClass<CTrack>,
public Mixin::JsonByMetaClass<CTrack>,
public Mixin::String<CTrack>,
public Mixin::Index<CTrack>
{
@@ -85,13 +86,15 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CTrack)
ReferenceNorth m_north; //!< magnetic or true?
BLACK_METACLASS(CTrack,
BLACK_METAMEMBER(north)
);
};
}
}
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CTrack, (o.m_north))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CTrack)
#endif // guard

View File

@@ -173,19 +173,18 @@ namespace BlackMisc
//! Default value?
bool isDefaultValue() const { return this->m_transponderCode == 0; }
BLACK_ENABLE_TUPLE_CONVERSION(CTransponder)
int m_transponderCode; //!< Transponder code
TransponderMode m_transponderMode; //!< Transponder mode
BLACK_METACLASS(CTransponder,
BLACK_METAMEMBER(transponderCode),
BLACK_METAMEMBER(transponderMode)
);
};
} // ns
} // ns
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CTransponder, (
o.m_transponderCode,
o.m_transponderMode
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CTransponder)
Q_DECLARE_METATYPE(BlackMisc::Aviation::CTransponder::TransponderMode)

View File

@@ -101,7 +101,7 @@ namespace BlackMisc
//! Simplifies composition, returns 0 for performance
friend uint qHash(const C<T> &) { return 0; }
//! \copydoc BlackMisc::Mixin::JsonByTuple::toJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::toJson
QJsonObject toJson() const
{
QJsonArray array;
@@ -121,7 +121,7 @@ namespace BlackMisc
return jsonDoc.toJson(format);
}
//! \copydoc BlackMisc::Mixin::JsonByTuple::convertFromJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::convertFromJson
void convertFromJson(const QJsonObject &json)
{
derived().clear();

View File

@@ -91,17 +91,16 @@ namespace BlackMisc
static bool isValidIsoCode(const QString &isoCode);
private:
BLACK_ENABLE_TUPLE_CONVERSION(CCountry)
QString m_name; //!< country name
BLACK_METACLASS(CCountry,
BLACK_METAMEMBER(dbKey),
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(name)
);
};
} // namespace
Q_DECLARE_METATYPE(BlackMisc::CCountry)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CCountry, (
attr(o.m_dbKey),
attr(o.m_timestampMSecsSinceEpoch),
attr(o.m_name)
))
#endif // guard

View File

@@ -131,8 +131,8 @@ namespace BlackMisc
* the derived class uses this macro to disambiguate the inherited members.
*/
# define BLACKMISC_DECLARE_USING_MIXIN_DBUS(DERIVED) \
using ::BlackMisc::Mixin::DBusByTuple<DERIVED>::marshallToDbus; \
using ::BlackMisc::Mixin::DBusByTuple<DERIVED>::unmarshallFromDbus;
using ::BlackMisc::Mixin::DBusByMetaClass<DERIVED>::marshallToDbus; \
using ::BlackMisc::Mixin::DBusByMetaClass<DERIVED>::unmarshallFromDbus;
} // Mixin
} // BlackMisc

View File

@@ -221,7 +221,7 @@ namespace BlackMisc
}
}
//! \copydoc BlackMisc::Mixin::JsonByTuple::toJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::toJson
QJsonObject toJson() const
{
QJsonArray array;
@@ -235,7 +235,7 @@ namespace BlackMisc
return json;
}
//! \copydoc BlackMisc::Mixin::JsonByTuple::convertFromJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::convertFromJson
void convertFromJson(const QJsonObject &json)
{
QJsonArray array = json.value("associativecontainerbase").toArray();

View File

@@ -208,17 +208,22 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CCoordinateGeodetic)
double m_x = 0; //!< normal vector
double m_y = 0; //!< normal vector
double m_z = 0; //!< normal vector
BlackMisc::PhysicalQuantities::CLength m_geodeticHeight { 0, BlackMisc::PhysicalQuantities::CLengthUnit::nullUnit() }; //!< height, ellipsoidal or geodetic height
BLACK_METACLASS(CCoordinateGeodetic,
BLACK_METAMEMBER(x),
BLACK_METAMEMBER(y),
BLACK_METAMEMBER(z),
BLACK_METAMEMBER(geodeticHeight)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Geo::CCoordinateGeodetic, (o.m_x, o.m_y, o.m_z, o.m_geodeticHeight))
Q_DECLARE_METATYPE(BlackMisc::Geo::CCoordinateGeodetic)
#endif // guard

View File

@@ -58,12 +58,12 @@ namespace BlackMisc
//! identified by its index. It contains no(!) pyhsical data for the icon itself.
class BLACKMISC_EXPORT CIcon :
public Mixin::MetaType<CIcon>,
public Mixin::HashByTuple<CIcon>,
public Mixin::DBusByTuple<CIcon>,
public Mixin::JsonByTuple<CIcon>,
public Mixin::EqualsByTuple<CIcon>,
public Mixin::LessThanByTuple<CIcon>,
public Mixin::CompareByTuple<CIcon>,
public Mixin::HashByMetaClass<CIcon>,
public Mixin::DBusByMetaClass<CIcon>,
public Mixin::JsonByMetaClass<CIcon>,
public Mixin::EqualsByMetaClass<CIcon>,
public Mixin::LessThanByMetaClass<CIcon>,
public Mixin::CompareByMetaClass<CIcon>,
public Mixin::String<CIcon>,
public Mixin::Icon<CIcon>
{
@@ -126,11 +126,16 @@ namespace BlackMisc
static const CIcon &iconByIndex(int index);
private:
BLACK_ENABLE_TUPLE_CONVERSION(CIcon)
CIcons::IconIndex m_index = CIcons::NotSet;
int m_rotateDegrees = 0; //!< Rotation
QString m_descriptiveText; //!< what does it represent?
QPixmap m_pixmap; //!< Used with generated pixmaps, when not used with index
BLACK_METACLASS(CIcon,
BLACK_METAMEMBER(index),
BLACK_METAMEMBER(rotateDegrees, 0, DisabledForComparison | DisabledForHashing),
BLACK_METAMEMBER(descriptiveText)
);
};
namespace Private
@@ -154,12 +159,6 @@ namespace BlackMisc
}
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CIcon, (
attr(o.m_index),
attr(o.m_rotateDegrees, flags < DisabledForComparison | DisabledForHashing > ()),
attr(o.m_descriptiveText)
))
Q_DECLARE_METATYPE(BlackMisc::CIcon)
#endif // guard

View File

@@ -92,24 +92,23 @@ namespace BlackMisc
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
private:
BLACK_ENABLE_TUPLE_CONVERSION(CIdentifier)
QString m_name; //!< object name
QString m_machineIdBase64; //!< base 64 encoded machine id
QString m_machineName; //!< human readable machine name
QString m_processName; //!< process name
qint64 m_processId; //!< PID
BLACK_METACLASS(CIdentifier,
BLACK_METAMEMBER(name),
BLACK_METAMEMBER(machineIdBase64),
BLACK_METAMEMBER(machineName, 0, DisabledForComparison | DisabledForHashing),
BLACK_METAMEMBER(processName),
BLACK_METAMEMBER(processId),
BLACK_METAMEMBER(timestampMSecsSinceEpoch, 0, DisabledForComparison | DisabledForHashing)
);
};
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CIdentifier, (
attr(o.m_name),
attr(o.m_machineIdBase64),
attr(o.m_machineName, flags <DisabledForComparison | DisabledForHashing> ()),
attr(o.m_processName),
attr(o.m_processId),
attr(o.m_timestampMSecsSinceEpoch, flags <DisabledForComparison | DisabledForHashing> ())
))
Q_DECLARE_METATYPE(BlackMisc::CIdentifier)
#endif // guard

View File

@@ -81,19 +81,19 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CActionHotkey)
CIdentifier m_identifier; //!< Identifier to which machine this hotkey belongs to
CHotkeyCombination m_combination; //!< hotkey combination
QString m_action; //!< hotkey action
BLACK_METACLASS(CActionHotkey,
BLACK_METAMEMBER(identifier),
BLACK_METAMEMBER(combination),
BLACK_METAMEMBER(action)
);
};
}
}
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Input::CActionHotkey, (
attr(o.m_identifier),
attr(o.m_combination),
attr(o.m_action)
))
Q_DECLARE_METATYPE(BlackMisc::Input::CActionHotkey)
#endif // guard

View File

@@ -73,17 +73,17 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CHotkeyCombination)
CKeyboardKeyList m_keyboardKeys;
CJoystickButtonList m_joystickButtons;
BLACK_METACLASS(CHotkeyCombination,
BLACK_METAMEMBER(keyboardKeys),
BLACK_METAMEMBER(joystickButtons)
);
};
}
}
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Input::CHotkeyCombination, (
attr(o.m_keyboardKeys),
attr(o.m_joystickButtons)
))
Q_DECLARE_METATYPE(BlackMisc::Input::CHotkeyCombination)
#endif // guard

View File

@@ -72,15 +72,17 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CJoystickButton)
int m_buttonIndex = m_invalidIndex;
static constexpr int m_invalidIndex = -1;
BLACK_METACLASS(CJoystickButton,
BLACK_METAMEMBER(buttonIndex)
);
};
}
}
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Input::CJoystickButton, (o.m_buttonIndex))
Q_DECLARE_METATYPE(BlackMisc::Input::CJoystickButton)
#endif // guard

View File

@@ -84,13 +84,15 @@ namespace BlackMisc
private:
static const QList<KeyCode> &allModifiers();
BLACK_ENABLE_TUPLE_CONVERSION(CKeyboardKey)
KeyCode m_keyCode; //!< Key code
BLACK_METACLASS(CKeyboardKey,
BLACK_METAMEMBER(keyCode)
);
};
}
}
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Input::CKeyboardKey, (o.m_keyCode))
Q_DECLARE_METATYPE(BlackMisc::Input::CKeyboardKey)
#endif // guard

View File

@@ -345,9 +345,9 @@ namespace BlackMisc
* When a derived class and a base class both inherit from Mixin::JsonByTuple,
* the derived class uses this macro to disambiguate the inherited members.
*/
# define BLACKMISC_DECLARE_USING_MIXIN_JSON(DERIVED) \
using ::BlackMisc::Mixin::JsonByTuple<DERIVED>::toJson; \
using ::BlackMisc::Mixin::JsonByTuple<DERIVED>::convertFromJson;
# define BLACKMISC_DECLARE_USING_MIXIN_JSON(DERIVED) \
using ::BlackMisc::Mixin::JsonByMetaClass<DERIVED>::toJson; \
using ::BlackMisc::Mixin::JsonByMetaClass<DERIVED>::convertFromJson;
} // Mixin
} // BlackMisc

View File

@@ -158,12 +158,14 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CLogCategory)
QString m_string;
BLACK_METACLASS(CLogCategory,
BLACK_METAMEMBER(string)
);
};
}
Q_DECLARE_METATYPE(BlackMisc::CLogCategory)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CLogCategory, (o.m_string))
#endif

View File

@@ -27,8 +27,8 @@ namespace BlackMisc
*/
class BLACKMISC_EXPORT CLogPattern :
public Mixin::MetaType<CLogPattern>,
public Mixin::HashByTuple<CLogPattern>,
public Mixin::EqualsByTuple<CLogPattern>,
public Mixin::HashByMetaClass<CLogPattern>,
public Mixin::EqualsByMetaClass<CLogPattern>,
public Mixin::DBusOperators<CLogPattern>,
public Mixin::Index<CLogPattern>,
public Mixin::String<CLogPattern>,
@@ -87,10 +87,10 @@ namespace BlackMisc
//! \copydoc BlackMisc::Mixin::String::toQString()
QString convertToQString(bool i18n = false) const;
//! \copydoc BlackMisc::Mixin::DBusByTuple::marshallToDbus()
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::marshallToDbus()
void marshallToDbus(QDBusArgument &argument) const;
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus()
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus()
void unmarshallFromDbus(const QDBusArgument &argument);
private:
@@ -110,7 +110,6 @@ namespace BlackMisc
CLogPattern(Strategy strategy, const QSet<QString> &strings);
BLACK_ENABLE_TUPLE_CONVERSION(CLogPattern)
QSet<CStatusMessage::StatusSeverity> m_severities;
Strategy m_strategy;
QSet<QString> m_strings;
@@ -121,14 +120,15 @@ namespace BlackMisc
const QString &getSubstring() const { Q_ASSERT(m_strategy == Contains && m_strings.size() == 1); return *m_strings.begin(); }
static const QHash<QString, CLogPattern> &allHumanReadablePatterns();
BLACK_METACLASS(CLogPattern,
BLACK_METAMEMBER(severities),
BLACK_METAMEMBER(strategy),
BLACK_METAMEMBER(strings)
);
};
}
Q_DECLARE_METATYPE(BlackMisc::CLogPattern)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CLogPattern, (
attr(o.m_severities),
attr(o.m_strategy),
attr(o.m_strings)
))
#endif

View File

@@ -67,14 +67,18 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CNameVariantPair)
QString m_name;
CVariant m_variant;
CIcon m_icon; //!< optional icon
BLACK_METACLASS(CNameVariantPair,
BLACK_METAMEMBER(name),
BLACK_METAMEMBER(variant),
BLACK_METAMEMBER(icon)
);
};
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CNameVariantPair, (o.m_name, o.m_variant, o.m_icon))
Q_DECLARE_METATYPE(BlackMisc::CNameVariantPair)
#endif // guard

View File

@@ -146,8 +146,6 @@ namespace BlackMisc
static CAuthenticatedUser fromDatabaseJson(const QJsonObject &json);
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAuthenticatedUser)
int m_vatsimId;
QString m_realname;
QString m_email;
@@ -156,20 +154,22 @@ namespace BlackMisc
bool m_enabled = false;
bool m_authenticated = false;
CRoleList m_roles;
BLACK_METACLASS(CAuthenticatedUser,
BLACK_METAMEMBER(dbKey),
BLACK_METAMEMBER(vatsimId),
BLACK_METAMEMBER(realname),
BLACK_METAMEMBER(email),
BLACK_METAMEMBER(password),
BLACK_METAMEMBER(country),
BLACK_METAMEMBER(enabled),
BLACK_METAMEMBER(authenticated),
BLACK_METAMEMBER(roles)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Network::CAuthenticatedUser, (
o.m_dbKey,
o.m_vatsimId,
o.m_realname,
o.m_email,
o.m_password,
o.m_country,
o.m_enabled,
o.m_authenticated,
o.m_roles))
Q_DECLARE_METATYPE(BlackMisc::Network::CAuthenticatedUser)
#endif // guard

View File

@@ -130,23 +130,23 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CClient)
BlackMisc::Network::CUser m_user;
BlackMisc::Simulation::CAircraftModel m_model;
BlackMisc::CPropertyIndexVariantMap m_capabilities;
QString m_server;
BlackMisc::Network::CVoiceCapabilities m_voiceCapabilities;
BLACK_METACLASS(CClient,
BLACK_METAMEMBER(user),
BLACK_METAMEMBER(model),
BLACK_METAMEMBER(capabilities, 0, DisabledForComparison | DisabledForJson),
BLACK_METAMEMBER(server),
BLACK_METAMEMBER(voiceCapabilities)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Network::CClient, (
o.m_user,
o.m_model,
attr(o.m_capabilities, flags < DisabledForComparison | DisabledForJson > ()),
o.m_server,
o.m_voiceCapabilities
))
Q_DECLARE_METATYPE(BlackMisc::Network::CClient)
#endif // guard

View File

@@ -67,15 +67,19 @@ namespace BlackMisc
static CRole fromDatabaseJson(const QJsonObject &json);
private:
BLACK_ENABLE_TUPLE_CONVERSION(CRole)
QString m_name;
QString m_description;
BLACK_METACLASS(CRole,
BLACK_METAMEMBER(dbKey),
BLACK_METAMEMBER(name),
BLACK_METAMEMBER(description)
);
};
} // ns
} // ns
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Network::CRole, (o.m_dbKey, o.m_name, o.m_description))
Q_DECLARE_METATYPE(BlackMisc::Network::CRole)
#endif // guard

View File

@@ -107,18 +107,25 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CServer)
QString m_name;
QString m_description;
QString m_address;
int m_port = -1;
CUser m_user;
bool m_isAcceptingConnections = true; //!< temp. disable server
BLACK_METACLASS(CServer,
BLACK_METAMEMBER(name),
BLACK_METAMEMBER(description),
BLACK_METAMEMBER(address),
BLACK_METAMEMBER(port),
BLACK_METAMEMBER(user),
BLACK_METAMEMBER(isAcceptingConnections)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Network::CServer, (o.m_name, o.m_description, o.m_address, o.m_port, o.m_user, o.m_isAcceptingConnections))
Q_DECLARE_METATYPE(BlackMisc::Network::CServer)
#endif // guard

View File

@@ -163,17 +163,23 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CTextMessage)
QString m_message;
BlackMisc::Aviation::CCallsign m_senderCallsign;
BlackMisc::Aviation::CCallsign m_recipientCallsign;
BlackMisc::PhysicalQuantities::CFrequency m_frequency {0, BlackMisc::PhysicalQuantities::CFrequencyUnit::nullUnit()};
bool m_wasSent = false;
BLACK_METACLASS(CTextMessage,
BLACK_METAMEMBER(message),
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(senderCallsign),
BLACK_METAMEMBER(recipientCallsign),
BLACK_METAMEMBER(frequency)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Network::CTextMessage, (o.m_message, o.m_timestampMSecsSinceEpoch, o.m_senderCallsign, o.m_recipientCallsign, o.m_frequency))
Q_DECLARE_METATYPE(BlackMisc::Network::CTextMessage)
#endif // guard

View File

@@ -135,10 +135,10 @@ namespace BlackMisc
//! \copydoc BlackMisc::Mixin::String::toQString()
QString convertToQString(bool i18n = false) const;
//! \copydoc BlackMisc::Mixin::JsonByTuple::toJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::toJson
QJsonObject toJson() const;
//! \copydoc BlackMisc::Mixin::JsonByTuple::convertFromJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::convertFromJson
void convertFromJson(const QJsonObject &json);
//! Protocol to default port
@@ -154,7 +154,6 @@ namespace BlackMisc
operator QUrl() const { return this->toQUrl(); }
private:
BLACK_ENABLE_TUPLE_CONVERSION(CUrl)
QString m_scheme;
QString m_host;
int m_port = -1;
@@ -162,11 +161,18 @@ namespace BlackMisc
QString m_query;
static QString stripQueryString(const QString query);
BLACK_METACLASS(CUrl,
BLACK_METAMEMBER(scheme),
BLACK_METAMEMBER(host),
BLACK_METAMEMBER(port),
BLACK_METAMEMBER(path),
BLACK_METAMEMBER(query)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Network::CUrl, (o.m_scheme, o.m_host, o.m_port, o.m_path, o.m_query))
Q_DECLARE_METATYPE(BlackMisc::Network::CUrl)
#endif // guard

View File

@@ -141,8 +141,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CUser)
//! derive homebase from callsign
void deriveHomeBaseFromCallsign();
@@ -152,11 +150,19 @@ namespace BlackMisc
QString m_password;
BlackMisc::Aviation::CCallsign m_callsign;
BlackMisc::Aviation::CAirportIcaoCode m_homebase;
BLACK_METACLASS(CUser,
BLACK_METAMEMBER(id),
BLACK_METAMEMBER(realname),
BLACK_METAMEMBER(email),
BLACK_METAMEMBER(password),
BLACK_METAMEMBER(callsign),
BLACK_METAMEMBER(homebase)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Network::CUser, (o.m_id, o.m_realname, o.m_email, o.m_password, o.m_callsign, o.m_homebase))
Q_DECLARE_METATYPE(BlackMisc::Network::CUser)
#endif // guard

View File

@@ -69,16 +69,18 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CVoiceCapabilities)
VoiceCapabilities m_voiceCapabilities = Unknown;
//! Capabilites from flight plans remarks such as "/V/"
void setFromFlightPlanRemarks(const QString &flightPlanRemarks);
BLACK_METACLASS(CVoiceCapabilities,
BLACK_METAMEMBER(voiceCapabilities)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Network::CVoiceCapabilities, (o.m_voiceCapabilities))
Q_DECLARE_METATYPE(BlackMisc::Network::CVoiceCapabilities)
#endif // guard

View File

@@ -52,8 +52,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(BlackMisc::CPixmap)
//! Init the byte array with data
void fillByteArray();
@@ -61,12 +59,13 @@ namespace BlackMisc
mutable QPixmap m_pixmap; //!< cached pixmap, mutable because of lazy initialization
mutable bool m_hasCachedPixmap = false; //!< pixmap? Mutable because of lazy initialization
mutable QReadWriteLock m_lock; //!< lock (because of mutable members)
BLACK_METACLASS(CPixmap,
BLACK_METAMEMBER(array)
);
};
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CPixmap, (
attr(o.m_array)
))
Q_DECLARE_METATYPE(BlackMisc::CPixmap)
#endif // guard

View File

@@ -242,13 +242,13 @@ namespace BlackMisc
return this->getSymbol(i18n);
}
//! \copydoc BlackMisc::Mixin::DBusByTuple::marshallToDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::marshallToDbus
void marshallToDbus(QDBusArgument &argument) const
{
argument << this->m_symbol;
}
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &)
{
// the concrete implementations will override this default

View File

@@ -180,22 +180,22 @@ namespace BlackMisc
//! Make value always negative
void makeNegative();
//! \copydoc BlackMisc::Mixin::DBusByTuple::marshallToDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::marshallToDbus
void marshallToDbus(QDBusArgument &argument) const;
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument);
//! \copydoc BlackMisc::Mixin::HashByTuple::qHash
//! \copydoc BlackMisc::Mixin::HashByMetaClass::qHash
uint getValueHash() const;
//! \copydoc CValueObject::qHash
friend uint qHash(const PQ &pq) { return pq.getValueHash(); }
//! \copydoc BlackMisc::Mixin::JsonByTuple::toJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::toJson
QJsonObject toJson() const;
//! \copydoc BlackMisc::Mixin::JsonByTuple::convertFromJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::convertFromJson
void convertFromJson(const QJsonObject &json);
//! Parse to string, with specified separator

View File

@@ -74,14 +74,16 @@ namespace BlackMisc
static double parseNumber(const QString &number, bool &success, SeparatorMode mode = SeparatorsCLocale);
private:
BLACK_ENABLE_TUPLE_CONVERSION(CPqString)
QString m_string;
BLACK_METACLASS(CPqString,
BLACK_METAMEMBER(string)
);
};
}
}
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::PhysicalQuantities::CPqString, (o.m_string))
Q_DECLARE_METATYPE(BlackMisc::PhysicalQuantities::CPqString)
#endif // guard

View File

@@ -143,7 +143,7 @@ namespace BlackMisc
return u;
}
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument)
{
QString unitName;
@@ -242,7 +242,7 @@ namespace BlackMisc
return u;
}
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument)
{
QString unitName;
@@ -332,7 +332,7 @@ namespace BlackMisc
return u;
}
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument)
{
QString unitName;
@@ -431,7 +431,7 @@ namespace BlackMisc
return u;
}
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument)
{
QString unitName;
@@ -547,7 +547,7 @@ namespace BlackMisc
return u;
}
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument)
{
QString unitName;
@@ -638,7 +638,7 @@ namespace BlackMisc
return u;
}
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument)
{
QString unitName;
@@ -747,7 +747,7 @@ namespace BlackMisc
return u;
}
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument)
{
QString unitName;
@@ -880,7 +880,7 @@ namespace BlackMisc
return u;
}
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument)
{
QString unitName;
@@ -954,7 +954,7 @@ namespace BlackMisc
return u;
}
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument)
{
QString unitName;

View File

@@ -29,12 +29,12 @@ namespace BlackMisc
*/
class BLACKMISC_EXPORT CPropertyIndex :
public Mixin::MetaType<CPropertyIndex>,
public Mixin::HashByTuple<CPropertyIndex>,
public Mixin::DBusByTuple<CPropertyIndex>,
public Mixin::JsonByTuple<CPropertyIndex>,
public Mixin::EqualsByTuple<CPropertyIndex>,
public Mixin::LessThanByTuple<CPropertyIndex>,
public Mixin::CompareByTuple<CPropertyIndex>,
public Mixin::HashByMetaClass<CPropertyIndex>,
public Mixin::DBusByMetaClass<CPropertyIndex>,
public Mixin::JsonByMetaClass<CPropertyIndex>,
public Mixin::EqualsByMetaClass<CPropertyIndex>,
public Mixin::LessThanByMetaClass<CPropertyIndex>,
public Mixin::CompareByMetaClass<CPropertyIndex>,
public Mixin::String<CPropertyIndex>
{
// In the first trial I have used CSequence<int> as base class
@@ -169,16 +169,17 @@ namespace BlackMisc
void parseFromString(const QString &indexes);
private:
BLACK_ENABLE_TUPLE_CONVERSION(CPropertyIndex)
QString m_indexString; //! I use a little trick here, the string is used with the tupel system, as it provides all operators, hash ..
//! Convert list to string
void setIndexStringByList(const QList<int> &list);
BLACK_METACLASS(CPropertyIndex,
BLACK_METAMEMBER(indexString)
);
};
} //namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CPropertyIndex, (o.m_indexString))
Q_DECLARE_METATYPE(BlackMisc::CPropertyIndex)
#endif //guard

View File

@@ -191,10 +191,10 @@ namespace BlackMisc
bool m_wildcard; //!< wildcard
public:
//! \copydoc BlackMisc::Mixin::DBusByTuple::marshallToDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::marshallToDbus
void marshallToDbus(QDBusArgument &argument) const;
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument);
};

View File

@@ -110,7 +110,6 @@ namespace BlackMisc
int comparePropertyByIndex(const CRgbColor &compareValue, const CPropertyIndex &index) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CRgbColor)
int m_r = -1;
int m_g = -1;
int m_b = -1;
@@ -119,14 +118,15 @@ namespace BlackMisc
double colorRange() const;
static QString intToHex(int h, int digits = 2);
BLACK_METACLASS(CRgbColor,
BLACK_METAMEMBER(r),
BLACK_METAMEMBER(g),
BLACK_METAMEMBER(b)
);
};
} // namespace
Q_DECLARE_METATYPE(BlackMisc::CRgbColor)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CRgbColor, (
attr(o.m_r),
attr(o.m_g),
attr(o.m_b)
))
#endif // guard

View File

@@ -288,7 +288,6 @@ namespace BlackMisc
static CAircraftModel fromDatabaseJson(const QJsonObject &json, const QString prefix = QString("mod_"));
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftModel)
BlackMisc::Aviation::CCallsign m_callsign; //!< aircraft's callsign if any
BlackMisc::Aviation::CAircraftIcaoCode m_aircraftIcao; //!< ICAO code if available
BlackMisc::Aviation::CLivery m_livery; //!< livery information
@@ -300,27 +299,26 @@ namespace BlackMisc
QString m_fileName; //!< file name
ModelType m_modelType = TypeUnknown; //!< model string is coming representing ...?
ModelMode m_modelMode = Include; //!< model mode (include / exclude)
BLACK_METACLASS(CAircraftModel,
BLACK_METAMEMBER(dbKey),
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(callsign),
BLACK_METAMEMBER(aircraftIcao),
BLACK_METAMEMBER(livery),
BLACK_METAMEMBER(simulator),
BLACK_METAMEMBER(distributor),
BLACK_METAMEMBER(modelString, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(name),
BLACK_METAMEMBER(description, 0, DisabledForComparison),
BLACK_METAMEMBER(fileName, 0, DisabledForComparison),
BLACK_METAMEMBER(modelType),
BLACK_METAMEMBER(modelMode)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(
BlackMisc::Simulation::CAircraftModel, (
attr(o.m_dbKey),
attr(o.m_timestampMSecsSinceEpoch),
attr(o.m_callsign),
attr(o.m_aircraftIcao),
attr(o.m_livery),
attr(o.m_simulator),
attr(o.m_distributor),
attr(o.m_modelString, flags<CaseInsensitiveComparison>()),
attr(o.m_name),
attr(o.m_description, flags<DisabledForComparison>()),
attr(o.m_fileName, flags <DisabledForComparison> ()),
attr(o.m_modelType),
attr(o.m_modelMode)
))
Q_DECLARE_METATYPE(BlackMisc::Simulation::CAircraftModel)
Q_DECLARE_METATYPE(BlackMisc::Simulation::CAircraftModel::ModelType)
Q_DECLARE_METATYPE(BlackMisc::Simulation::CAircraftModel::ModelMode)

View File

@@ -88,7 +88,6 @@ namespace BlackMisc
const QString &generatingThreadName() const { return m_threadName; }
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAirspaceAircraftSnapshot)
qint64 m_timestampMsSinceEpoch = -1;
bool m_restricted = false;
bool m_renderingEnabled = true;
@@ -103,19 +102,19 @@ namespace BlackMisc
BlackMisc::Aviation::CCallsignSet m_vtolAircraftCallsignsByDistance;
BlackMisc::Aviation::CCallsignSet m_enabledVtolAircraftCallsignsByDistance;
BLACK_METACLASS(CAirspaceAircraftSnapshot,
BLACK_METAMEMBER(timestampMsSinceEpoch),
BLACK_METAMEMBER(aircraftCallsignsByDistance, 0, DisabledForComparison),
BLACK_METAMEMBER(enabledAircraftCallsignsByDistance, 0, DisabledForComparison),
BLACK_METAMEMBER(disabledAircraftCallsignsByDistance, 0, DisabledForComparison),
BLACK_METAMEMBER(vtolAircraftCallsignsByDistance, 0, DisabledForComparison),
BLACK_METAMEMBER(enabledVtolAircraftCallsignsByDistance, 0, DisabledForComparison)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(
BlackMisc::Simulation::CAirspaceAircraftSnapshot, (
attr(o.m_timestampMsSinceEpoch),
attr(o.m_aircraftCallsignsByDistance, flags<DisabledForComparison>()),
attr(o.m_enabledAircraftCallsignsByDistance, flags <DisabledForComparison> ()),
attr(o.m_disabledAircraftCallsignsByDistance, flags<DisabledForComparison>()),
attr(o.m_vtolAircraftCallsignsByDistance, flags <DisabledForComparison> ()),
attr(o.m_enabledVtolAircraftCallsignsByDistance, flags<DisabledForComparison>())
))
Q_DECLARE_METATYPE(BlackMisc::Simulation::CAirspaceAircraftSnapshot)
#endif

View File

@@ -103,22 +103,22 @@ namespace BlackMisc
static CDistributor fromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
private:
BLACK_ENABLE_TUPLE_CONVERSION(CDistributor)
QString m_description; //!< description
QString m_alias1; //!< alias name
QString m_alias2; //!< alias name
BLACK_METACLASS(CDistributor,
BLACK_METAMEMBER(dbKey, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(description),
BLACK_METAMEMBER(alias1, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(alias2, 0, CaseInsensitiveComparison)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Simulation::CDistributor)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::CDistributor, (
attr(o.m_dbKey, flags <CaseInsensitiveComparison> ()),
attr(o.m_timestampMSecsSinceEpoch),
attr(o.m_description),
attr(o.m_alias1, flags <CaseInsensitiveComparison> ()),
attr(o.m_alias2, flags <CaseInsensitiveComparison> ())
))
#endif // guard

View File

@@ -157,7 +157,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftCfgEntries)
int m_index; //!< current index in given config
QString m_fileName; //!< file name of .cfg
QString m_title; //!< Title in .cfg
@@ -172,12 +171,20 @@ namespace BlackMisc
QString m_simName; //!< name in simulator
QString m_createdBy; //!< created by, "distributor"
bool m_rotorcraft = false; //!< hint if rotorcraft
BLACK_METACLASS(CAircraftCfgEntries,
BLACK_METAMEMBER(index),
BLACK_METAMEMBER(fileName),
BLACK_METAMEMBER(title),
BLACK_METAMEMBER(atcType),
BLACK_METAMEMBER(atcModel),
BLACK_METAMEMBER(atcParkingCode)
);
};
} // ns
} // ns
} // ns
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::FsCommon::CAircraftCfgEntries, (o.m_index, o.m_fileName, o.m_title, o.m_atcType, o.m_atcModel, o.m_atcParkingCode))
Q_DECLARE_METATYPE(BlackMisc::Simulation::FsCommon::CAircraftCfgEntries)
#endif // guard

View File

@@ -86,12 +86,19 @@ namespace BlackMisc
CAircraftModel toAircraftModel() const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CVPilotModelRule)
QString m_modelName; //!< model name
QString m_folder; //!< folder
QString m_typeCode; //!< type code, aka aircraft ICAO
QString m_callsignPrefix; //!< callsign prefix, aka airline ICAO
qint64 m_updatedMsSinceEpoch; //!< updated when
BLACK_METACLASS(CVPilotModelRule,
BLACK_METAMEMBER(typeCode, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(callsignPrefix, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(modelName, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(folder, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(updatedMsSinceEpoch)
);
};
} // namespace
@@ -99,11 +106,5 @@ namespace BlackMisc
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Simulation::FsCommon::CVPilotModelRule)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::FsCommon::CVPilotModelRule, (
attr(o.m_typeCode, flags <CaseInsensitiveComparison> ()),
attr(o.m_callsignPrefix, flags <CaseInsensitiveComparison> ()),
attr(o.m_modelName, flags <CaseInsensitiveComparison> ()),
attr(o.m_folder, flags <CaseInsensitiveComparison> ()),
attr(o.m_updatedMsSinceEpoch)
))
#endif // guard

View File

@@ -358,7 +358,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CSimulatedAircraft)
BlackMisc::Aviation::CCallsign m_callsign;
BlackMisc::Network::CUser m_pilot;
BlackMisc::Aviation::CAircraftSituation m_situation;
@@ -377,27 +376,27 @@ namespace BlackMisc
//! Init, which syncronizes some denormalized values
void init();
BLACK_METACLASS(CSimulatedAircraft,
BLACK_METAMEMBER(callsign),
BLACK_METAMEMBER(pilot),
BLACK_METAMEMBER(situation),
BLACK_METAMEMBER(com1system),
BLACK_METAMEMBER(com2system),
BLACK_METAMEMBER(transponder),
BLACK_METAMEMBER(parts),
BLACK_METAMEMBER(livery),
BLACK_METAMEMBER(distanceToOwnAircraft),
BLACK_METAMEMBER(bearingToOwnAircraft),
BLACK_METAMEMBER(model),
BLACK_METAMEMBER(enabled),
BLACK_METAMEMBER(rendered),
BLACK_METAMEMBER(partsSynchronized),
BLACK_METAMEMBER(fastPositionUpdates)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::CSimulatedAircraft, (
attr(o.m_callsign),
attr(o.m_pilot),
attr(o.m_situation),
attr(o.m_com1system),
attr(o.m_com2system),
attr(o.m_transponder),
attr(o.m_parts),
attr(o.m_livery),
attr(o.m_distanceToOwnAircraft),
attr(o.m_bearingToOwnAircraft),
attr(o.m_model),
attr(o.m_enabled),
attr(o.m_rendered),
attr(o.m_partsSynchronized),
attr(o.m_fastPositionUpdates)
))
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatedAircraft)
#endif // guard

View File

@@ -138,8 +138,11 @@ namespace BlackMisc
static const CSimulatorInfo getLocallyInstalledSimulators();
private:
BLACK_ENABLE_TUPLE_CONVERSION(CSimulatorInfo)
int m_simulator = static_cast<int>(None);
BLACK_METACLASS(CSimulatorInfo,
BLACK_METAMEMBER(simulator)
);
};
//! Count per simulator, small utility class allows to retrieve values as per simulator
@@ -181,7 +184,6 @@ namespace BlackMisc
} // ns
} // ns
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::CSimulatorInfo, (attr(o.m_simulator)))
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatorInfo)
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatorInfo::SimulatorFlag)
Q_DECLARE_OPERATORS_FOR_FLAGS(BlackMisc::Simulation::CSimulatorInfo::Simulator)

View File

@@ -60,23 +60,23 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CSimulatorPluginInfo)
QString m_identifier;
QString m_name;
QString m_simulator;
QString m_description;
bool m_valid { false };
BLACK_METACLASS(CSimulatorPluginInfo,
BLACK_METAMEMBER(identifier, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(name, 0, DisabledForComparison | DisabledForHashing),
BLACK_METAMEMBER(simulator, 0, DisabledForComparison | DisabledForHashing),
BLACK_METAMEMBER(description, 0, DisabledForComparison | DisabledForHashing),
BLACK_METAMEMBER(valid, 0, DisabledForComparison | DisabledForHashing)
);
};
} // ns
} // ns
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::CSimulatorPluginInfo, (
attr(o.m_identifier, flags <CaseInsensitiveComparison> ()),
attr(o.m_name, flags < DisabledForComparison | DisabledForHashing > ()),
attr(o.m_simulator, flags < DisabledForComparison | DisabledForHashing > ()),
attr(o.m_description, flags < DisabledForComparison | DisabledForHashing > ()),
attr(o.m_valid, flags < DisabledForComparison | DisabledForHashing > ())
))
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatorPluginInfo)
#endif // guard

View File

@@ -72,14 +72,15 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CSimulatorSetup)
BlackMisc::CNameVariantPairList m_data;
BLACK_METACLASS(CSimulatorSetup,
BLACK_METAMEMBER(data)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::CSimulatorSetup, (o.m_data))
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatorSetup)
#endif // guard

View File

@@ -56,9 +56,13 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CNavDataReference)
int m_id = 0;
Geo::CCoordinateGeodetic m_position;
BLACK_METACLASS(CNavDataReference,
BLACK_METAMEMBER(id),
BLACK_METAMEMBER(position)
);
};
/*!
@@ -87,9 +91,4 @@ Q_DECLARE_METATYPE(BlackMisc::Simulation::XPlane::CNavDataReferenceList)
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::Simulation::XPlane::CNavDataReference>)
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::Simulation::XPlane::CNavDataReference>)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::XPlane::CNavDataReference, (
attr(o.m_id),
attr(o.m_position)
))
#endif

View File

@@ -307,20 +307,20 @@ namespace BlackMisc
static void registerMetadata();
private:
BLACK_ENABLE_TUPLE_CONVERSION(CStatusMessage)
mutable QVector<quintptr> m_handledByObjects;
mutable QReadWriteLock m_lock; //!< lock (because of mutable members)
BLACK_METACLASS(CStatusMessage,
BLACK_METAMEMBER(categories),
BLACK_METAMEMBER(severity),
BLACK_METAMEMBER(message),
BLACK_METAMEMBER(args),
BLACK_METAMEMBER(timestampMSecsSinceEpoch)
);
};
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CStatusMessage, (
o.m_categories,
o.m_severity,
o.m_message,
o.m_args,
o.m_timestampMSecsSinceEpoch
))
Q_DECLARE_METATYPE(BlackMisc::CStatusMessage)
Q_DECLARE_METATYPE(BlackMisc::CStatusMessage::StatusSeverity)

View File

@@ -24,8 +24,8 @@ namespace BlackMisc
class BLACKMISC_EXPORT CValueCachePacket :
public CDictionary<QString, std::pair<CVariant, qint64>, QMap>,
public Mixin::MetaType<CValueCachePacket>,
public Mixin::DBusByTuple<CValueCachePacket>,
public Mixin::EqualsByTuple<CValueCachePacket>
public Mixin::DBusByMetaClass<CValueCachePacket>,
public Mixin::EqualsByMetaClass<CValueCachePacket>
{
public:
BLACKMISC_DECLARE_USING_MIXIN_DBUS(CValueCachePacket)
@@ -88,8 +88,11 @@ namespace BlackMisc
//! @}
private:
BLACK_ENABLE_TUPLE_CONVERSION(CValueCachePacket)
bool m_saved = false;
BLACK_METACLASS(CValueCachePacket,
BLACK_METAMEMBER(saved)
);
};
/*!
@@ -364,6 +367,5 @@ namespace BlackMisc
} // namespace
Q_DECLARE_METATYPE(BlackMisc::CValueCachePacket)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CValueCachePacket, (attr(o.m_saved)))
#endif

View File

@@ -71,12 +71,12 @@ namespace BlackMisc
template <class Derived, class Base /*= CEmpty*/> class CValueObject :
public Base,
public Mixin::MetaType<Derived>,
public Mixin::HashByTuple<Derived>,
public Mixin::DBusByTuple<Derived>,
public Mixin::JsonByTuple<Derived>,
public Mixin::EqualsByTuple<Derived>,
public Mixin::LessThanByTuple<Derived>,
public Mixin::CompareByTuple<Derived>,
public Mixin::HashByMetaClass<Derived>,
public Mixin::DBusByMetaClass<Derived>,
public Mixin::JsonByMetaClass<Derived>,
public Mixin::EqualsByMetaClass<Derived>,
public Mixin::LessThanByMetaClass<Derived>,
public Mixin::CompareByMetaClass<Derived>,
public Mixin::String<Derived>,
public Mixin::Index<Derived>,
public Mixin::Icon<Derived>
@@ -97,14 +97,14 @@ namespace BlackMisc
//! \copydoc BlackMisc::Mixin::Index::apply
using Mixin::Index<Derived>::apply;
//! \copydoc BlackMisc::Mixin::JsonByTuple::toJson
using Mixin::JsonByTuple<Derived>::toJson;
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::toJson
using Mixin::JsonByMetaClass<Derived>::toJson;
//! \copydoc BlackMisc::Mixin::JsonByTuple::toJsonString
using Mixin::JsonByTuple<Derived>::toJsonString;
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::toJsonString
using Mixin::JsonByMetaClass<Derived>::toJsonString;
//! \copydoc BlackMisc::Mixin::JsonByTuple::convertFromJson
using Mixin::JsonByTuple<Derived>::convertFromJson;
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::convertFromJson
using Mixin::JsonByMetaClass<Derived>::convertFromJson;
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
using Mixin::Index<Derived>::setPropertyByIndex;
@@ -153,11 +153,11 @@ namespace BlackMisc
//! \copydoc BlackMisc::Mixin::String::stringForStreaming
using Mixin::String<Derived>::stringForStreaming;
//! \copydoc BlackMisc::Mixin::DBusByTuple::marshallToDbus
using Mixin::DBusByTuple<Derived>::marshallToDbus;
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::marshallToDbus
using Mixin::DBusByMetaClass<Derived>::marshallToDbus;
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
using Mixin::DBusByTuple<Derived>::unmarshallFromDbus;
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
using Mixin::DBusByMetaClass<Derived>::unmarshallFromDbus;
};
} // namespace

View File

@@ -266,16 +266,16 @@ namespace BlackMisc
//! Return the metatype ID of the value in this variant.
int userType() const { return m_v.userType(); }
//! \copydoc BlackMisc::Mixin::JsonByTuple::toJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::toJson
QJsonObject toJson() const;
//! \copydoc BlackMisc::Mixin::JsonByTuple::convertFromJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::convertFromJson
void convertFromJson(const QJsonObject &json);
//! \copydoc BlackMisc::Mixin::DBusByTuple::marshallToDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::marshallToDbus
void marshallToDbus(QDBusArgument &argument) const;
//! \copydoc BlackMisc::Mixin::DBusByTuple::unmarshallFromDbus
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument);
//! \copydoc CValueObject::compare

View File

@@ -131,7 +131,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CCloudLayer)
BlackMisc::Aviation::CAltitude m_base;
BlackMisc::Aviation::CAltitude m_top;
int m_precipitationRate = 0;
@@ -139,20 +138,21 @@ namespace BlackMisc
Clouds m_clouds = NoClouds;
Coverage m_coverage;
int m_coveragePercent;
BLACK_METACLASS(CCloudLayer,
BLACK_METAMEMBER(base),
BLACK_METAMEMBER(top),
BLACK_METAMEMBER(precipitationRate),
BLACK_METAMEMBER(precipitation),
BLACK_METAMEMBER(clouds),
BLACK_METAMEMBER(coverage),
BLACK_METAMEMBER(coveragePercent)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Weather::CCloudLayer)
Q_DECLARE_METATYPE(BlackMisc::Weather::CCloudLayer::Coverage)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CCloudLayer, (
attr(o.m_base),
attr(o.m_top),
attr(o.m_precipitationRate),
attr(o.m_precipitation),
attr(o.m_clouds),
attr(o.m_coverage),
attr(o.m_coveragePercent)
))
#endif // guard

View File

@@ -98,7 +98,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CGridPoint)
Geo::CLatitude m_latitude;
Geo::CLongitude m_longitude;
CCloudLayerList m_cloudLayers;
@@ -106,18 +105,18 @@ namespace BlackMisc
CVisibilityLayerList m_visibilityLayers;
CWindLayerList m_windLayers;
BLACK_METACLASS(CGridPoint,
BLACK_METAMEMBER(latitude),
BLACK_METAMEMBER(longitude),
BLACK_METAMEMBER(cloudLayers),
BLACK_METAMEMBER(temperatureLayers),
BLACK_METAMEMBER(visibilityLayers),
BLACK_METAMEMBER(windLayers)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Weather::CGridPoint)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CGridPoint, (
attr(o.m_latitude),
attr(o.m_longitude),
attr(o.m_cloudLayers),
attr(o.m_temperatureLayers),
attr(o.m_visibilityLayers),
attr(o.m_windLayers)
))
#endif // guard

View File

@@ -140,7 +140,6 @@ namespace BlackMisc
static CMetar CAVOK();
private:
BLACK_ENABLE_TUPLE_CONVERSION(CMetar)
QString m_metarMessage;
ReportType m_reportType = METAR;
BlackMisc::Aviation::CAirportIcaoCode m_airport;
@@ -154,25 +153,26 @@ namespace BlackMisc
PhysicalQuantities::CTemperature m_temperature;
PhysicalQuantities::CTemperature m_dewPoint;
PhysicalQuantities::CPressure m_altimeter;
BLACK_METACLASS(CMetar,
BLACK_METAMEMBER(metarMessage),
BLACK_METAMEMBER(reportType),
BLACK_METAMEMBER(airport),
BLACK_METAMEMBER(reportDay),
BLACK_METAMEMBER(reportTime),
BLACK_METAMEMBER(isAutomated),
BLACK_METAMEMBER(windLayer),
BLACK_METAMEMBER(visibility),
BLACK_METAMEMBER(presentWeathers),
BLACK_METAMEMBER(cloudLayers),
BLACK_METAMEMBER(temperature),
BLACK_METAMEMBER(dewPoint),
BLACK_METAMEMBER(altimeter)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Weather::CMetar)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CMetar, (
attr(o.m_metarMessage),
attr(o.m_reportType),
attr(o.m_airport),
attr(o.m_reportDay),
attr(o.m_reportTime),
attr(o.m_isAutomated),
attr(o.m_windLayer),
attr(o.m_visibility),
attr(o.m_presentWeathers),
attr(o.m_cloudLayers),
attr(o.m_temperature),
attr(o.m_dewPoint),
attr(o.m_altimeter)
))
#endif // guard

View File

@@ -124,10 +124,15 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CPresentWeather)
Intensity m_intensity = Moderate;
Descriptor m_descriptor = None;
int m_weatherPhenomena;
BLACK_METACLASS(CPresentWeather,
BLACK_METAMEMBER(intensity),
BLACK_METAMEMBER(descriptor),
BLACK_METAMEMBER(weatherPhenomena)
);
};
} // namespace
@@ -136,10 +141,5 @@ namespace BlackMisc
Q_DECLARE_METATYPE(BlackMisc::Weather::CPresentWeather)
Q_DECLARE_METATYPE(BlackMisc::Weather::CPresentWeather::Intensity)
Q_DECLARE_METATYPE(BlackMisc::Weather::CPresentWeather::Descriptor)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CPresentWeather, (
attr(o.m_intensity),
attr(o.m_descriptor),
attr(o.m_weatherPhenomena)
))
#endif // guard

View File

@@ -80,21 +80,21 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CTemperatureLayer)
BlackMisc::Aviation::CAltitude m_level;
PhysicalQuantities::CTemperature m_temperature;
PhysicalQuantities::CTemperature m_dewPoint;
double m_relativeHumidity = 0;
BLACK_METACLASS(CTemperatureLayer,
BLACK_METAMEMBER(level),
BLACK_METAMEMBER(temperature),
BLACK_METAMEMBER(dewPoint),
BLACK_METAMEMBER(relativeHumidity)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Weather::CTemperatureLayer)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CTemperatureLayer, (
attr(o.m_level),
attr(o.m_temperature),
attr(o.m_dewPoint),
attr(o.m_relativeHumidity)
))
#endif // guard

View File

@@ -72,20 +72,20 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CVisibilityLayer)
BlackMisc::Aviation::CAltitude m_base;
BlackMisc::Aviation::CAltitude m_top;
PhysicalQuantities::CLength m_visibility;
BLACK_METACLASS(CVisibilityLayer,
BLACK_METAMEMBER(base),
BLACK_METAMEMBER(top),
BLACK_METAMEMBER(visibility)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Weather::CVisibilityLayer)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CVisibilityLayer, (
attr(o.m_base),
attr(o.m_top),
attr(o.m_visibility)
))
#endif // guard

View File

@@ -52,21 +52,21 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CWeatherDataPluginInfo)
QString m_identifier;
QString m_name;
QString m_description;
bool m_valid { false };
BLACK_METACLASS(CWeatherDataPluginInfo,
BLACK_METAMEMBER(identifier, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(name, 0, DisabledForComparison | DisabledForHashing),
BLACK_METAMEMBER(description, 0, DisabledForComparison | DisabledForHashing),
BLACK_METAMEMBER(valid, 0, DisabledForComparison | DisabledForHashing)
);
};
} // ns
} // ns
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CWeatherDataPluginInfo, (
attr(o.m_identifier, flags <CaseInsensitiveComparison> ()),
attr(o.m_name, flags < DisabledForComparison | DisabledForHashing > ()),
attr(o.m_description, flags < DisabledForComparison | DisabledForHashing > ()),
attr(o.m_valid, flags < DisabledForComparison | DisabledForHashing > ())
))
Q_DECLARE_METATYPE(BlackMisc::Weather::CWeatherDataPluginInfo)
#endif // guard

View File

@@ -109,7 +109,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CWindLayer)
BlackMisc::Aviation::CAltitude m_level;
PhysicalQuantities::CAngle m_directionMain;
PhysicalQuantities::CAngle m_directionFrom;
@@ -118,20 +117,20 @@ namespace BlackMisc
PhysicalQuantities::CSpeed m_speed;
PhysicalQuantities::CSpeed m_gustSpeed;
BLACK_METACLASS(CWindLayer,
BLACK_METAMEMBER(level),
BLACK_METAMEMBER(directionMain),
BLACK_METAMEMBER(directionFrom),
BLACK_METAMEMBER(directionTo),
BLACK_METAMEMBER(directionVariable),
BLACK_METAMEMBER(speed),
BLACK_METAMEMBER(gustSpeed)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Weather::CWindLayer)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CWindLayer, (
attr(o.m_level),
attr(o.m_directionMain),
attr(o.m_directionFrom),
attr(o.m_directionTo),
attr(o.m_directionVariable),
attr(o.m_speed),
attr(o.m_gustSpeed)
))
#endif // guard

View File

@@ -65,9 +65,13 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CTestValueObject)
QString m_name;
QString m_description;
BLACK_METACLASS(CTestValueObject,
BLACK_METAMEMBER(name),
BLACK_METAMEMBER(description)
);
};
//! \cond NO_DOXYGEN
@@ -85,7 +89,6 @@ namespace BlackMisc
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CTestValueObject, (o.m_name, o.m_description))
Q_DECLARE_METATYPE(BlackMisc::CTestValueObject)
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::CTestValueObject>)
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::CTestValueObject>)