MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / m_handleDirectionRecord

Method m_handleDirectionRecord

src/osvr/Common/DirectionComponent.cpp:89–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 4

readExternalBufferFunction · 0.85
deserializeFunction · 0.85
fromStructTimevalFunction · 0.85
getDataMethod · 0.45

Tested by

no test coverage detected