25 #ifndef INCLUDED_DeviceToken_h_GUID_428B015C_19A2_46B0_CFE6_CC100763D387 26 #define INCLUDED_DeviceToken_h_GUID_428B015C_19A2_46B0_CFE6_CC100763D387 31 #include <osvr/Connection/Export.h> 42 #include <boost/noncopyable.hpp> 49 namespace connection {
50 typedef std::function<OSVR_ReturnCode()> DeviceUpdateCallback;
63 OSVR_CONNECTION_EXPORT
static osvr::connection::DeviceTokenPtr
67 OSVR_CONNECTION_EXPORT
static osvr::connection::DeviceTokenPtr
72 OSVR_CONNECTION_EXPORT
static osvr::connection::DeviceTokenPtr
73 createVirtualDevice(std::string
const &name,
77 using EventFunction = std::function<void()>;
83 OSVR_CONNECTION_EXPORT std::string
const &getName()
const;
86 OSVR_CONNECTION_EXPORT
void 87 setUpdateCallback(osvr::connection::DeviceUpdateCallback
const &cb);
91 OSVR_CONNECTION_EXPORT
void 92 setPreConnectionInteract(EventFunction
const &f);
103 const char *bytestream,
size_t len);
110 OSVR_CONNECTION_EXPORT
void 115 OSVR_CONNECTION_EXPORT osvr::util::GuardPtr getSendGuard();
119 void connectionInteract();
125 OSVR_CONNECTION_EXPORT
void 126 setDeviceDescriptor(std::string
const &jsonString);
131 return m_ownedObjects.acquire(obj);
138 OSVR_CONNECTION_EXPORT
bool releaseObject(
void *obj);
145 m_setUpdateCallback(osvr::connection::DeviceUpdateCallback
const &cb) = 0;
148 const char *bytestream,
size_t len) = 0;
149 virtual osvr::util::GuardPtr m_getSendGuard() = 0;
150 virtual void m_connectionInteract() = 0;
151 virtual void m_stopThreads();
155 std::string
const m_name;
158 osvr::connection::ServerInterfaceList m_serverInterfaces;
159 EventFunction m_preConnectionInteract;
163 #endif // INCLUDED_DeviceToken_h_GUID_428B015C_19A2_46B0_CFE6_CC100763D387 Header forward declaring MessageType and specifying a smart pointer.
A DeviceToken connects the generic device interaction code in PluginKit's C API with the workings of ...
Definition: DeviceToken.h:56
Header forward-declaring ConnectionDevice and specifying the desired pointer to hold a ConnectionDevi...
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
shared_ptr< Connection > ConnectionPtr
How one must hold a Connection.
Definition: ConnectionPtr.h:40
Structure used internally to construct the desired type of device.
Definition: DeviceInitObject.h:59
Base class for connection-specific message type registration.
Definition: MessageType.h:38
Holds on to smart pointers by value, and lets you free them by providing the corresponding void *...
Definition: KeyedOwnershipContainer.h:83
Header declaring device callback types.
Header providing a C++ wrapper around TimeValueC.h.
shared_ptr< ConnectionDevice > ConnectionDevicePtr
How to hold on to a ConnectionDevice.
Definition: ConnectionDevicePtr.h:40
void * acquireObject(T obj)
Pass (smart-pointer) ownership of some object to the client context.
Definition: DeviceToken.h:130
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
Definition: TimeValueC.h:81
Header forward-declaring Connection and specifying the smart pointer to hold a Connection in...