| 87 | } |
| 88 | |
| 89 | int VRPN_CALLBACK |
| 90 | DirectionComponent::m_handleDirectionRecord(void *userdata, |
| 91 | vrpn_HANDLERPARAM p) { |
| 92 | auto self = static_cast<DirectionComponent *>(userdata); |
| 93 | auto bufReader = readExternalBuffer(p.buffer, p.payload_len); |
| 94 | |
| 95 | messages::DirectionRecord::MessageSerialization msg; |
| 96 | deserialize(bufReader, msg); |
| 97 | auto data = msg.getData(); |
| 98 | auto timestamp = util::time::fromStructTimeval(p.msg_time); |
| 99 | |
| 100 | for (auto const &cb : self->m_cb) { |
| 101 | cb(data, timestamp); |
| 102 | } |
| 103 | return 0; |
| 104 | } |
| 105 | |
| 106 | void |
| 107 | DirectionComponent::registerDirectionHandler(DirectionHandler handler) { |
nothing calls this directly
no test coverage detected