From 027e67b32a9cca3cac4a186e73fdcc42faeab8c4 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Sat, 16 Nov 2024 15:21:49 +0100 Subject: added eventManager reference to interfaces --- src/crepe/api/EventHandler.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/crepe/api/EventHandler.h') diff --git a/src/crepe/api/EventHandler.h b/src/crepe/api/EventHandler.h index 2a684c0..db51d04 100644 --- a/src/crepe/api/EventHandler.h +++ b/src/crepe/api/EventHandler.h @@ -26,12 +26,12 @@ using EventHandler = std::function; */ class IEventHandlerWrapper { public: - /** + /** * \brief Virtual destructor for IEventHandlerWrapper. */ - virtual ~IEventHandlerWrapper() = default; + virtual ~IEventHandlerWrapper() = default; - /** + /** * \brief Executes the handler with the given event. * * This method calls the `call()` method of the derived class, passing the event to the handler. @@ -39,19 +39,19 @@ public: * \param e The event to be processed. * \return A boolean value indicating whether the event is handled. */ - bool exec(const Event & e); + bool exec(const Event & e); - /** + /** * \brief Get the type of the event handler. * * This method returns the type of the event handler as a string. * * \return A string representing the handler's type. */ - virtual std::string get_type() const = 0; + virtual std::string get_type() const = 0; private: - /** + /** * \brief The method responsible for handling the event. * * This method is implemented by derived classes to process the event. @@ -59,7 +59,7 @@ private: * \param e The event to be processed. * \return A boolean value indicating whether the event is handled. */ - virtual bool call(const Event & e) = 0; + virtual bool call(const Event & e) = 0; }; /** @@ -75,17 +75,17 @@ private: template class EventHandlerWrapper : public IEventHandlerWrapper { public: - /** + /** * \brief Constructs an EventHandlerWrapper with a given handler. * * The constructor takes an event handler function and stores it in the wrapper. * * \param handler The event handler function. */ - explicit EventHandlerWrapper(const EventHandler & handler); + explicit EventHandlerWrapper(const EventHandler & handler); private: - /** + /** * \brief Calls the stored event handler with the event. * * This method casts the event to the appropriate type and calls the handler. @@ -93,21 +93,21 @@ private: * \param e The event to be handled. * \return A boolean value indicating whether the event is handled. */ - bool call(const Event & e) override; + bool call(const Event & e) override; - /** + /** * \brief Returns the type of the handler. * * This method returns a string representing the type of the event handler. * * \return The handler type as a string. */ - std::string get_type() const override; + std::string get_type() const override; - //! The event handler function. - EventHandler m_handler; - //! The type name of the handler function. - const std::string m_handler_type; + //! The event handler function. + EventHandler m_handler; + //! The type name of the handler function. + const std::string m_handler_type; }; } // namespace crepe -- cgit v1.2.3