| 57 | public: |
| 58 | typedef util::ValueOrRange<int> RangeType; |
| 59 | VRPNAnalogHandler(vrpn_ConnectionPtr const &conn, const char *src, |
| 60 | boost::optional<int> sensor, |
| 61 | common::InterfaceList &ifaces) |
| 62 | : m_remote(new vrpn_Analog_Remote(src, conn.get())), |
| 63 | m_interfaces(ifaces), m_all(!sensor.is_initialized()) { |
| 64 | m_remote->register_change_handler(this, &VRPNAnalogHandler::handle); |
| 65 | OSVR_DEV_VERBOSE("Constructed an AnalogHandler for " << src); |
| 66 | |
| 67 | if (sensor.is_initialized()) { |
| 68 | m_sensors.setValue(*sensor); |
| 69 | } |
| 70 | } |
| 71 | virtual ~VRPNAnalogHandler() { |
| 72 | m_remote->unregister_change_handler(this, |
| 73 | &VRPNAnalogHandler::handle); |