diff --git a/src/blackcore/actionbind.h b/src/blackcore/actionbind.h index cc851ce9b..a622f261f 100644 --- a/src/blackcore/actionbind.h +++ b/src/blackcore/actionbind.h @@ -42,6 +42,12 @@ namespace BlackCore //! Signature just to set an icon for an action CActionBind(const QString &action, const QPixmap &icon); + //! Not copyable + //! @{ + CActionBind(const CActionBind &) = delete; + CActionBind &operator =(const CActionBind &) = delete; + //! @} + //! Destructor ~CActionBind(); diff --git a/src/blackmisc/collection.h b/src/blackmisc/collection.h index 995bd1751..d6d066a33 100644 --- a/src/blackmisc/collection.h +++ b/src/blackmisc/collection.h @@ -106,6 +106,9 @@ namespace BlackMisc //! Move assignment. CCollection &operator =(CCollection && other) noexcept(std::is_nothrow_move_assignable::value) { m_pimpl.reset(other.m_pimpl.take()); return *this; } + //! Destructor. + ~CCollection() = default; + //! Create a new collection with a specific 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. diff --git a/src/blackmisc/filedeleter.h b/src/blackmisc/filedeleter.h index ddef4dbf0..2bb8bacf4 100644 --- a/src/blackmisc/filedeleter.h +++ b/src/blackmisc/filedeleter.h @@ -43,6 +43,12 @@ namespace BlackMisc //! Delete files void deleteFiles(); + //! Not copyable. + //! @{ + CFileDeleter(const CFileDeleter &) = delete; + CFileDeleter &operator =(const CFileDeleter &) = delete; + //! @} + private: QStringList m_fileNames; }; diff --git a/src/blackmisc/iterator.h b/src/blackmisc/iterator.h index e1e024927..859242fe0 100644 --- a/src/blackmisc/iterator.h +++ b/src/blackmisc/iterator.h @@ -58,6 +58,9 @@ namespace BlackMisc return *new (this) OutputIterator(other); } + //! Destructor. + ~OutputIterator() = default; + private: F m_func; }; @@ -389,6 +392,9 @@ namespace BlackMisc //! Move assignment. 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. //! \tparam I Becomes the iterator's implementation type. //! \param i Initial value for the iterator. The value is copied. @@ -513,6 +519,9 @@ namespace BlackMisc //! Move assignment. 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. //! \tparam I Becomes the iterator's implementation type. //! \param i Initial value for the iterator. The value is copied. @@ -693,6 +702,9 @@ namespace BlackMisc //! Move assignment. 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. //! \tparam I Becomes the iterator's implementation type. //! \param i Initial value for the iterator. The value is copied. diff --git a/src/blackmisc/memotable.h b/src/blackmisc/memotable.h index 456a6681b..cbeb0b8e9 100644 --- a/src/blackmisc/memotable.h +++ b/src/blackmisc/memotable.h @@ -82,7 +82,7 @@ namespace BlackMisc template ::value, int> = 0> auto maybeUnmemoize(T &member) const { - struct Memo + struct Memo // clazy:exclude=rule-of-three { int index; T &member; diff --git a/src/blackmisc/network/urllist.cpp b/src/blackmisc/network/urllist.cpp index 46767b20c..2578e6cda 100644 --- a/src/blackmisc/network/urllist.cpp +++ b/src/blackmisc/network/urllist.cpp @@ -22,9 +22,6 @@ namespace BlackMisc { CUrlList::CUrlList() { } - CUrlList::CUrlList(const CUrlList &other) : CSequence(other) - { } - CUrlList::CUrlList(const CSequence &other) : CSequence(other) { } diff --git a/src/blackmisc/network/urllist.h b/src/blackmisc/network/urllist.h index fdf4ea661..112668cd3 100644 --- a/src/blackmisc/network/urllist.h +++ b/src/blackmisc/network/urllist.h @@ -37,9 +37,6 @@ namespace BlackMisc //! Default constructor. CUrlList(); - //! Copy constructor (because of mutex) - CUrlList(const CUrlList &other); - //! Construct from a base class object. CUrlList(const CSequence &other); diff --git a/src/blackmisc/pixmap.h b/src/blackmisc/pixmap.h index 854209d2c..385114673 100644 --- a/src/blackmisc/pixmap.h +++ b/src/blackmisc/pixmap.h @@ -43,6 +43,9 @@ namespace BlackMisc //! Copy assignment (because of mutex) CPixmap &operator =(const CPixmap &other); + //! Destructor. + ~CPixmap() = default; + //! Corresponding pixmap const QPixmap &pixmap() const; diff --git a/src/blackmisc/sequence.h b/src/blackmisc/sequence.h index b476fcc75..a81f42a75 100644 --- a/src/blackmisc/sequence.h +++ b/src/blackmisc/sequence.h @@ -84,6 +84,9 @@ namespace BlackMisc //! Move assignment. CSequence &operator =(CSequence && other) noexcept(std::is_nothrow_move_assignable::value) { m_pimpl.reset(other.m_pimpl.take()); return *this; } + //! Destructor. + ~CSequence() = default; + //! Create a new sequence with a specific 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. diff --git a/src/blackmisc/statusmessage.h b/src/blackmisc/statusmessage.h index 1af7e99a9..ac4fa1b5d 100644 --- a/src/blackmisc/statusmessage.h +++ b/src/blackmisc/statusmessage.h @@ -175,6 +175,9 @@ namespace BlackMisc //! Copy assignment (because of mutex) CStatusMessage &operator =(const CStatusMessage &other); + //! Destructor. + ~CStatusMessage() = default; + //! Constructor CStatusMessage(const QString &message); diff --git a/src/blackmisc/variant.h b/src/blackmisc/variant.h index da20a7ace..850a982c5 100644 --- a/src/blackmisc/variant.h +++ b/src/blackmisc/variant.h @@ -132,7 +132,7 @@ namespace BlackMisc CVariant(const CVariant &) = default; //! Move constructor. - CVariant(CVariant &&other) noexcept : m_v(std::move(other.m_v)) {} + CVariant(CVariant &&other) noexcept = default; //! Construct from a QVariant. CVariant(const QVariant &var) : m_v(var) {} @@ -165,10 +165,10 @@ namespace BlackMisc void reset(QVariant &&var) { m_v = std::move(var); } //! Copy assignment operator. - CVariant &operator =(const CVariant &other) { m_v = other.m_v; return *this; } + CVariant &operator =(const CVariant &other) = default; //! 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 CVariant &operator =(const QVariant &var) { m_v = var; return *this; } diff --git a/src/xbus/command.h b/src/xbus/command.h index 956d0ddf5..edad10701 100644 --- a/src/xbus/command.h +++ b/src/xbus/command.h @@ -37,6 +37,12 @@ namespace XBus XPLMUnregisterCommandHandler(m_command, callback, false, static_cast(this)); } + //! Not copyable. + //! @{ + CCommand(const CCommand &) = delete; + CCommand &operator =(const CCommand &) = delete; + //! @} + private: static int callback(XPLMCommandRef, XPLMCommandPhase phase, void *refcon) { diff --git a/src/xbus/menus.h b/src/xbus/menus.h index 7d235d924..c24957d62 100644 --- a/src/xbus/menus.h +++ b/src/xbus/menus.h @@ -95,6 +95,8 @@ namespace XBus std::unique_ptr items; std::vector subMenus; ~Data(); + Data(const Data &) = delete; + Data &operator =(const Data &) = delete; }; std::shared_ptr m_data; }; diff --git a/src/xbus/terrainprobe.h b/src/xbus/terrainprobe.h index 50a02463e..47b4b1147 100644 --- a/src/xbus/terrainprobe.h +++ b/src/xbus/terrainprobe.h @@ -26,6 +26,12 @@ namespace XBus //! Destructor; ~CTerrainProbe(); + //! Not copyable. + //! @{ + CTerrainProbe(const CTerrainProbe &) = delete; + CTerrainProbe &operator =(const CTerrainProbe &) = delete; + //! @} + //! 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. //! \return NaN if no ground was detected. diff --git a/src/xbus/utils.h b/src/xbus/utils.h index d9f98042d..1745a3a08 100644 --- a/src/xbus/utils.h +++ b/src/xbus/utils.h @@ -30,9 +30,6 @@ */ class QXPlaneMessageHandler { - QXPlaneMessageHandler(); - QXPlaneMessageHandler(const QXPlaneMessageHandler &); - static void handler(QtMsgType type, const QMessageLogContext &context, const QString &msg) { QByteArray localMsg = msg.toLocal8Bit(); @@ -76,6 +73,12 @@ public: { qInstallMessageHandler(handler); } + + //! Not copyable. + //! @{ + QXPlaneMessageHandler(const QXPlaneMessageHandler &) = delete; + QXPlaneMessageHandler &operator =(const QXPlaneMessageHandler &) = delete; + //! @} }; /*!