Browse Source

Platform: disable copy/move of Application classes.

They are something like singletons (or they expect that behavior
internally), moreover some code might hold pointer to them, thus
movement is not desired.
pull/34/head
Vladimír Vondruš 13 years ago
parent
commit
698b150c90
  1. 12
      src/Platform/AbstractXApplication.h
  2. 12
      src/Platform/GlutApplication.h
  3. 12
      src/Platform/NaClApplication.h
  4. 12
      src/Platform/Sdl2Application.h
  5. 12
      src/Platform/WindowlessGlxApplication.h
  6. 12
      src/Platform/WindowlessNaClApplication.h

12
src/Platform/AbstractXApplication.h

@ -73,6 +73,18 @@ class AbstractXApplication {
class MouseEvent; class MouseEvent;
class MouseMoveEvent; class MouseMoveEvent;
/** @brief Copying is not allowed */
AbstractXApplication(const AbstractXApplication&) = delete;
/** @brief Moving is not allowed */
AbstractXApplication(AbstractXApplication&&) = delete;
/** @brief Copying is not allowed */
AbstractXApplication& operator=(const AbstractXApplication&) = delete;
/** @brief Moving is not allowed */
AbstractXApplication& operator=(AbstractXApplication&&) = delete;
/** /**
* @brief Execute main loop * @brief Execute main loop
* @return Value for returning from `main()`. * @return Value for returning from `main()`.

12
src/Platform/GlutApplication.h

@ -102,6 +102,18 @@ class GlutApplication {
/** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */ /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */
explicit GlutApplication(const Arguments& arguments, std::nullptr_t); explicit GlutApplication(const Arguments& arguments, std::nullptr_t);
/** @brief Copying is not allowed */
GlutApplication(const GlutApplication&) = delete;
/** @brief Moving is not allowed */
GlutApplication(GlutApplication&&) = delete;
/** @brief Copying is not allowed */
GlutApplication& operator=(const GlutApplication&) = delete;
/** @brief Moving is not allowed */
GlutApplication& operator=(GlutApplication&&) = delete;
/** @copydoc Sdl2Application::exec() */ /** @copydoc Sdl2Application::exec() */
int exec() { int exec() {
glutMainLoop(); glutMainLoop();

12
src/Platform/NaClApplication.h

@ -160,6 +160,18 @@ class NaClApplication: public pp::Instance, public pp::Graphics3DClient, public
/** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */ /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */
explicit NaClApplication(const Arguments& arguments, std::nullptr_t); explicit NaClApplication(const Arguments& arguments, std::nullptr_t);
/** @brief Copying is not allowed */
NaClApplication(const NaClApplication&) = delete;
/** @brief Moving is not allowed */
NaClApplication(NaClApplication&&) = delete;
/** @brief Copying is not allowed */
NaClApplication& operator=(const NaClApplication&) = delete;
/** @brief Moving is not allowed */
NaClApplication& operator=(NaClApplication&&) = delete;
/** @brief Whether the application runs fullscreen */ /** @brief Whether the application runs fullscreen */
bool isFullscreen(); bool isFullscreen();

12
src/Platform/Sdl2Application.h

@ -161,6 +161,18 @@ class Sdl2Application {
*/ */
explicit Sdl2Application(const Arguments& arguments, std::nullptr_t); explicit Sdl2Application(const Arguments& arguments, std::nullptr_t);
/** @brief Copying is not allowed */
Sdl2Application(const Sdl2Application&) = delete;
/** @brief Moving is not allowed */
Sdl2Application(Sdl2Application&&) = delete;
/** @brief Copying is not allowed */
Sdl2Application& operator=(const Sdl2Application&) = delete;
/** @brief Moving is not allowed */
Sdl2Application& operator=(Sdl2Application&&) = delete;
/** /**
* @brief Execute main loop * @brief Execute main loop
* @return Value for returning from `main()`. * @return Value for returning from `main()`.

12
src/Platform/WindowlessGlxApplication.h

@ -95,6 +95,18 @@ class WindowlessGlxApplication {
/** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */ /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */
explicit WindowlessGlxApplication(const Arguments& arguments, std::nullptr_t); explicit WindowlessGlxApplication(const Arguments& arguments, std::nullptr_t);
/** @brief Copying is not allowed */
WindowlessGlxApplication(const WindowlessGlxApplication&) = delete;
/** @brief Moving is not allowed */
WindowlessGlxApplication(WindowlessGlxApplication&&) = delete;
/** @brief Copying is not allowed */
WindowlessGlxApplication& operator=(const WindowlessGlxApplication&) = delete;
/** @brief Moving is not allowed */
WindowlessGlxApplication& operator=(WindowlessGlxApplication&&) = delete;
/** /**
* @brief Execute application * @brief Execute application
* @return Value for returning from `main()`. * @return Value for returning from `main()`.

12
src/Platform/WindowlessNaClApplication.h

@ -111,6 +111,18 @@ class WindowlessNaClApplication: public pp::Instance, public pp::Graphics3DClien
/** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */ /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */
explicit WindowlessNaClApplication(const Arguments& arguments, std::nullptr_t); explicit WindowlessNaClApplication(const Arguments& arguments, std::nullptr_t);
/** @brief Copying is not allowed */
WindowlessNaClApplication(const WindowlessNaClApplication&) = delete;
/** @brief Moving is not allowed */
WindowlessNaClApplication(WindowlessNaClApplication&&) = delete;
/** @brief Copying is not allowed */
WindowlessNaClApplication& operator=(const WindowlessNaClApplication&) = delete;
/** @brief Moving is not allowed */
WindowlessNaClApplication& operator=(WindowlessNaClApplication&&) = delete;
/** /**
* @brief Execute application * @brief Execute application
* @return Value for returning from `main()`. * @return Value for returning from `main()`.

Loading…
Cancel
Save