25 #ifndef INCLUDED_CommonComponent_h_GUID_199AFD54_3489_4295_30F9_00B7CE33FE31 26 #define INCLUDED_CommonComponent_h_GUID_199AFD54_3489_4295_30F9_00B7CE33FE31 30 #include <osvr/Common/Export.h> 47 OSVR_COMMON_EXPORT
static const char *
identifier();
51 OSVR_COMMON_EXPORT
static const char *
identifier();
56 OSVR_COMMON_EXPORT
static const char *
identifier();
61 OSVR_COMMON_EXPORT
static const char *
identifier();
66 OSVR_COMMON_EXPORT
static const char *
identifier();
71 OSVR_COMMON_EXPORT
static const char *
identifier();
88 static OSVR_COMMON_EXPORT shared_ptr<CommonComponent> create();
90 typedef std::function<void()> Handler;
96 OSVR_COMMON_EXPORT
void registerPingHandler(Handler
const &handler);
102 OSVR_COMMON_EXPORT
void registerPongHandler(Handler
const &handler);
109 template <
typename T>
111 Handler
const &handler) {
112 auto &handlers = typepack::get<T>(m_handlers);
113 m_registerHandlerImpl(handlers, message.getMessageType(), handler);
118 void m_parentSet()
override;
120 using HandlerList = std::vector<Handler>;
121 OSVR_COMMON_EXPORT
void 122 m_registerHandlerImpl(HandlerList &handlers,
124 Handler
const &handler);
126 static int VRPN_CALLBACK m_baseHandler(
void *userdata,
130 std::vector<Handler>> m_handlers;
135 #endif // INCLUDED_CommonComponent_h_GUID_199AFD54_3489_4295_30F9_00B7CE33FE31 Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
Definition: CommonComponent.h:58
Definition: CommonComponent.h:44
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Definition: CommonComponent.h:53
A wrapper for a template parameter pack of types.
Definition: List.h:52
static OSVR_COMMON_EXPORT const char * identifier()
Definition: CommonComponent.cpp:43
A class that uses types as an index into a container with uniform-typed contents, somewhat like a map...
Definition: TypeKeyedMap.h:49
BaseDevice component, for the VRPN built-in common messages.
Definition: CommonComponent.h:82
Header with a run-time extensions to the TypePack simple template-parameter-pack-based metaprogrammin...
Definition: DeviceComponent.h:42
Definition: CommonComponent.h:63
CRTP class template wrapping message-specific data and/or logic.
Definition: MessageRegistration.h:44
Definition: CommonComponent.h:49
Definition: CommonComponent.h:68
Type-safe wrapper with built-in default for a VRPN "message type" integer.
Definition: RawMessageType.h:45
Definition: CommonComponent.h:45