aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/EventHandler.h
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-06 10:44:42 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-06 10:44:42 +0100
commitd5f63024ebed7df2fff8e016bd1c7c26f8fdfa27 (patch)
treeb26e35cb0482d04a33cc96d97ba21c21d0012229 /src/crepe/api/EventHandler.h
parent9cde6875186b335c75eafa6402f0957cd4252c76 (diff)
parent1f4e961d7f9d6887c807cac1a362f2d178b0860b (diff)
Merge branch 'master' into decoupling
Diffstat (limited to 'src/crepe/api/EventHandler.h')
-rw-r--r--src/crepe/api/EventHandler.h58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/crepe/api/EventHandler.h b/src/crepe/api/EventHandler.h
index ef659fd..7bdd9a3 100644
--- a/src/crepe/api/EventHandler.h
+++ b/src/crepe/api/EventHandler.h
@@ -29,29 +29,29 @@ using EventHandler = std::function<bool(const EventType & e)>;
class IEventHandlerWrapper {
public:
/**
- * \brief Virtual destructor for IEventHandlerWrapper.
- */
+ * \brief Virtual destructor for IEventHandlerWrapper.
+ */
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.
- *
- * \param e The event to be processed.
- * \return A boolean value indicating whether the event is handled.
- */
+ * \brief Executes the handler with the given event.
+ *
+ * This method calls the `call()` method of the derived class, passing the event to the handler.
+ *
+ * \param e The event to be processed.
+ * \return A boolean value indicating whether the event is handled.
+ */
bool exec(const Event & e);
private:
/**
- * \brief The method responsible for handling the event.
- *
- * This method is implemented by derived classes to process the event.
- *
- * \param e The event to be processed.
- * \return A boolean value indicating whether the event is handled.
- */
+ * \brief The method responsible for handling the event.
+ *
+ * This method is implemented by derived classes to process the event.
+ *
+ * \param e The event to be processed.
+ * \return A boolean value indicating whether the event is handled.
+ */
virtual bool call(const Event & e) = 0;
};
@@ -69,23 +69,23 @@ template <typename EventType>
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.
- */
+ * \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<EventType> & handler);
private:
/**
- * \brief Calls the stored event handler with the event.
- *
- * This method casts the event to the appropriate type and calls the handler.
- *
- * \param e The event to be handled.
- * \return A boolean value indicating whether the event is handled.
- */
+ * \brief Calls the stored event handler with the event.
+ *
+ * This method casts the event to the appropriate type and calls the handler.
+ *
+ * \param e The event to be handled.
+ * \return A boolean value indicating whether the event is handled.
+ */
bool call(const Event & e) override;
//! The event handler function.
EventHandler<EventType> handler;