class::ev::EventHandler

class ev::EventHandler
  : public api::WorkObject

Summary

EventHandler()

EventLoop * event_loop() const

virtual EventHandler * handle_event(

const Event & event
)

protected void set_event_loop(

EventLoop * event_loop
)

Members

EventHandler()

EventLoop * event_loop() const

Returns a pointer to the element’s event loop.

If the element isn’t running in an event loop, this method will return 0.


virtual EventHandler * handle_event(

const Event & event
)

Handles an event for the currently active EventHandler.

Parameters

  • event The event to execute

Returns

Determines if the ev::EventLoop transitions to another EventHandler or stays on this one.

ev::EventLoop::execute() and ev::EventLoop::run() execute this method each time an event happens (e.g., ev::Event::UPDATE, ev::Event::SETUP, ev::Event::BUTTON_PRESSED).

If this method returns a pointer to another EventHandler, then that event handler becomes the active ev::EventHandler.


protected void set_event_loop(

EventLoop * event_loop
)


X

Thanks for Coming!

Subscribe to news and updates