Sleeping Wombat GUI  0.100
swGUI
Public Member Functions | Private Attributes | List of all members
sw::input::EventQueue< EventType > Class Template Reference

Abstraction of event queue. More...

#include <EventQueue.h>

Public Member Functions

 EventQueue ()
 
 ~EventQueue ()=default
 
void AddEvent (const EventType &event)
 Adds event on the end of queue. More...
 
void ClearReadEvents ()
 Removes all events after m_readPointer. More...
 
bool NoMoreEvents () const
 
uint32 EventsLeft () const
 
const EventType & FrontEvent () const
 Reads next event without moving read pointer. Always check if there're any events in queue left. More...
 
const EventType & PopEvent ()
 Gets next event and moves m_readPointer. More...
 
const std::vector< EventType > & GetEvents () const
 Gets whole array of events. This array consists of events to. More...
 
uint32 GetReadPointer () const
 Gets index of next event to read. More...
 

Private Attributes

std::vector< EventType > m_events
 
uint32 m_readPointer
 

Detailed Description

template<typename EventType>
class sw::input::EventQueue< EventType >

Abstraction of event queue.

This is not normal queue. You can always access events that have been already read and not cleared. Events are ersaed only by explicit call to ClearReadEvents.

Constructor & Destructor Documentation

template<typename EventType >
sw::input::EventQueue< EventType >::EventQueue ( )
inlineexplicit
template<typename EventType>
sw::input::EventQueue< EventType >::~EventQueue ( )
default

Member Function Documentation

template<typename EventType>
void sw::input::EventQueue< EventType >::AddEvent ( const EventType &  event)
inline

Adds event on the end of queue.

template<typename EventType >
void sw::input::EventQueue< EventType >::ClearReadEvents ( )
inline

Removes all events after m_readPointer.

template<typename EventType>
uint32 sw::input::EventQueue< EventType >::EventsLeft ( ) const
inline
template<typename EventType>
const EventType& sw::input::EventQueue< EventType >::FrontEvent ( ) const
inline

Reads next event without moving read pointer. Always check if there're any events in queue left.

template<typename EventType>
const std::vector< EventType >& sw::input::EventQueue< EventType >::GetEvents ( ) const
inline

Gets whole array of events. This array consists of events to.

template<typename EventType>
uint32 sw::input::EventQueue< EventType >::GetReadPointer ( ) const
inline

Gets index of next event to read.

template<typename EventType>
bool sw::input::EventQueue< EventType >::NoMoreEvents ( ) const
inline
template<typename EventType >
const EventType & sw::input::EventQueue< EventType >::PopEvent ( )
inline

Gets next event and moves m_readPointer.

Member Data Documentation

template<typename EventType>
std::vector< EventType > sw::input::EventQueue< EventType >::m_events
private
template<typename EventType>
uint32 sw::input::EventQueue< EventType >::m_readPointer
private

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