Public Member Functions

a5::Event_Queue Class Reference
[Event]

Processes events from Event_Sources. More...

#include <Event.hpp>

List of all members.

Public Member Functions

 Event_Queue ()
 Creates a new event queue.
std::auto_ptr< EventHandle (ALLEGRO_EVENT *raw_event) const
 Checks a raw ALLEGRO_EVENT through the event source handlers Returns NULL if no source handlers caused the event.
std::auto_ptr< EventWait ()
 Waits forever for an event.
std::auto_ptr< EventWait (double seconds)
 Waits for an event for a specified number of seconds Returns NULL if the timer expires.
std::auto_ptr< EventGet ()
 Checks for and returns an event. Returns NULL if the queue is empty.
std::auto_ptr< EventPeek ()
 Checks for and returns an event.
bool Empty () const
 Returns true if the event queue is empty.
void Flush ()
 Removes all events from the queue.
bool Drop ()
 Removes the next even from the queue. Returns true if an event was dropped.
void Register (Event_Source &source)
 Registers an event source.
void Unregister (Event_Source &source)
 Unregisters an event source.
ALLEGRO_EVENT_QUEUE * Release ()
 Releases the held C structure so it is no longer automatically freed.
 ~Event_Queue ()
 Unregisters any event sources and frees resources.
 operator ALLEGRO_EVENT_QUEUE * () const
 Returns a pointer to the Allegro event queue structure.

Detailed Description

Processes events from Event_Sources.


Constructor & Destructor Documentation

a5::Event_Queue::Event_Queue (  ) 

Creates a new event queue.

a5::Event_Queue::~Event_Queue (  ) 

Unregisters any event sources and frees resources.


Member Function Documentation

std::auto_ptr<Event> a5::Event_Queue::Handle ( ALLEGRO_EVENT *  raw_event  )  const

Checks a raw ALLEGRO_EVENT through the event source handlers Returns NULL if no source handlers caused the event.

std::auto_ptr<Event> a5::Event_Queue::Wait (  ) 

Waits forever for an event.

std::auto_ptr<Event> a5::Event_Queue::Wait ( double  seconds  ) 

Waits for an event for a specified number of seconds Returns NULL if the timer expires.

std::auto_ptr<Event> a5::Event_Queue::Get (  ) 

Checks for and returns an event. Returns NULL if the queue is empty.

std::auto_ptr<Event> a5::Event_Queue::Peek (  ) 

Checks for and returns an event.

The event remains in the queue. Returns NULL if the queue is empty

bool a5::Event_Queue::Empty (  )  const

Returns true if the event queue is empty.

void a5::Event_Queue::Flush (  ) 

Removes all events from the queue.

bool a5::Event_Queue::Drop (  ) 

Removes the next even from the queue. Returns true if an event was dropped.

void a5::Event_Queue::Register ( Event_Source source  ) 

Registers an event source.

void a5::Event_Queue::Unregister ( Event_Source source  ) 

Unregisters an event source.

ALLEGRO_EVENT_QUEUE* a5::Event_Queue::Release (  ) 

Releases the held C structure so it is no longer automatically freed.

a5::Event_Queue::operator ALLEGRO_EVENT_QUEUE * (  )  const

Returns a pointer to the Allegro event queue structure.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines