25 #ifndef INCLUDED_VRPNDeviceRegistration_h_GUID_1D69B168_9B9C_47B9_A9F3_9A569E9710D2 26 #define INCLUDED_VRPNDeviceRegistration_h_GUID_1D69B168_9B9C_47B9_A9F3_9A569E9710D2 29 #include <osvr/VRPNServer/Export.h> 42 class vrpn_Connection;
45 namespace vrpnserver {
46 class VRPNDeviceRegistration_impl;
52 static OSVR_ReturnCode callMainloop(
void *userdata) {
53 T *obj =
static_cast<T *
>(userdata);
68 OSVR_VRPNSERVER_EXPORT
71 OSVR_VRPNSERVER_EXPORT VRPNDeviceRegistration(
74 OSVR_VRPNSERVER_EXPORT ~VRPNDeviceRegistration();
87 OSVR_VRPNSERVER_EXPORT std::string
88 useDecoratedName(std::string
const &name);
101 m_ctx.extractOpaquePointer(), dev);
102 m_registerDevice(&detail::callMainloop<T>,
103 static_cast<void *>(dev));
118 template <
typename T>
122 return registerDevice(ret.release());
125 OSVR_VRPNSERVER_EXPORT
void 126 setDeviceDescriptor(std::string
const &jsonString);
129 OSVR_VRPNSERVER_EXPORT
void 132 unique_ptr<VRPNDeviceRegistration_impl> m_impl;
137 #endif // INCLUDED_VRPNDeviceRegistration_h_GUID_1D69B168_9B9C_47B9_A9F3_9A569E9710D2 Header providing C++ interface wrappers around functionality in PluginRegistrationC.h.
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Class providing the external interface of a registration context backing a single plugin...
Definition: PluginSpecificRegistrationContext.h:52
Header to bring unique_ptr into the osvr namespace.
T * constructAndRegisterDevice(std::string const &name)
Constructs and registers your custom device with the server and takes ownership of the object...
Definition: VRPNDeviceRegistration.h:119
Definition: VRPNDeviceRegistration.h:59
Definition: newuoa.h:1888
T * registerObjectForDeletion(OSVR_PluginRegContext ctx, T *obj)
Registers an object to be destroyed with delete when the plugin is unloaded.
Definition: PluginRegistration.h:72
#define OSVR_RETURN_SUCCESS
The "success" value for an OSVR_ReturnCode.
Definition: ReturnCodesC.h:45
OSVR_VRPNSERVER_EXPORT vrpn_Connection * getVRPNConnection(OSVR_PluginRegContext ctx)
Retrieves the vrpn_Connection pointer from an OSVR_PluginRegContext.
Definition: GetVRPNConnection.cpp:39
Header declaring the opaque plugin registration context type.
A small structure to hold a non zero as a triplet (i,j,value).
Definition: SparseUtil.h:148
OSVR_ReturnCode(* OSVR_DeviceUpdateCallback)(void *userData)
Function type of a Device Update callback.
Definition: DeviceCallbackTypesC.h:48
T * registerDevice(T *dev)
Registers your custom device with the server and takes ownership of the object.
Definition: VRPNDeviceRegistration.h:99
OSVR_EXTERN_C_BEGIN typedef void * OSVR_PluginRegContext
A context pointer passed in to your plugin's entry point and other locations of control flow transfer...
Definition: PluginRegContextC.h:47