42 : m_notification(notification) {}
46 template <
typename T>
void processMessage(T &p) {
47 p(m_notification.sensor);
51 ret.sensor = m_notification.sensor;
58 const char *EyeRegion::identifier() {
59 return "com.osvr.eyetracker.eyeregion";
63 shared_ptr<EyeTrackerComponent>
70 : m_numSensor(numChan) {}
77 OSVR_EyeNotification notification;
78 notification.sensor = sensor;
79 messages::EyeRegion::MessageSerialization msg(notification);
87 EyeTrackerComponent::m_handleEyeRegion(
void *userdata,
88 vrpn_HANDLERPARAM p) {
89 auto self =
static_cast<EyeTrackerComponent *
>(userdata);
92 messages::EyeRegion::MessageSerialization msg;
94 auto data = msg.getNotification();
97 for (
auto const &cb : self->m_cb) {
103 void EyeTrackerComponent::registerEyeHandler(EyeHandler handler) {
108 m_cb.push_back(handler);
110 void EyeTrackerComponent::m_parentSet() {
uint32_t OSVR_ChannelCount
The integer type specifying a number of channels/sensors or a channel/sensor index.
void deserialize(BufferReaderType &reader, MessageClass &msg)
Deserializes a message from a buffer, using a MessageClass
void serialize(BufferType &buf, MessageClass &msg)
Serializes a message into a buffer, using a MessageClass
void m_registerHandler(vrpn_MESSAGEHANDLER handler, void *userdata, RawMessageType const &msgType)
Registers a handler whose lifetime is tied to the lifetime of the component.
void fromStructTimeval(TimeValue &dest, struct timeval const &src)
Convert a struct timeval to a TimeValue.
static shared_ptr< EyeTrackerComponent > create(OSVR_ChannelCount numSensor=2)
Factory method.
Parent & m_getParent()
Gets the parent - only call if m_hasParent() is true.
Internal, configured header file for verbosity macros.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
Header defining buffer types, with optional alignment dependent on Boost version. ...
BufferReader< ExternalBufferReadingWrapper< CharType > > readExternalBuffer(const CharType *buf, size_t len)
Constructs and returns a buffer reader for an externally-allocated buffer: it's on you to supply a va...
messages::EyeRegion eyeRegion
Message from server to client, containing eye data.
void registerMessageType(MessageRegistration< T > &messageReg)
Call with a MessageRegistration object, and the message type will be registered and stored in the typ...