52 std::string
const &deviceName,
53 boost::optional<OSVR_ChannelCount> sensor,
54 common::InterfaceList &ifaces)
56 m_internals(ifaces), m_all(!sensor.is_initialized()),
59 m_dev->addComponent(direction);
60 direction->registerDirectionHandler(
63 m_handleDirection(data, timestamp);
65 OSVR_DEV_VERBOSE(
"Constructed an Direction Handler for "
77 virtual void update() { m_dev->update(); }
82 if (!m_all && *m_sensor != data.sensor) {
88 report.sensor = data.sensor;
89 report.direction = data.direction;
94 common::BaseDevicePtr m_dev;
95 RemoteHandlerInternals m_internals;
97 boost::optional<OSVR_ChannelCount> m_sensor;
100 DirectionRemoteFactory::DirectionRemoteFactory(
101 VRPNConnectionCollection
const &conns)
108 shared_ptr<RemoteHandler> ret;
110 if (source.hasTransform()) {
112 "Ignoring transform found on route for Direction data!");
115 auto const &devElt = source.getDeviceElement();
119 m_conns.getConnection(devElt), devElt.getFullDeviceName(),
120 source.getSensorNumberAsChannelCount(), ifaces));
The result of resolving a tree node to a device: either an original source to connect to...
BaseDevicePtr createClientDevice(std::string const &name, vrpn_ConnectionPtr const &conn)
Factory function for a bare client device with no components/interfaces registered by default...
Header including PathTree.h and all additional headers needed to define related types.
Header to bring unique_ptr into the osvr namespace.
static shared_ptr< DirectionComponent > create(OSVR_ChannelCount numSensor=1)
Factory method.
NetworkDirectionRemoteHandler & operator=(NetworkDirectionRemoteHandler const &)=delete
Deleted assignment operator.
Report type for 3D Direction vector.
shared_ptr< RemoteHandler > operator()(common::OriginalSource const &source, common::InterfaceList &ifaces, common::ClientContext &ctx)
void setStateAndTriggerCallbacks(const OSVR_TimeValue ×tamp, ReportType const &report)
Set state and call callbacks for a report type.
Internal, configured header file for verbosity macros.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
Base class for remote device handler classes.
virtual ~NetworkDirectionRemoteHandler()