mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
refs #937 Resolved clazy warnings: rule of three.
This commit is contained in:
@@ -42,6 +42,12 @@ namespace BlackCore
|
|||||||
//! Signature just to set an icon for an action
|
//! Signature just to set an icon for an action
|
||||||
CActionBind(const QString &action, const QPixmap &icon);
|
CActionBind(const QString &action, const QPixmap &icon);
|
||||||
|
|
||||||
|
//! Not copyable
|
||||||
|
//! @{
|
||||||
|
CActionBind(const CActionBind &) = delete;
|
||||||
|
CActionBind &operator =(const CActionBind &) = delete;
|
||||||
|
//! @}
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
~CActionBind();
|
~CActionBind();
|
||||||
|
|
||||||
|
|||||||
@@ -106,6 +106,9 @@ namespace BlackMisc
|
|||||||
//! Move assignment.
|
//! Move assignment.
|
||||||
CCollection &operator =(CCollection && other) noexcept(std::is_nothrow_move_assignable<T>::value) { m_pimpl.reset(other.m_pimpl.take()); return *this; }
|
CCollection &operator =(CCollection && other) noexcept(std::is_nothrow_move_assignable<T>::value) { m_pimpl.reset(other.m_pimpl.take()); return *this; }
|
||||||
|
|
||||||
|
//! Destructor.
|
||||||
|
~CCollection() = default;
|
||||||
|
|
||||||
//! Create a new collection with a specific implementation type.
|
//! Create a new collection with a specific implementation type.
|
||||||
//! \tparam C Becomes the collection's implementation type.
|
//! \tparam C Becomes the collection's implementation type.
|
||||||
//! \param c Initial value for the collection; default is empty, but it could contain elements if desired. The value is copied.
|
//! \param c Initial value for the collection; default is empty, but it could contain elements if desired. The value is copied.
|
||||||
|
|||||||
@@ -43,6 +43,12 @@ namespace BlackMisc
|
|||||||
//! Delete files
|
//! Delete files
|
||||||
void deleteFiles();
|
void deleteFiles();
|
||||||
|
|
||||||
|
//! Not copyable.
|
||||||
|
//! @{
|
||||||
|
CFileDeleter(const CFileDeleter &) = delete;
|
||||||
|
CFileDeleter &operator =(const CFileDeleter &) = delete;
|
||||||
|
//! @}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QStringList m_fileNames;
|
QStringList m_fileNames;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ namespace BlackMisc
|
|||||||
return *new (this) OutputIterator(other);
|
return *new (this) OutputIterator(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Destructor.
|
||||||
|
~OutputIterator() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
F m_func;
|
F m_func;
|
||||||
};
|
};
|
||||||
@@ -389,6 +392,9 @@ namespace BlackMisc
|
|||||||
//! Move assignment.
|
//! Move assignment.
|
||||||
ConstForwardIterator &operator =(ConstForwardIterator &&other) noexcept { m_pimpl.reset(other.m_pimpl.take()); return *this; }
|
ConstForwardIterator &operator =(ConstForwardIterator &&other) noexcept { m_pimpl.reset(other.m_pimpl.take()); return *this; }
|
||||||
|
|
||||||
|
//! Destructor.
|
||||||
|
~ConstForwardIterator() = default;
|
||||||
|
|
||||||
//! Create a new iterator with a specific implementation type.
|
//! Create a new iterator with a specific implementation type.
|
||||||
//! \tparam I Becomes the iterator's implementation type.
|
//! \tparam I Becomes the iterator's implementation type.
|
||||||
//! \param i Initial value for the iterator. The value is copied.
|
//! \param i Initial value for the iterator. The value is copied.
|
||||||
@@ -513,6 +519,9 @@ namespace BlackMisc
|
|||||||
//! Move assignment.
|
//! Move assignment.
|
||||||
ConstRandomAccessIterator &operator =(ConstRandomAccessIterator &&other) noexcept { m_pimpl.reset(other.m_pimpl.take()); return *this; }
|
ConstRandomAccessIterator &operator =(ConstRandomAccessIterator &&other) noexcept { m_pimpl.reset(other.m_pimpl.take()); return *this; }
|
||||||
|
|
||||||
|
//! Destructor.
|
||||||
|
~ConstRandomAccessIterator() = default;
|
||||||
|
|
||||||
//! Create a new iterator with a specific implementation type.
|
//! Create a new iterator with a specific implementation type.
|
||||||
//! \tparam I Becomes the iterator's implementation type.
|
//! \tparam I Becomes the iterator's implementation type.
|
||||||
//! \param i Initial value for the iterator. The value is copied.
|
//! \param i Initial value for the iterator. The value is copied.
|
||||||
@@ -693,6 +702,9 @@ namespace BlackMisc
|
|||||||
//! Move assignment.
|
//! Move assignment.
|
||||||
RandomAccessIterator &operator =(RandomAccessIterator &&other) noexcept { m_pimpl.reset(other.m_pimpl.take()); return *this; }
|
RandomAccessIterator &operator =(RandomAccessIterator &&other) noexcept { m_pimpl.reset(other.m_pimpl.take()); return *this; }
|
||||||
|
|
||||||
|
//! Destructor.
|
||||||
|
~RandomAccessIterator() = default;
|
||||||
|
|
||||||
//! Create a new iterator with a specific implementation type.
|
//! Create a new iterator with a specific implementation type.
|
||||||
//! \tparam I Becomes the iterator's implementation type.
|
//! \tparam I Becomes the iterator's implementation type.
|
||||||
//! \param i Initial value for the iterator. The value is copied.
|
//! \param i Initial value for the iterator. The value is copied.
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ namespace BlackMisc
|
|||||||
template <typename T, std::enable_if_t<TIsOneOf<T, Ts...>::value, int> = 0>
|
template <typename T, std::enable_if_t<TIsOneOf<T, Ts...>::value, int> = 0>
|
||||||
auto maybeUnmemoize(T &member) const
|
auto maybeUnmemoize(T &member) const
|
||||||
{
|
{
|
||||||
struct Memo
|
struct Memo // clazy:exclude=rule-of-three
|
||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
T &member;
|
T &member;
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
CUrlList::CUrlList() { }
|
CUrlList::CUrlList() { }
|
||||||
|
|
||||||
CUrlList::CUrlList(const CUrlList &other) : CSequence<CUrl>(other)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
CUrlList::CUrlList(const CSequence<CUrl> &other) :
|
CUrlList::CUrlList(const CSequence<CUrl> &other) :
|
||||||
CSequence<CUrl>(other)
|
CSequence<CUrl>(other)
|
||||||
{ }
|
{ }
|
||||||
|
|||||||
@@ -37,9 +37,6 @@ namespace BlackMisc
|
|||||||
//! Default constructor.
|
//! Default constructor.
|
||||||
CUrlList();
|
CUrlList();
|
||||||
|
|
||||||
//! Copy constructor (because of mutex)
|
|
||||||
CUrlList(const CUrlList &other);
|
|
||||||
|
|
||||||
//! Construct from a base class object.
|
//! Construct from a base class object.
|
||||||
CUrlList(const CSequence<CUrl> &other);
|
CUrlList(const CSequence<CUrl> &other);
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ namespace BlackMisc
|
|||||||
//! Copy assignment (because of mutex)
|
//! Copy assignment (because of mutex)
|
||||||
CPixmap &operator =(const CPixmap &other);
|
CPixmap &operator =(const CPixmap &other);
|
||||||
|
|
||||||
|
//! Destructor.
|
||||||
|
~CPixmap() = default;
|
||||||
|
|
||||||
//! Corresponding pixmap
|
//! Corresponding pixmap
|
||||||
const QPixmap &pixmap() const;
|
const QPixmap &pixmap() const;
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,9 @@ namespace BlackMisc
|
|||||||
//! Move assignment.
|
//! Move assignment.
|
||||||
CSequence &operator =(CSequence && other) noexcept(std::is_nothrow_move_assignable<T>::value) { m_pimpl.reset(other.m_pimpl.take()); return *this; }
|
CSequence &operator =(CSequence && other) noexcept(std::is_nothrow_move_assignable<T>::value) { m_pimpl.reset(other.m_pimpl.take()); return *this; }
|
||||||
|
|
||||||
|
//! Destructor.
|
||||||
|
~CSequence() = default;
|
||||||
|
|
||||||
//! Create a new sequence with a specific implementation type.
|
//! Create a new sequence with a specific implementation type.
|
||||||
//! \tparam C Becomes the sequence's implementation type.
|
//! \tparam C Becomes the sequence's implementation type.
|
||||||
//! \param c Initial value for the sequence; default is empty, but it could contain elements if desired. The value is copied.
|
//! \param c Initial value for the sequence; default is empty, but it could contain elements if desired. The value is copied.
|
||||||
|
|||||||
@@ -175,6 +175,9 @@ namespace BlackMisc
|
|||||||
//! Copy assignment (because of mutex)
|
//! Copy assignment (because of mutex)
|
||||||
CStatusMessage &operator =(const CStatusMessage &other);
|
CStatusMessage &operator =(const CStatusMessage &other);
|
||||||
|
|
||||||
|
//! Destructor.
|
||||||
|
~CStatusMessage() = default;
|
||||||
|
|
||||||
//! Constructor
|
//! Constructor
|
||||||
CStatusMessage(const QString &message);
|
CStatusMessage(const QString &message);
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ namespace BlackMisc
|
|||||||
CVariant(const CVariant &) = default;
|
CVariant(const CVariant &) = default;
|
||||||
|
|
||||||
//! Move constructor.
|
//! Move constructor.
|
||||||
CVariant(CVariant &&other) noexcept : m_v(std::move(other.m_v)) {}
|
CVariant(CVariant &&other) noexcept = default;
|
||||||
|
|
||||||
//! Construct from a QVariant.
|
//! Construct from a QVariant.
|
||||||
CVariant(const QVariant &var) : m_v(var) {}
|
CVariant(const QVariant &var) : m_v(var) {}
|
||||||
@@ -165,10 +165,10 @@ namespace BlackMisc
|
|||||||
void reset(QVariant &&var) { m_v = std::move(var); }
|
void reset(QVariant &&var) { m_v = std::move(var); }
|
||||||
|
|
||||||
//! Copy assignment operator.
|
//! Copy assignment operator.
|
||||||
CVariant &operator =(const CVariant &other) { m_v = other.m_v; return *this; }
|
CVariant &operator =(const CVariant &other) = default;
|
||||||
|
|
||||||
//! Move assignment operatior.
|
//! Move assignment operatior.
|
||||||
CVariant &operator =(CVariant && other) noexcept { m_v = std::move(other.m_v); return *this; }
|
CVariant &operator =(CVariant && other) noexcept = default;
|
||||||
|
|
||||||
//! Change the internal QVariant
|
//! Change the internal QVariant
|
||||||
CVariant &operator =(const QVariant &var) { m_v = var; return *this; }
|
CVariant &operator =(const QVariant &var) { m_v = var; return *this; }
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ namespace XBus
|
|||||||
XPLMUnregisterCommandHandler(m_command, callback, false, static_cast<void*>(this));
|
XPLMUnregisterCommandHandler(m_command, callback, false, static_cast<void*>(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Not copyable.
|
||||||
|
//! @{
|
||||||
|
CCommand(const CCommand &) = delete;
|
||||||
|
CCommand &operator =(const CCommand &) = delete;
|
||||||
|
//! @}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static int callback(XPLMCommandRef, XPLMCommandPhase phase, void *refcon)
|
static int callback(XPLMCommandRef, XPLMCommandPhase phase, void *refcon)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ namespace XBus
|
|||||||
std::unique_ptr<ItemList> items;
|
std::unique_ptr<ItemList> items;
|
||||||
std::vector<CMenu> subMenus;
|
std::vector<CMenu> subMenus;
|
||||||
~Data();
|
~Data();
|
||||||
|
Data(const Data &) = delete;
|
||||||
|
Data &operator =(const Data &) = delete;
|
||||||
};
|
};
|
||||||
std::shared_ptr<Data> m_data;
|
std::shared_ptr<Data> m_data;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ namespace XBus
|
|||||||
//! Destructor;
|
//! Destructor;
|
||||||
~CTerrainProbe();
|
~CTerrainProbe();
|
||||||
|
|
||||||
|
//! Not copyable.
|
||||||
|
//! @{
|
||||||
|
CTerrainProbe(const CTerrainProbe &) = delete;
|
||||||
|
CTerrainProbe &operator =(const CTerrainProbe &) = delete;
|
||||||
|
//! @}
|
||||||
|
|
||||||
//! Get the elevation in meters at the given point in OpenGL space.
|
//! Get the elevation in meters at the given point in OpenGL space.
|
||||||
//! \note Due to the Earth's curvature, the OpenGL vertical axis may not be exactly perpendicular to the surface of the geoid.
|
//! \note Due to the Earth's curvature, the OpenGL vertical axis may not be exactly perpendicular to the surface of the geoid.
|
||||||
//! \return NaN if no ground was detected.
|
//! \return NaN if no ground was detected.
|
||||||
|
|||||||
@@ -30,9 +30,6 @@
|
|||||||
*/
|
*/
|
||||||
class QXPlaneMessageHandler
|
class QXPlaneMessageHandler
|
||||||
{
|
{
|
||||||
QXPlaneMessageHandler();
|
|
||||||
QXPlaneMessageHandler(const QXPlaneMessageHandler &);
|
|
||||||
|
|
||||||
static void handler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
static void handler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||||
{
|
{
|
||||||
QByteArray localMsg = msg.toLocal8Bit();
|
QByteArray localMsg = msg.toLocal8Bit();
|
||||||
@@ -76,6 +73,12 @@ public:
|
|||||||
{
|
{
|
||||||
qInstallMessageHandler(handler);
|
qInstallMessageHandler(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Not copyable.
|
||||||
|
//! @{
|
||||||
|
QXPlaneMessageHandler(const QXPlaneMessageHandler &) = delete;
|
||||||
|
QXPlaneMessageHandler &operator =(const QXPlaneMessageHandler &) = delete;
|
||||||
|
//! @}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
Reference in New Issue
Block a user