Engine::InputHandler Class Reference

Coordinate all the InputDevices. More...

#include <InputHandler.h>

List of all members.

Public Member Functions

virtual ~InputHandler ()
void set_scene (Scene &scene)
void poll ()
iterator begin ()
 Get an iterator to the first input device.
iterator end ()
 Get an iterator to one past the last input device.
std::size_t get_number_of_devices () const
 Get the number of devices found.
iterator add_device (InputDevice &device)
 Use an input device.
void remove_device (InputDevice &device)
 Stop using an input device.
void remove_device (iterator it)
 Stop using an input device.

Static Public Member Functions

static InputHandlerget_instance ()

Private Member Functions

 InputHandler ()
void init ()
 Initalise keyboard and joystick devices.

Private Attributes

std::set< InputDevice * > devices
Scenescene
InputDeviceKeyboardkeyboard
std::vector< InputDeviceJoystick * > joysticks
 a list of joystick devices avaliable on the system.

Classes

class  iterator


Detailed Description

Coordinate all the InputDevices.

Definition at line 25 of file InputHandler.h.


Constructor & Destructor Documentation

Engine::InputHandler::~InputHandler (  )  [virtual]

Definition at line 51 of file InputHandler.cpp.

Engine::InputHandler::InputHandler (  )  [private]

Definition at line 21 of file InputHandler.cpp.


Member Function Documentation

InputHandler::iterator Engine::InputHandler::add_device ( InputDevice device  ) 

Use an input device.

Call remove_device() with the same object or with the returned iterator when done.

Returns:
iterator pointing to the new device.

Definition at line 70 of file InputHandler.cpp.

InputHandler::iterator Engine::InputHandler::begin (  ) 

Get an iterator to the first input device.

Definition at line 107 of file InputHandler.cpp.

InputHandler::iterator Engine::InputHandler::end (  ) 

Get an iterator to one past the last input device.

Definition at line 112 of file InputHandler.cpp.

InputHandler & Engine::InputHandler::get_instance (  )  [static]

Definition at line 63 of file InputHandler.cpp.

std::size_t Engine::InputHandler::get_number_of_devices (  )  const

Get the number of devices found.

Definition at line 117 of file InputHandler.cpp.

void Engine::InputHandler::init (  )  [private]

Initalise keyboard and joystick devices.

Todo:
check for notifications from new usb & bluetooth devices

Definition at line 27 of file InputHandler.cpp.

void Engine::InputHandler::poll (  ) 

Definition at line 98 of file InputHandler.cpp.

void Engine::InputHandler::remove_device ( iterator  it  ) 

Stop using an input device.

Definition at line 79 of file InputHandler.cpp.

void Engine::InputHandler::remove_device ( InputDevice device  ) 

Stop using an input device.

Definition at line 84 of file InputHandler.cpp.

void Engine::InputHandler::set_scene ( Scene scene  ) 

Definition at line 89 of file InputHandler.cpp.


Member Data Documentation

std::set<InputDevice *> Engine::InputHandler::devices [private]

Definition at line 77 of file InputHandler.h.

std::vector<InputDeviceJoystick *> Engine::InputHandler::joysticks [private]

a list of joystick devices avaliable on the system.

Definition at line 85 of file InputHandler.h.

InputDeviceKeyboard* Engine::InputHandler::keyboard [private]

Definition at line 82 of file InputHandler.h.

Scene* Engine::InputHandler::scene [private]

Definition at line 80 of file InputHandler.h.


The documentation for this class was generated from the following files:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:17 2010 by Doxygen version 1.4.7 for Racer version svn335.