GUI
Classes | Public Member Functions | Private Attributes | List of all members
gui::EventQueue Class Reference

GUISystem's internal event queue; collects fired events and affiliates them with particular event listener. More...

#include <EventQueue.h>

Classes

struct  Entry
 EventQueue's inner class that contains an Event object and event listener it's destined. More...
 

Public Member Functions

 EventQueue ()
 
 ~EventQueue ()
 
void addToQueue (Event &&event, EventListener eventListener)
 Adds an event to the queue and affiliated event listener. More...
 
bool empty ()
 Is queue empty. More...
 
Event getNextEvent (EventListener &eventListener)
 Pops an event from the queue. The returned event is removed from the queue. More...
 

Private Attributes

std::queue< Entryqueue
 

Detailed Description

GUISystem's internal event queue; collects fired events and affiliates them with particular event listener.

Definition at line 21 of file EventQueue.h.

Constructor & Destructor Documentation

◆ EventQueue()

gui::EventQueue::EventQueue ( )
inline

Definition at line 24 of file EventQueue.h.

◆ ~EventQueue()

gui::EventQueue::~EventQueue ( )
inline

Definition at line 25 of file EventQueue.h.

References addToQueue(), empty(), and getNextEvent().

Member Function Documentation

◆ addToQueue()

void EventQueue::addToQueue ( Event &&  event,
EventListener  eventListener 
)

Adds an event to the queue and affiliated event listener.

Parameters
eventThe event
eventListenerEventListener handling the event

Definition at line 9 of file EventQueue.cpp.

References queue.

◆ empty()

bool EventQueue::empty ( )

Is queue empty.

Returns
Returns true if the queue is empty.

Definition at line 14 of file EventQueue.cpp.

References queue.

◆ getNextEvent()

Event EventQueue::getNextEvent ( EventListener eventListener)

Pops an event from the queue. The returned event is removed from the queue.

Parameters
eventListenerReference to EventListener handling the event.
Returns
Event

Definition at line 19 of file EventQueue.cpp.

References gui::EventQueue::Entry::event, gui::EventQueue::Entry::eventListener, and queue.

Member Data Documentation

◆ queue

std::queue<Entry> gui::EventQueue::queue
private

Definition at line 76 of file EventQueue.h.


The documentation for this class was generated from the following files: