From 34326447f8e66eaac17743963fa6f9cdca8f9723 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Fri, 22 Aug 2014 10:33:31 +0200 Subject: [PATCH] refs #317 IKeyboard implementation fixes - private constructor - deleted public copy constructor - deleted public assignment operator --- src/blackinput/linux/keyboard_linux.h | 23 ++++++++++++----------- src/blackinput/osx/keyboard_mac.h | 23 ++++++++++++----------- src/blackinput/win/keyboard_windows.h | 22 +++++++++++----------- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/src/blackinput/linux/keyboard_linux.h b/src/blackinput/linux/keyboard_linux.h index 5128e2249..bc5bc3b6b 100644 --- a/src/blackinput/linux/keyboard_linux.h +++ b/src/blackinput/linux/keyboard_linux.h @@ -24,8 +24,15 @@ namespace BlackInput class CKeyboardLinux : public IKeyboard { Q_OBJECT + public: + //! \brief Copy Constructor + CKeyboardLinux(CKeyboardLinux const&) = delete; + + //! \brief Assignment operator + void operator=(CKeyboardLinux const&) = delete; + //! \brief Destructor virtual ~CKeyboardLinux(); @@ -40,20 +47,9 @@ namespace BlackInput protected: - friend class IKeyboard; - - //! \brief Constructor - CKeyboardLinux(QObject *parent = nullptr); - - //! \brief Copy Constructor - CKeyboardLinux(CKeyboardLinux const&); - //! \copydoc IKeyboard::init() virtual bool init() override; - //! \brief Assignment operator - void operator=(CKeyboardLinux const&); - private slots: //! Changed directory to linux devices @@ -64,6 +60,11 @@ namespace BlackInput private: + friend class IKeyboard; + + //! \brief Constructor + CKeyboardLinux(QObject *parent = nullptr); + /*! * \brief Constructor * \param keySet diff --git a/src/blackinput/osx/keyboard_mac.h b/src/blackinput/osx/keyboard_mac.h index 31be87341..f77a244be 100644 --- a/src/blackinput/osx/keyboard_mac.h +++ b/src/blackinput/osx/keyboard_mac.h @@ -21,8 +21,15 @@ namespace BlackInput class CKeyboardMac : public IKeyboard { Q_OBJECT + public: + //! \brief Copy Constructor + CKeyboardMac(CKeyboardMac const&) = delete; + + //! \brief Assignment operator + void operator=(CKeyboardMac const&) = delete; + //! \brief Destructor virtual ~CKeyboardMac(); @@ -37,22 +44,16 @@ namespace BlackInput protected: - friend class IKeyboard; - - //! \brief Constructor - CKeyboardMac(QObject *parent = nullptr); - - //! \brief Copy Constructor - CKeyboardMac(CKeyboardMac const&); - //! \copydoc IKeyboard::init() virtual bool init() override; - //! \brief Assignment operator - void operator=(CKeyboardMac const&); - private: + friend class IKeyboard; + + //! Constructor + CKeyboardMac(QObject *parent = nullptr); + /*! * \brief Constructor * \param keySet diff --git a/src/blackinput/win/keyboard_windows.h b/src/blackinput/win/keyboard_windows.h index 882ab6ff6..7140686d1 100644 --- a/src/blackinput/win/keyboard_windows.h +++ b/src/blackinput/win/keyboard_windows.h @@ -28,6 +28,12 @@ namespace BlackInput Q_OBJECT public: + //! \brief Copy Constructor + CKeyboardWindows(CKeyboardWindows const&) = delete; + + //! \brief Assignment operator + void operator=(CKeyboardWindows const&) = delete; + //! \brief Destructor virtual ~CKeyboardWindows(); @@ -48,22 +54,16 @@ namespace BlackInput protected: + //! \copydoc IKeyboard::init() + virtual bool init() override; + + private: + friend class IKeyboard; //! \brief Constructor CKeyboardWindows(QObject *parent = nullptr); - //! \brief Copy Constructor - CKeyboardWindows(CKeyboardWindows const&); - - //! \copydoc IKeyboard::init() - virtual bool init() override; - - //! \brief Assignment operator - void operator=(CKeyboardWindows const&); - - private: - /*! * \brief Constructor * \param keySet