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

@@ -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