27 VrpnAnalog(
const std::string &analog_name, vrpn_Connection *connection) :
28 _analog_name(analog_name)
30 _analog =
new vrpn_Analog_Remote(_analog_name.c_str(), connection);
32 _analog->register_change_handler((
void*)
this, &vrpn_analog_callback);
49 if (vrpn_cat.is_debug()) {
50 vrpn_cat.debug() << *
this <<
" marking " << *device <<
"\n";
52 _devices.push_back(device);
61 if (vrpn_cat.is_debug()) {
62 vrpn_cat.debug() << *
this <<
" unmarking " << *device <<
"\n";
65 Devices::iterator di =
66 find(_devices.begin(), _devices.end(), device);
68 if (di != _devices.end()) {
77 output(std::ostream &out)
const {
85 write(std::ostream &out,
int indent_level)
const {
88 << _devices.size() <<
" devices)\n";
95 void VRPN_CALLBACK VrpnAnalog::
96 vrpn_analog_callback(
void *userdata,
const vrpn_ANALOGCB info) {
100 for (di = self->_devices.begin(); di !=
self->_devices.end(); ++di) {
102 for (
int i = 0; i < info.num_channel; i++) {
103 device->set_axis_value(i, info.channel[i]);