ADD: Adds class function to participant to disconnect itself from the event manager. #4
@ -162,6 +162,11 @@
|
||||
*/
|
||||
void disconnect(std::shared_ptr<EventManager::Participant> participant);
|
||||
|
||||
/**
|
||||
* @brief disconnect this participant from the event manager
|
||||
*/
|
||||
void disconnect();
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor setting the participant up for use
|
||||
|
@ -40,6 +40,16 @@ void EventManager::Participant::disconnect(std::shared_ptr<EventManager::Partici
|
||||
}
|
||||
|
||||
|
||||
void EventManager::Participant::disconnect()
|
||||
{
|
||||
if (manager_ == nullptr)
|
||||
{
|
||||
throw std::runtime_error("no event manager set yet");
|
||||
}
|
||||
manager_->disconnect(shared_from_this());
|
||||
}
|
||||
|
||||
|
||||
void EventManager::Participant::emit(std::shared_ptr<EventManager::Event> event)
|
||||
{
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user