MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ cancel_event() [1/2]

bool MayaFlux::Vruta::EventManager::cancel_event ( const std::shared_ptr< Event > &  event)

Cancels and removes a event from the manager.

Parameters
eventShared pointer to the event to cancel
Returns
True if the event was found and cancelled, false otherwise

This method removes a event from the manager, preventing it from executing further. It's used to stop events that are no longer needed or to clean up before shutting down the engine.

Definition at line 42 of file EventManager.cpp.

43{
44
45 auto it = std::ranges::find(m_events, event);
46 if (it != m_events.end()) {
47 if (event && event->is_active()) {
48 event->set_should_terminate(true);
49 }
50 m_events.erase(it);
51 return true;
52 }
53
54 return false;
55}
std::vector< std::shared_ptr< Event > > m_events

References m_events.