mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-22 13:15:39 +08:00
refs #413 All value classes which had custom policies shall inherit from mixins instead.
This commit is contained in:
@@ -113,17 +113,17 @@ namespace BlackMisc
|
||||
|
||||
template <class LATorLON>
|
||||
CEarthAngle<LATorLON>::CEarthAngle()
|
||||
: CEarthAngle::CValueObject(0.0, BlackMisc::PhysicalQuantities::CAngleUnit::deg())
|
||||
: PhysicalQuantities::CAngle(0.0, BlackMisc::PhysicalQuantities::CAngleUnit::deg())
|
||||
{ }
|
||||
|
||||
template <class LATorLON>
|
||||
CEarthAngle<LATorLON>::CEarthAngle(double value, const BlackMisc::PhysicalQuantities::CAngleUnit &unit)
|
||||
: CEarthAngle::CValueObject(value, unit)
|
||||
: PhysicalQuantities::CAngle(value, unit)
|
||||
{ }
|
||||
|
||||
template <class LATorLON>
|
||||
CEarthAngle<LATorLON>::CEarthAngle(const BlackMisc::PhysicalQuantities::CAngle &angle)
|
||||
: CEarthAngle::CValueObject(angle)
|
||||
: PhysicalQuantities::CAngle(angle)
|
||||
{ }
|
||||
|
||||
template <class LATorLON>
|
||||
|
||||
@@ -16,14 +16,6 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Geo { template <class> class CEarthAngle; }
|
||||
|
||||
//! \private
|
||||
template <class LATorLON> struct CValueObjectPolicy<Geo::CEarthAngle<LATorLON>> : public CValueObjectPolicy<>
|
||||
{
|
||||
using MetaType = Policy::MetaType::None;
|
||||
};
|
||||
|
||||
namespace Geo
|
||||
{
|
||||
|
||||
@@ -33,7 +25,7 @@ namespace BlackMisc
|
||||
/*!
|
||||
* Base class for latitude / longitude
|
||||
*/
|
||||
template <class LATorLON> class CEarthAngle : public CValueObject<CEarthAngle<LATorLON>, PhysicalQuantities::CAngle>
|
||||
template <class LATorLON> class CEarthAngle : public PhysicalQuantities::CAngle
|
||||
{
|
||||
public:
|
||||
//! Plus operator +=
|
||||
|
||||
@@ -18,20 +18,32 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
//! \private
|
||||
template <> struct CValueObjectPolicy<Geo::CLatitude> : public CValueObjectPolicy<>
|
||||
{
|
||||
using MetaType = Policy::MetaType::Default;
|
||||
};
|
||||
|
||||
namespace Geo
|
||||
{
|
||||
|
||||
//! Latitude
|
||||
class BLACKMISC_EXPORT CLatitude : public CValueObject<CLatitude, CEarthAngle<CLatitude>>
|
||||
class BLACKMISC_EXPORT CLatitude :
|
||||
public CEarthAngle<CLatitude>,
|
||||
public Mixin::MetaType<CLatitude>,
|
||||
public Mixin::String<CLatitude>,
|
||||
public Mixin::DBusOperators<CLatitude>
|
||||
{
|
||||
public:
|
||||
//! Base type
|
||||
using base_type = CEarthAngle<CLatitude>;
|
||||
|
||||
using Mixin::MetaType<CLatitude>::registerMetadata;
|
||||
using Mixin::MetaType<CLatitude>::getMetaTypeId;
|
||||
using Mixin::MetaType<CLatitude>::isA;
|
||||
using Mixin::MetaType<CLatitude>::toCVariant;
|
||||
using Mixin::MetaType<CLatitude>::toQVariant;
|
||||
using Mixin::MetaType<CLatitude>::convertFromCVariant;
|
||||
using Mixin::MetaType<CLatitude>::convertFromQVariant;
|
||||
using Mixin::String<CLatitude>::toQString;
|
||||
using Mixin::String<CLatitude>::toFormattedQString;
|
||||
using Mixin::String<CLatitude>::toStdString;
|
||||
using Mixin::String<CLatitude>::stringForStreaming;
|
||||
|
||||
//! \copydoc CValueObject::convertToQString
|
||||
QString convertToQString(bool i18n = false) const
|
||||
{
|
||||
@@ -47,10 +59,10 @@ namespace BlackMisc
|
||||
CLatitude() = default;
|
||||
|
||||
//! Constructor
|
||||
explicit CLatitude(const BlackMisc::PhysicalQuantities::CAngle &angle) : CValueObject(angle) {}
|
||||
explicit CLatitude(const BlackMisc::PhysicalQuantities::CAngle &angle) : CEarthAngle(angle) {}
|
||||
|
||||
//! Init by double value
|
||||
CLatitude(double value, const BlackMisc::PhysicalQuantities::CAngleUnit &unit) : CValueObject(value, unit) {}
|
||||
CLatitude(double value, const BlackMisc::PhysicalQuantities::CAngleUnit &unit) : CEarthAngle(value, unit) {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -17,20 +17,32 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
//! \private
|
||||
template <> struct CValueObjectPolicy<Geo::CLongitude> : public CValueObjectPolicy<>
|
||||
{
|
||||
using MetaType = Policy::MetaType::Default;
|
||||
};
|
||||
|
||||
namespace Geo
|
||||
{
|
||||
|
||||
//! Longitude
|
||||
class BLACKMISC_EXPORT CLongitude : public CValueObject<CLongitude, CEarthAngle<CLongitude>>
|
||||
class BLACKMISC_EXPORT CLongitude :
|
||||
public CEarthAngle<CLongitude>,
|
||||
public Mixin::MetaType<CLongitude>,
|
||||
public Mixin::String<CLongitude>,
|
||||
public Mixin::DBusOperators<CLongitude>
|
||||
{
|
||||
public:
|
||||
//! Base type
|
||||
using base_type = CEarthAngle<CLongitude>;
|
||||
|
||||
using Mixin::MetaType<CLongitude>::registerMetadata;
|
||||
using Mixin::MetaType<CLongitude>::getMetaTypeId;
|
||||
using Mixin::MetaType<CLongitude>::isA;
|
||||
using Mixin::MetaType<CLongitude>::toCVariant;
|
||||
using Mixin::MetaType<CLongitude>::toQVariant;
|
||||
using Mixin::MetaType<CLongitude>::convertFromCVariant;
|
||||
using Mixin::MetaType<CLongitude>::convertFromQVariant;
|
||||
using Mixin::String<CLongitude>::toQString;
|
||||
using Mixin::String<CLongitude>::toFormattedQString;
|
||||
using Mixin::String<CLongitude>::toStdString;
|
||||
using Mixin::String<CLongitude>::stringForStreaming;
|
||||
|
||||
//! \copydoc CValueObject::convertToQString
|
||||
QString convertToQString(bool i18n = false) const
|
||||
{
|
||||
@@ -44,10 +56,10 @@ namespace BlackMisc
|
||||
CLongitude() = default;
|
||||
|
||||
//! Constructor
|
||||
explicit CLongitude(const BlackMisc::PhysicalQuantities::CAngle &angle) : CValueObject(angle) {}
|
||||
explicit CLongitude(const BlackMisc::PhysicalQuantities::CAngle &angle) : CEarthAngle(angle) {}
|
||||
|
||||
//! Init by double value
|
||||
CLongitude(double value, const BlackMisc::PhysicalQuantities::CAngleUnit &unit) : CValueObject(value, unit) {}
|
||||
CLongitude(double value, const BlackMisc::PhysicalQuantities::CAngleUnit &unit) : CEarthAngle(value, unit) {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user