Issue #77 Move QPair typedefs to their corresponding value type headers

This commit is contained in:
Mat Sutcliffe
2020-08-28 18:01:48 +01:00
parent 0e33a6991f
commit 515dc7fef1
7 changed files with 15 additions and 44 deletions

View File

@@ -15,7 +15,6 @@
#include "altitude.h"
#include "blackmisc/pq/angle.h"
#include "blackmisc/pq/speed.h"
#include "blackmisc/pair.h"
#include "blackmisc/metaclass.h"
#include "blackmisc/timestampbased.h"
#include "blackmisc/valueobject.h"

View File

@@ -19,7 +19,6 @@
#include "blackmisc/collection.h"
#include "blackmisc/sequence.h"
#include "blackmisc/timestampobjectlist.h"
#include "blackmisc/pair.h"
#include "blackmisc/variant.h"
#include <QMetaType>

View File

@@ -27,6 +27,7 @@
#include "blackmisc/mixin/mixinmetatype.h"
#include "blackmisc/blackmiscexport.h"
#include <QPair>
#include <QMetaType>
#include <QString>
#include <QRegularExpression>
@@ -239,11 +240,14 @@ namespace BlackMisc
BLACK_METAMEMBER(altitudeType)
);
};
using CAltitudePair = QPair<CAltitude, CAltitude>; //!< Pair of altitude
} // ns
} // ns
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAltitude)
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAltitude::ReferenceDatum)
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAltitude::AltitudeType)
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAltitudePair)
#endif // guard

View File

@@ -1,42 +0,0 @@
/* Copyright (C) 2018
* Swift Project Community / Contributors
*
* This file is part of Swift Project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated,
* or distributed except according to the terms contained in the LICENSE file.
*/
//! \file
#ifndef BLACKMISC_PAIR_H
#define BLACKMISC_PAIR_H
#include "blackmisc/aviation/altitude.h"
#include "blackmisc/pq/angle.h"
#include "blackmisc/pq/length.h"
#include "blackmisc/pq/speed.h"
#include "blackmisc/variant.h"
#include <QPair>
#include <QDBusMetaType>
namespace BlackMisc
{
namespace PhysicalQuantities
{
using CAnglePair = QPair<CAngle, CAngle>; //!< Pair of angle
using CLengthPair = QPair<CLength, CLength>; //!< Pair of length
using CSpeedPair = QPair<CSpeed, CSpeed>; //!< Pair of speed
}
namespace Aviation
{
using CAltitudePair = QPair<CAltitude, CAltitude>; //!< Pair of altitude
}
} // namespace
Q_DECLARE_METATYPE(BlackMisc::PhysicalQuantities::CAnglePair)
Q_DECLARE_METATYPE(BlackMisc::PhysicalQuantities::CLengthPair)
Q_DECLARE_METATYPE(BlackMisc::PhysicalQuantities::CSpeedPair)
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAltitudePair)
#endif // guard

View File

@@ -19,6 +19,7 @@
#include <QMetaType>
#include <QString>
#include <QPair>
namespace BlackMisc
{
@@ -114,9 +115,12 @@ namespace BlackMisc
//! Normalize: 0≤ degrees <360
static double normalizeDegrees360(double degrees, int roundDigits = -1);
};
using CAnglePair = QPair<CAngle, CAngle>; //!< Pair of angle
} // ns
} // ns
Q_DECLARE_METATYPE(BlackMisc::PhysicalQuantities::CAngle)
Q_DECLARE_METATYPE(BlackMisc::PhysicalQuantities::CAnglePair)
#endif // guard

View File

@@ -13,6 +13,7 @@
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/pq/physicalquantity.h"
#include <QPair>
namespace BlackMisc
{
@@ -37,9 +38,12 @@ namespace BlackMisc
//! \copydoc CPhysicalQuantity(const QString &unitString)
CLength(const QString &unitString) : CPhysicalQuantity(unitString) {}
};
using CLengthPair = QPair<CLength, CLength>; //!< Pair of length
} // ns
} // ns
Q_DECLARE_METATYPE(BlackMisc::PhysicalQuantities::CLength)
Q_DECLARE_METATYPE(BlackMisc::PhysicalQuantities::CLengthPair)
#endif // guard

View File

@@ -13,6 +13,7 @@
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/pq/physicalquantity.h"
#include <QPair>
namespace BlackMisc
{
@@ -34,9 +35,11 @@ namespace BlackMisc
CSpeed(const QString &unitString) : CPhysicalQuantity(unitString) {}
};
using CSpeedPair = QPair<CSpeed, CSpeed>; //!< Pair of speeds
} // ns
} // ns
Q_DECLARE_METATYPE(BlackMisc::PhysicalQuantities::CSpeed)
Q_DECLARE_METATYPE(BlackMisc::PhysicalQuantities::CSpeedPair)
#endif // guard