ADD: added method to not schedule a participant anymore

This commit is contained in:
Dominik Meyer 2022-02-18 22:02:31 +01:00
parent 03d9f5537d
commit e7d90d0c87
No known key found for this signature in database
GPG Key ID: B4C312B600606B64
2 changed files with 19 additions and 2 deletions

View File

@ -191,6 +191,12 @@
*/
void schedule(std::shared_ptr<EventManager::Participant> plugin);
/**
* @brief remove a participant from scheduling
*
* @param participant - the participant to remove
*/
void unschedule(std::shared_ptr<EventManager::Participant> participant);
/**
* @brief method to connect a particpant to the manager

View File

@ -326,6 +326,17 @@
}
}
void EventManager::Manager::unschedule(std::shared_ptr<EventManager::Participant> participant )
{
std::lock_guard<std::mutex> guard(mutexSchedulingParticipants_);
auto it = std::find(schedulingParticipants_.begin(), schedulingParticipants_.end(), participant);
if (it != schedulingParticipants_.end())
{
schedulingParticipants_.erase(it);
}
}
void EventManager::Manager::connect(std::shared_ptr<EventManager::Participant> participant)
{