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

VrpnAnalog Class Reference

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

#include <vrpnAnalog.h>

List of all members.

Public Member Functions

 VrpnAnalog (const string &analog_name, vrpn_Connection *connection)
 ~VrpnAnalog ()
const string & get_analog_name () const
 Returns the name of the analog device that was used to create this VrpnAnalog.

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

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

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

void poll ()
 Polls the connected device.

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

Private Types

typedef pvector< VrpnAnalogDevice * > Devices

Static Private Member Functions

void vrpn_analog_callback (void *userdata, const vrpn_ANALOGCB info)
 Receives the analog event data from the VRPN code and sends it to any interested VrpnAnalogDevices.


Private Attributes

string _analog_name
vrpn_Analog_Remote * _analog
Devices _devices


Detailed Description

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

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

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

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

Definition at line 64 of file vrpnAnalog.h.


Member Typedef Documentation

typedef pvector<VrpnAnalogDevice *> VrpnAnalog::Devices [private]
 

Definition at line 88 of file vrpnAnalog.h.


Constructor & Destructor Documentation

VrpnAnalog::VrpnAnalog const string &  analog_name,
vrpn_Connection *  connection
 

Definition at line 39 of file vrpnAnalog.cxx.

VrpnAnalog::~VrpnAnalog  ) 
 

Definition at line 55 of file vrpnAnalog.cxx.

References _devices.


Member Function Documentation

const string & VrpnAnalog::get_analog_name  )  const [inline]
 

Returns the name of the analog device that was used to create this VrpnAnalog.

Definition at line 33 of file vrpnAnalog.I.

References _devices, and INLINE.

bool VrpnAnalog::is_empty  )  const [inline]
 

Returns true if no VrpnAnalogDevices reference this VrpnAnalog, or false otherwise.

Definition at line 48 of file vrpnAnalog.I.

References _analog, and INLINE.

void VrpnAnalog::mark VrpnAnalogDevice device  ) 
 

Adds the indicated VrpnAnalogDevice to the list of devices that are sharing this VrpnAnalog.

Definition at line 70 of file vrpnAnalog.cxx.

References _devices.

void VrpnAnalog::output ostream &  out  )  const
 

Definition at line 109 of file vrpnAnalog.cxx.

References _devices.

void VrpnAnalog::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 vrpnAnalog.I.

Referenced by VrpnClient::disconnect_device().

void VrpnAnalog::unmark VrpnAnalogDevice device  ) 
 

Removes the indicated VrpnAnalogDevice from the list of devices that are sharing this VrpnAnalog.

Definition at line 88 of file vrpnAnalog.cxx.

References _analog_name.

void VrpnAnalog::vrpn_analog_callback void *  userdata,
const vrpn_ANALOGCB  info
[static, private]
 

Receives the analog event data from the VRPN code and sends it to any interested VrpnAnalogDevices.

Definition at line 140 of file vrpnAnalog.cxx.

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

Definition at line 121 of file vrpnAnalog.cxx.


Member Data Documentation

vrpn_Analog_Remote* VrpnAnalog::_analog [private]
 

Definition at line 86 of file vrpnAnalog.h.

Referenced by is_empty().

string VrpnAnalog::_analog_name [private]
 

Definition at line 85 of file vrpnAnalog.h.

Referenced by unmark().

Devices VrpnAnalog::_devices [private]
 

Definition at line 89 of file vrpnAnalog.h.

Referenced by get_analog_name(), mark(), output(), and ~VrpnAnalog().


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