Main Page   Class Hierarchy   Compound List   File List   Header Files   Compound Members   File Members  

vrpn_Button Class Reference

This is the base class for both the client and server for a button device (a device with one or more boolean switches). More...

#include <vrpn_Button.h>

Class diagram for vrpn_Button:

vrpn_BaseClass vrpn_BaseClassUnique vrpn_Wanda vrpn_Tng3 vrpn_Spaceball vrpn_Magellan vrpn_Joystick vrpn_Joylin vrpn_ImmersionBox vrpn_CerealBox vrpn_Button_Remote vrpn_Button_Filter

List of all members.


Public Members

 vrpn_Button (const char *name, vrpn_Connection *c = NULL)
virtual ~vrpn_Button (void)
void print (void)
virtual void set_momentary (vrpn_int32 which_button)
virtual void set_toggle (vrpn_int32 which_button, vrpn_int32 current_state)
virtual void set_all_momentary (void)
virtual void set_all_toggle (vrpn_int32 default_state)

Protected Members

virtual int register_types (void)
Register the types of messages this device sends/receives. Return 0 on success, -1 on fail.

virtual void report_changes (void)
virtual vrpn_int32 encode_to (char *buf, vrpn_int32 button, vrpn_int32 state)
Encode a message describing the new state of a button. More...

unsigned char buttons [vrpn_BUTTON_MAX_BUTTONS]
unsigned char lastbuttons [vrpn_BUTTON_MAX_BUTTONS]
vrpn_int32 minrate [vrpn_BUTTON_MAX_BUTTONS]
vrpn_int32 num_buttons
struct timeval timestamp
vrpn_int32 change_message_id
vrpn_int32 admin_message_id

Detailed Description

This is the base class for both the client and server for a button device (a device with one or more boolean switches).

Any server should actually derive from the vrpn_Button_Filter class, described next, which enables toggling any of the buttons. *


Member Function Documentation

vrpn_Button::vrpn_Button (const char * name, vrpn_Connection * c = NULL)

vrpn_Button::~vrpn_Button (void) [virtual]

void vrpn_Button::print (void)

void vrpn_Button::set_momentary (vrpn_int32 which_button) [virtual]

Reimplemented in vrpn_Button_Filter.

void vrpn_Button::set_toggle (vrpn_int32 which_button, vrpn_int32 current_state) [virtual]

Reimplemented in vrpn_Button_Filter.

void vrpn_Button::set_all_momentary (void) [virtual]

Reimplemented in vrpn_Button_Filter.

void vrpn_Button::set_all_toggle (vrpn_int32 default_state) [virtual]

Reimplemented in vrpn_Button_Filter.

int vrpn_Button::register_types (void) [protected, virtual]

Register the types of messages this device sends/receives. Return 0 on success, -1 on fail.

Reimplemented from vrpn_BaseClass.

void vrpn_Button::report_changes (void) [protected, virtual]

Reimplemented in vrpn_Button_Filter.

vrpn_int32 vrpn_Button::encode_to (char * buf, vrpn_int32 button, vrpn_int32 state) [protected, virtual]

Encode a message describing the new state of a button.

Assumes that there is enough room in the buffer to hold the bytes from the message. Returns the number of bytes sent.


Member Data Documentation

unsigned char vrpn_Button::buttons[vrpn_BUTTON_MAX_BUTTONS] [protected]

unsigned char vrpn_Button::lastbuttons[vrpn_BUTTON_MAX_BUTTONS] [protected]

vrpn_int32 vrpn_Button::minrate[vrpn_BUTTON_MAX_BUTTONS] [protected]

vrpn_int32 vrpn_Button::num_buttons [protected]

struct timeval vrpn_Button::timestamp [protected]

Reimplemented in vrpn_CerealBox, vrpn_ImmersionBox, vrpn_Magellan, and vrpn_Spaceball.

vrpn_int32 vrpn_Button::change_message_id [protected]

vrpn_int32 vrpn_Button::admin_message_id [protected]


The documentation for this class was generated from the following files:
Generated at Fri Sep 13 15:03:59 2002 for vrpn by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999