From d7140709844a0c388f5a69c95b50d46ca9d71831 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Sun, 11 Jan 2015 00:34:47 +0300 Subject: [PATCH] Document deleted ctors/assignment operators --- SDL2pp/AudioDevice.hh | 18 +++++++++++++++--- SDL2pp/AudioSpec.hh | 16 ++++++++++++++-- SDL2pp/Font.hh | 14 +++++++++++++- SDL2pp/RWops.hh | 16 ++++++++++++++-- SDL2pp/Renderer.hh | 14 +++++++++++++- SDL2pp/SDL.hh | 32 +++++++++++++++++++++++++++++--- SDL2pp/SDLImage.hh | 32 +++++++++++++++++++++++++++++--- SDL2pp/SDLTTF.hh | 32 +++++++++++++++++++++++++++++--- SDL2pp/Surface.hh | 28 ++++++++++++++++++++++++++-- SDL2pp/Texture.hh | 28 ++++++++++++++++++++++++++-- SDL2pp/Wav.hh | 16 ++++++++++++++-- SDL2pp/Window.hh | 14 +++++++++++++- 12 files changed, 235 insertions(+), 25 deletions(-) diff --git a/SDL2pp/AudioDevice.hh b/SDL2pp/AudioDevice.hh index bda5b5f..289b34c 100644 --- a/SDL2pp/AudioDevice.hh +++ b/SDL2pp/AudioDevice.hh @@ -231,9 +231,21 @@ public: //////////////////////////////////////////////////////////// AudioDevice& operator=(AudioDevice&& other) noexcept; - // Deleted copy constructor and assignment - AudioDevice(const AudioDevice& other) = delete; - AudioDevice& operator=(const AudioDevice& other) = delete; + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// + AudioDevice(const AudioDevice&) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// + AudioDevice& operator=(const AudioDevice&) = delete; //////////////////////////////////////////////////////////// /// \brief Get container audio device ID diff --git a/SDL2pp/AudioSpec.hh b/SDL2pp/AudioSpec.hh index 293d0de..ecb05ce 100644 --- a/SDL2pp/AudioSpec.hh +++ b/SDL2pp/AudioSpec.hh @@ -1,6 +1,6 @@ /* libSDL2pp - C++11 bindings/wrapper for SDL2 - Copyright (C) 2014 Dmitry Marakasov + Copyright (C) 2014-2015 Dmitry Marakasov This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -86,8 +86,20 @@ public: //////////////////////////////////////////////////////////// AudioSpec& operator=(AudioSpec&& other); - // Deleted copy constructor and assignment + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// AudioSpec(const AudioSpec& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// AudioSpec& operator=(const AudioSpec& other) = delete; //////////////////////////////////////////////////////////// diff --git a/SDL2pp/Font.hh b/SDL2pp/Font.hh index 8a15e70..df6be36 100644 --- a/SDL2pp/Font.hh +++ b/SDL2pp/Font.hh @@ -105,8 +105,20 @@ public: //////////////////////////////////////////////////////////// Font& operator=(Font&& other) noexcept; - // Deleted copy constructor and assignment + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// Font(const Font&) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// Font& operator=(const Font&) = delete; //////////////////////////////////////////////////////////// diff --git a/SDL2pp/RWops.hh b/SDL2pp/RWops.hh index d9f51a8..1e0f3c3 100644 --- a/SDL2pp/RWops.hh +++ b/SDL2pp/RWops.hh @@ -1,6 +1,6 @@ /* libSDL2pp - C++11 bindings/wrapper for SDL2 - Copyright (C) 2014 Dmitry Marakasov + Copyright (C) 2014-2015 Dmitry Marakasov This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -239,8 +239,20 @@ public: //////////////////////////////////////////////////////////// RWops& operator=(RWops&& other) noexcept; - // Deleted copy constructor and assignment + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// RWops(const RWops&) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// RWops& operator=(const RWops&) = delete; //////////////////////////////////////////////////////////// diff --git a/SDL2pp/Renderer.hh b/SDL2pp/Renderer.hh index 174b4ee..ab892c7 100644 --- a/SDL2pp/Renderer.hh +++ b/SDL2pp/Renderer.hh @@ -101,8 +101,20 @@ public: //////////////////////////////////////////////////////////// Renderer& operator=(Renderer&& other) noexcept; - // Deleted copy constructor and assignment + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// Renderer(const Renderer& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// Renderer& operator=(const Renderer& other) = delete; //////////////////////////////////////////////////////////// diff --git a/SDL2pp/SDL.hh b/SDL2pp/SDL.hh index ad7be95..b610db3 100644 --- a/SDL2pp/SDL.hh +++ b/SDL2pp/SDL.hh @@ -1,6 +1,6 @@ /* libSDL2pp - C++11 bindings/wrapper for SDL2 - Copyright (C) 2013-2014 Dmitry Marakasov + Copyright (C) 2013-2015 Dmitry Marakasov This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -75,10 +75,36 @@ public: //////////////////////////////////////////////////////////// virtual ~SDL(); - // Deleted copy/move constructors and assignments + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// SDL(const SDL& other) = delete; - SDL(SDL&& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// SDL& operator=(const SDL& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted move constructor + /// + /// This class is not movable + /// + //////////////////////////////////////////////////////////// + SDL(SDL&& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted move assignment operator + /// + /// This class is not movable + /// + //////////////////////////////////////////////////////////// SDL& operator=(SDL&& other) = delete; //////////////////////////////////////////////////////////// diff --git a/SDL2pp/SDLImage.hh b/SDL2pp/SDLImage.hh index 1d8e3cc..80a4b1d 100644 --- a/SDL2pp/SDLImage.hh +++ b/SDL2pp/SDLImage.hh @@ -1,6 +1,6 @@ /* libSDL2pp - C++11 bindings/wrapper for SDL2 - Copyright (C) 2014 Dmitry Marakasov + Copyright (C) 2014-2015 Dmitry Marakasov This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -94,10 +94,36 @@ public: //////////////////////////////////////////////////////////// int GetInitFlags(); - // Deleted copy/move constructors and assignments + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// SDLImage(const SDLImage& other) = delete; - SDLImage(SDLImage&& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// SDLImage& operator=(const SDLImage& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted move constructor + /// + /// This class is not movable + /// + //////////////////////////////////////////////////////////// + SDLImage(SDLImage&& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted move assignment operator + /// + /// This class is not movable + /// + //////////////////////////////////////////////////////////// SDLImage& operator=(SDLImage&& other) = delete; }; diff --git a/SDL2pp/SDLTTF.hh b/SDL2pp/SDLTTF.hh index 29e74cb..6451568 100644 --- a/SDL2pp/SDLTTF.hh +++ b/SDL2pp/SDLTTF.hh @@ -1,6 +1,6 @@ /* libSDL2pp - C++11 bindings/wrapper for SDL2 - Copyright (C) 2014 Dmitry Marakasov + Copyright (C) 2014-2015 Dmitry Marakasov This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -70,10 +70,36 @@ public: //////////////////////////////////////////////////////////// virtual ~SDLTTF(); - // Deleted copy/move constructors and assignments + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// SDLTTF(const SDLTTF& other) = delete; - SDLTTF(SDLTTF&& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// SDLTTF& operator=(const SDLTTF& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted move constructor + /// + /// This class is not movable + /// + //////////////////////////////////////////////////////////// + SDLTTF(SDLTTF&& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted move assignment operator + /// + /// This class is not movable + /// + //////////////////////////////////////////////////////////// SDLTTF& operator=(SDLTTF&& other) = delete; }; diff --git a/SDL2pp/Surface.hh b/SDL2pp/Surface.hh index cd26803..affb9ad 100644 --- a/SDL2pp/Surface.hh +++ b/SDL2pp/Surface.hh @@ -119,8 +119,20 @@ public: //////////////////////////////////////////////////////////// LockHandle& operator=(LockHandle&& other) noexcept; - // Deleted copy constructor and assignment + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// LockHandle(const LockHandle& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// LockHandle& operator=(const LockHandle& other) = delete; //////////////////////////////////////////////////////////// @@ -241,8 +253,20 @@ public: //////////////////////////////////////////////////////////// Surface& operator=(Surface&& other) noexcept; - // Deleted copy constructor and assignment + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// Surface(const Surface&) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// Surface& operator=(const Surface&) = delete; //////////////////////////////////////////////////////////// diff --git a/SDL2pp/Texture.hh b/SDL2pp/Texture.hh index aed0281..548a26a 100644 --- a/SDL2pp/Texture.hh +++ b/SDL2pp/Texture.hh @@ -149,8 +149,20 @@ public: //////////////////////////////////////////////////////////// LockHandle& operator=(LockHandle&& other) noexcept; - // Deleted copy constructor and assignment + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// LockHandle(const LockHandle& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// LockHandle& operator=(const LockHandle& other) = delete; //////////////////////////////////////////////////////////// @@ -259,8 +271,20 @@ public: //////////////////////////////////////////////////////////// Texture& operator=(Texture&& other) noexcept; - // Deleted copy constructor and assignment + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// Texture(const Texture& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// Texture& operator=(const Texture& other) = delete; //////////////////////////////////////////////////////////// diff --git a/SDL2pp/Wav.hh b/SDL2pp/Wav.hh index d3faf39..77fc504 100644 --- a/SDL2pp/Wav.hh +++ b/SDL2pp/Wav.hh @@ -1,6 +1,6 @@ /* libSDL2pp - C++11 bindings/wrapper for SDL2 - Copyright (C) 2014 Dmitry Marakasov + Copyright (C) 2014-2015 Dmitry Marakasov This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -104,8 +104,20 @@ public: //////////////////////////////////////////////////////////// Wav& operator=(Wav&& other); - // Deleted copy constructor and assignment + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// Wav(const Wav& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// Wav& operator=(const Wav& other) = delete; //////////////////////////////////////////////////////////// diff --git a/SDL2pp/Window.hh b/SDL2pp/Window.hh index 8b5546a..801659c 100644 --- a/SDL2pp/Window.hh +++ b/SDL2pp/Window.hh @@ -115,8 +115,20 @@ public: //////////////////////////////////////////////////////////// Window& operator=(Window&& other) noexcept; - // Deleted copy constructor and assignment + //////////////////////////////////////////////////////////// + /// \brief Deleted copy constructor + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// Window(const Window& other) = delete; + + //////////////////////////////////////////////////////////// + /// \brief Deleted assignment operator + /// + /// This class is not copyable + /// + //////////////////////////////////////////////////////////// Window& operator=(const Window& other) = delete; ////////////////////////////////////////////////////////////