diff --git a/include/EventManager/Participant.hpp b/include/EventManager/Participant.hpp index 1d7c5a7..bcd58bb 100644 --- a/include/EventManager/Participant.hpp +++ b/include/EventManager/Participant.hpp @@ -139,6 +139,11 @@ */ void _enableScheduling(); + /** + * @brief disable scheduling of this particpant through the EventManager::Manager + */ + void _disableScheduling(); + /** * @brief check if the participant is scheduled by event manager */ diff --git a/src/EventManager/Participant.cpp b/src/EventManager/Participant.cpp index 5d9f95f..8e2d906 100644 --- a/src/EventManager/Participant.cpp +++ b/src/EventManager/Participant.cpp @@ -118,6 +118,14 @@ void EventManager::Participant::_enableScheduling() isScheduledByManager_=true; } +void EventManager::Participant::_disableScheduling() { + if (manager_ == nullptr) { + throw std::runtime_error("no event manager set yet"); + } + manager_->unschedule(shared_from_this()); + isScheduledByManager_ = false; +} + void EventManager::Participant::_subscribe(std::uint32_t type) { if (manager_ == nullptr)