OSVR-Core
|
RAII class template managing a message handler callback. More...
#include <MessageHandler.h>
Public Types | |
typedef MessageTraits::handler_type | handler_type |
typedef MessageTraits::registration_type | registration_type |
Public Member Functions | |
MessageHandler (handler_type handler, void *userdata=nullptr, RawSenderType sender=RawSenderType(), RawMessageType msgType=RawMessageType()) | |
Constructor taking your handler's basic info, and optionally a sender, and optionally a message type. | |
MessageHandler (handler_type handler, void *userdata, RawMessageType msgType) | |
Constructor taking your handler's basic info and a message type. More... | |
void | unregisterHandler () |
Method if you want to manually unregister your handler. More... | |
void | registerHandler (registration_type reg) |
Register handler on the given registration policy value. | |
~MessageHandler () | |
destructor: automatically unregisters handler. | |
RAII class template managing a message handler callback.
MessageTraits | Policy class, providing a handler_type typedef (function pointer type of this hander) and a registration_type type (holder class, passed in and stored by value on registration. Must contain registerHandler and unregisterHandler methods taking the arguments (HandlerType, void*, RawSenderType, RawMessageType) ) |
|
inline |
Constructor taking your handler's basic info and a message type.
Provided as an overload to take care of the case when only a message type is passed.
|
inline |
Method if you want to manually unregister your handler.
Automatically done when object is destroyed. No effect if called before registerHandler()