ADD: support disable scheduling by manager

This commit is contained in:
Dominik Meyer 2022-02-19 12:32:25 +01:00
parent 2141eb0c61
commit c2a609c913
No known key found for this signature in database
GPG Key ID: B4C312B600606B64
2 changed files with 13 additions and 0 deletions

View File

@ -139,6 +139,11 @@
*/ */
void _enableScheduling(); void _enableScheduling();
/**
* @brief disable scheduling of this particpant through the EventManager::Manager
*/
void _disableScheduling();
/** /**
* @brief check if the participant is scheduled by event manager * @brief check if the participant is scheduled by event manager
*/ */

View File

@ -118,6 +118,14 @@ void EventManager::Participant::_enableScheduling()
isScheduledByManager_=true; 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) void EventManager::Participant::_subscribe(std::uint32_t type)
{ {
if (manager_ == nullptr) if (manager_ == nullptr)