GameController Class Reference

List of all members.

Detailed Description

Definition at line 11 of file GameController.H.

Public Member Functions

 GameController (const std::string &device="/dev/input/js0")
 ~GameController ()
const std::string & name () const
int numAxes () const
int numButtons () const
int axis (const int number) const
int axis (std::string name)
bool button (const int number) const
bool button (std::string name)
void setAxisMap (int, std::string)
void setButtonMap (int, std::string)
int getAxisMapping (std::string name)
int getButtonMapping (std::string name)

Private Member Functions

 GameController (const GameController &controller)
GameControlleroperator= (const GameController &controller)

Static Private Member Functions

static void * readThread (void *ptr)

Private Attributes

int m_fd
std::string m_name
int m_axes
int m_buttons
int m_driver_version
int * m_axis_data
boost::dynamic_bitset m_button_data
pthread_t m_read_thread
std::map< std::string, int > buttonMap
std::map< std::string, int > axisMap


Constructor & Destructor Documentation

GameController ( const std::string &  device = "/dev/input/js0"  ) 

Definition at line 15 of file GameController.cpp.

References WURDE::g_logdebug, m_axes, m_axis_data, m_button_data, m_buttons, m_driver_version, m_fd, m_name, m_read_thread, and readThread().

~GameController (  ) 

Definition at line 50 of file GameController.cpp.

References m_axis_data, and m_fd.

GameController ( const GameController controller  )  [private]


Member Function Documentation

const std::string& name (  )  const [inline]

Definition at line 16 of file GameController.H.

References m_name.

Referenced by configureJoystick(), and readThread().

int numAxes (  )  const [inline]

Definition at line 17 of file GameController.H.

References m_axes.

Referenced by main().

int numButtons (  )  const [inline]

Definition at line 18 of file GameController.H.

References m_buttons.

Referenced by main().

int axis ( const int  number  )  const [inline]

Definition at line 20 of file GameController.H.

References assert_range, m_axes, and m_axis_data.

Referenced by axis(), and main().

int axis ( std::string  name  )  [inline]

Definition at line 21 of file GameController.H.

References axis(), and axisMap.

bool button ( const int  number  )  const [inline]

Definition at line 22 of file GameController.H.

References assert_range, m_button_data, and m_buttons.

Referenced by button(), and main().

bool button ( std::string  name  )  [inline]

Definition at line 23 of file GameController.H.

References button(), and buttonMap.

void setAxisMap ( int  ,
std::string   
)

Definition at line 57 of file GameController.cpp.

References axisMap, and m_axes.

Referenced by configureJoystick().

void setButtonMap ( int  ,
std::string   
)

Definition at line 63 of file GameController.cpp.

References buttonMap, and m_buttons.

Referenced by configureJoystick().

int getAxisMapping ( std::string  name  )  [inline]

Definition at line 34 of file GameController.H.

References axisMap.

int getButtonMapping ( std::string  name  )  [inline]

Definition at line 35 of file GameController.H.

References buttonMap.

void * readThread ( void *  ptr  )  [static, private]

Definition at line 71 of file GameController.cpp.

References WURDE::g_logdebug, m_axes, m_axis_data, m_button_data, m_buttons, m_fd, and name().

Referenced by GameController().

GameController& operator= ( const GameController controller  )  [private]


Member Data Documentation

int m_fd [private]

Definition at line 41 of file GameController.H.

Referenced by GameController(), readThread(), and ~GameController().

std::string m_name [private]

Definition at line 44 of file GameController.H.

Referenced by GameController(), and name().

int m_axes [private]

Definition at line 45 of file GameController.H.

Referenced by axis(), GameController(), numAxes(), readThread(), and setAxisMap().

int m_buttons [private]

Definition at line 46 of file GameController.H.

Referenced by button(), GameController(), numButtons(), readThread(), and setButtonMap().

int m_driver_version [private]

Definition at line 47 of file GameController.H.

Referenced by GameController().

int* m_axis_data [private]

Definition at line 50 of file GameController.H.

Referenced by axis(), GameController(), readThread(), and ~GameController().

boost::dynamic_bitset m_button_data [private]

Definition at line 51 of file GameController.H.

Referenced by button(), GameController(), and readThread().

pthread_t m_read_thread [private]

Definition at line 54 of file GameController.H.

Referenced by GameController().

std::map<std::string,int> buttonMap [private]

Definition at line 57 of file GameController.H.

Referenced by button(), getButtonMapping(), and setButtonMap().

std::map<std::string,int> axisMap [private]

Definition at line 58 of file GameController.H.

Referenced by axis(), getAxisMapping(), and setAxisMap().


The documentation for this class was generated from the following files:
Generated on Thu Feb 1 15:31:55 2007 for WURDE by  doxygen 1.5.1