From 4f7f58a60c575c6fa34d32b78f569d8e1d7547eb Mon Sep 17 00:00:00 2001 From: Christina Sander Date: Tue, 1 Nov 2022 20:03:31 +0100 Subject: [PATCH] ADD: Adds class function to participant to disconnect itself from the event manager. --- include/EventManager/Participant.hpp | 5 +++++ src/EventManager/Participant.cpp | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/EventManager/Participant.hpp b/include/EventManager/Participant.hpp index db3cc4a..0ca39e2 100644 --- a/include/EventManager/Participant.hpp +++ b/include/EventManager/Participant.hpp @@ -162,6 +162,11 @@ */ void disconnect(std::shared_ptr participant); + /** + * @brief disconnect this participant from the event manager + */ + void disconnect(); + public: /** * @brief Constructor setting the participant up for use diff --git a/src/EventManager/Participant.cpp b/src/EventManager/Participant.cpp index 8e2d906..f325406 100644 --- a/src/EventManager/Participant.cpp +++ b/src/EventManager/Participant.cpp @@ -40,6 +40,16 @@ void EventManager::Participant::disconnect(std::shared_ptrdisconnect(shared_from_this()); +} + + void EventManager::Participant::emit(std::shared_ptr event) { {