Public Member Functions | Private Attributes

Event Class Reference

A container class for storing information about an Event. More...

#include <Event.h>

List of all members.

Public Member Functions

 Event (EventType type, int value1, int value2, const std::string &id="")
 Event ()
 Event (const Event &event)
Eventoperator= (const Event &rhs)
EventType getType () const
const std::string & getId () const
int getFirst () const
int getSecond () const
void consume ()
bool isConsumed ()

Private Attributes

EventType mEventType
std::string mId
int mValue1
int mValue2
bool mConsumed

Detailed Description

A container class for storing information about an Event.

Events are the low-level messages used to grab events like keypresses, mouse clicks and joystick motion. Depending on the type of event the values of first and second will change.

Keydown/Keyup Events

Mouse Motion Events

Mouse Button Events

Mouse Wheel Events

Todo:
Finish documenting the various interpretations of the Event class.

Constructor & Destructor Documentation

Event::Event ( EventType  type,
int  value1,
int  value2,
const std::string &  id = "" 
) [inline]

The typically used Constructor.

Parameters:
type Must be of type EventType.
value1 An integer value. Meaning varies between messages. See Event.
value2 An integer value. Meaning varies between messages. See Event.
id A string containing an Event ID. Generally used by the Gui.
Event::Event (  )  [inline]

Constructor for building a NULL event.

Event::Event ( const Event event  )  [inline]

Copy Constructor.

Instantiate an Event from an existing Event.

Parameters:
event A reference to an Event object.

Member Function Documentation

void Event::consume (  )  [inline]

Flags this Event as used.

int Event::getFirst (  )  const [inline]

Returns the First value.

const std::string& Event::getId (  )  const [inline]

Returns the Message ID.

int Event::getSecond (  )  const [inline]

Returns the Second value.

EventType Event::getType (  )  const [inline]

Returns the Message Type.

bool Event::isConsumed (  )  [inline]

Indicates whether or not this Event has been consumed.

Event& Event::operator= ( const Event rhs  )  [inline]

Assignment Operator.

Create a copy of an Event from an existing Event.

Parameters:
rhs A reference to an Event.

Member Data Documentation

bool Event::mConsumed [private]

Internal flag indicating whether this event has been used.

Event Type.

std::string Event::mId [private]

Event ID.

int Event::mValue1 [private]

Value 1.

int Event::mValue2 [private]

Value 2.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines