Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

VrpnButton Class Reference

This is the actual interface to a particular VRPN button device, and all of its numbered buttons. More...

#include <vrpnButton.h>

List of all members.

Public Member Functions

 VrpnButton (const string &button_name, vrpn_Connection *connection)
 ~VrpnButton ()
const string & get_button_name () const
 Returns the name of the button device that was used to create this VrpnButton.

bool is_empty () const
 Returns true if no VrpnButtonDevices reference this VrpnButton, or false otherwise.

void mark (VrpnButtonDevice *device)
 Adds the indicated VrpnButtonDevice to the list of devices that are sharing this VrpnButton.

void unmark (VrpnButtonDevice *device)
 Removes the indicated VrpnButtonDevice from the list of devices that are sharing this VrpnButton.

void poll ()
 Polls the connected device.

void output (ostream &out) const
void write (ostream &out, int indent_level=0) const

Private Types

typedef pvector< VrpnButtonDevice * > Devices

Static Private Member Functions

void vrpn_button_callback (void *userdata, const vrpn_BUTTONCB info)
 Receives the button event data from the VRPN code and sends it to any interested VrpnButtonDevices.


Private Attributes

string _button_name
vrpn_Button_Remote * _button
Devices _devices


Detailed Description

This is the actual interface to a particular VRPN button device, and all of its numbered buttons.

A pointer to this object is stored in the VrpnClient class for each differently-named VRPN button device we connect to.

The VRPN callbacks go here, which in turn get vectored out to any VrpnButtonDevice objects that register with this. When the last VrpnButtonDevice object unregisters, the VrpnButton will be deleted by the VrpnClient.

This class does not need to be exported from the DLL.

Definition at line 64 of file vrpnButton.h.


Member Typedef Documentation

typedef pvector<VrpnButtonDevice *> VrpnButton::Devices [private]
 

Definition at line 88 of file vrpnButton.h.


Constructor & Destructor Documentation

VrpnButton::VrpnButton const string &  button_name,
vrpn_Connection *  connection
 

Definition at line 39 of file vrpnButton.cxx.

VrpnButton::~VrpnButton  ) 
 

Definition at line 55 of file vrpnButton.cxx.

References _devices.


Member Function Documentation

const string & VrpnButton::get_button_name  )  const [inline]
 

Returns the name of the button device that was used to create this VrpnButton.

Definition at line 33 of file vrpnButton.I.

References _devices, and INLINE.

bool VrpnButton::is_empty  )  const [inline]
 

Returns true if no VrpnButtonDevices reference this VrpnButton, or false otherwise.

Definition at line 48 of file vrpnButton.I.

References _button, and INLINE.

void VrpnButton::mark VrpnButtonDevice device  ) 
 

Adds the indicated VrpnButtonDevice to the list of devices that are sharing this VrpnButton.

Definition at line 70 of file vrpnButton.cxx.

References _devices.

void VrpnButton::output ostream &  out  )  const
 

Definition at line 109 of file vrpnButton.cxx.

void VrpnButton::poll  )  [inline]
 

Polls the connected device.

Normally you should not call this directly; this will be called by the VrpnClient.

Definition at line 65 of file vrpnButton.I.

Referenced by VrpnClient::disconnect_device().

void VrpnButton::unmark VrpnButtonDevice device  ) 
 

Removes the indicated VrpnButtonDevice from the list of devices that are sharing this VrpnButton.

Definition at line 88 of file vrpnButton.cxx.

References _button_name.

void VrpnButton::vrpn_button_callback void *  userdata,
const vrpn_BUTTONCB  info
[static, private]
 

Receives the button event data from the VRPN code and sends it to any interested VrpnButtonDevices.

Definition at line 140 of file vrpnButton.cxx.

void VrpnButton::write ostream &  out,
int  indent_level = 0
const
 

Definition at line 121 of file vrpnButton.cxx.


Member Data Documentation

vrpn_Button_Remote* VrpnButton::_button [private]
 

Definition at line 86 of file vrpnButton.h.

Referenced by is_empty().

string VrpnButton::_button_name [private]
 

Definition at line 85 of file vrpnButton.h.

Referenced by unmark().

Devices VrpnButton::_devices [private]
 

Definition at line 89 of file vrpnButton.h.

Referenced by get_button_name(), mark(), and ~VrpnButton().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:56:11 2003 for Panda by doxygen1.3