30 #include <boost/assert.hpp>
40 BOOST_ASSERT_MSG(
nullptr == m_parent,
41 "recordParent should only be called once!");
57 auto h = make_shared<MessageHandler<BaseDeviceMessageHandleTraits> >(
58 handler, userdata, msgType);
60 m_messageHandlers.push_back(h);
Class used as an interface for underlying devices that can have device components (corresponding to i...
void m_registerHandler(vrpn_MESSAGEHANDLER handler, void *userdata, RawMessageType const &msgType)
Registers a handler whose lifetime is tied to the lifetime of the component.
virtual void m_update()
Implementation-specific (optional) stuff to do during mainloop.
virtual void m_parentSet()=0
Called once when we have a parent.
bool m_hasParent() const
Returns true if we have a parent registered.
Parent & m_getParent()
Gets the parent - only call if m_hasParent() is true.
void recordParent(Parent &dev)
Called (only) by BaseDevice when being added: effectively records a "parent pointer" that does not co...
Type-safe wrapper with built-in default for a VRPN "message type" integer.
void update()
Called during mainloop.
DeviceComponent()
Protected constructor, to require subclassing.