From 3bc858777c8ea72714cf80dd3818add970cc269a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Nov 2013 20:04:31 +0100 Subject: [PATCH] Platform: deinline also all ScreenedApplication {con,de}structors. --- src/Platform/ScreenedApplication.h | 8 ++++++-- src/Platform/ScreenedApplication.hpp | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Platform/ScreenedApplication.h b/src/Platform/ScreenedApplication.h index 51e25b0db..dc962bdf9 100644 --- a/src/Platform/ScreenedApplication.h +++ b/src/Platform/ScreenedApplication.h @@ -94,10 +94,10 @@ template class BasicScreenedApplication: public Application, public: /** @copydoc Sdl2Application::Sdl2Application(const Arguments, const Configuration&) */ - explicit BasicScreenedApplication(const typename Application::Arguments& arguments, const typename Application::Configuration& configuration = Application::Configuration()): Application(arguments, configuration) {} + explicit BasicScreenedApplication(const typename Application::Arguments& arguments, const typename Application::Configuration& configuration = Application::Configuration()); /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */ - explicit BasicScreenedApplication(const typename Application::Arguments& arguments, std::nullptr_t): Application(arguments, nullptr) {} + explicit BasicScreenedApplication(const typename Application::Arguments& arguments, std::nullptr_t); /** * @brief Add screen to application @@ -157,6 +157,10 @@ template class BasicScreenedApplication: public Application, } protected: + /* Nobody will need to have (and delete) ScreenedApplication*, thus + this is faster than public pure virtual destructor */ + ~BasicScreenedApplication(); + /** * @brief Global viewport event * diff --git a/src/Platform/ScreenedApplication.hpp b/src/Platform/ScreenedApplication.hpp index 6cf03ddb9..2063c51fb 100644 --- a/src/Platform/ScreenedApplication.hpp +++ b/src/Platform/ScreenedApplication.hpp @@ -41,6 +41,12 @@ template void BasicScreen::mousePressEvent(Mouse template void BasicScreen::mouseReleaseEvent(MouseEvent&) {} template void BasicScreen::mouseMoveEvent(MouseMoveEvent&) {} +template BasicScreenedApplication::BasicScreenedApplication(const typename Application::Arguments& arguments, const typename Application::Configuration& configuration): Application(arguments, configuration) {} + +template BasicScreenedApplication::BasicScreenedApplication(const typename Application::Arguments& arguments, std::nullptr_t): Application(arguments, nullptr) {} + +template BasicScreenedApplication::~BasicScreenedApplication() = default; + template BasicScreenedApplication& BasicScreenedApplication::addScreen(BasicScreen& screen) { Containers::LinkedList>::insert(&screen); if(frontScreen() == &screen) screen.focusEvent();