forked from byterazor/EventManager
ADD: added method to not schedule a participant anymore
This commit is contained in:
parent
03d9f5537d
commit
e7d90d0c87
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user