OSVR-Core
Public Member Functions | List of all members
osvr::pluginkit::PluginContext Class Reference

C++ wrapper class for the opaque plugin context. More...

#include <PluginKit.h>

Public Member Functions

 PluginContext (OSVR_PluginRegContext ctx)
 Constructor of the context wrapper object.
 
template<typename T >
void registerHardwareDetectCallback (T functor)
 Register a hardware detect callback. More...
 
template<typename T >
void registerDriverInstantiationCallback (const char driverName[], T functor)
 Register a driver instantiation callback. More...
 
template<typename T >
TregisterObjectForDeletion (T *obj)
 Register the given object (assumed to be deletable by delete) to be deleted on plugin unload. More...
 
void log (OSVR_LogLevel severity, const char *message)
 Log a message to the plugin-specific channel. More...
 

Detailed Description

C++ wrapper class for the opaque plugin context.

This class provides no additional functionality beyond the free functions available in this namespace, it just provides syntactic sugar.

Member Function Documentation

§ log()

void osvr::pluginkit::PluginContext::log ( OSVR_LogLevel  severity,
const char *  message 
)
inline

Log a message to the plugin-specific channel.

Parameters
severityThe severity of the log message.
messageThe message to be logged.

§ registerDriverInstantiationCallback()

template<typename T >
void osvr::pluginkit::PluginContext::registerDriverInstantiationCallback ( const char  driverName[],
T  functor 
)
inline

Register a driver instantiation callback.

Your callback should take a parameter of type OSVR_PluginRegContext and a parameter of type const char * (the JSON parameters as a string) and return a value of type ::OSVR_ReturnCode

See also
osvr::pluginkit::registerDriverInstantiationCallback()

§ registerHardwareDetectCallback()

template<typename T >
void osvr::pluginkit::PluginContext::registerHardwareDetectCallback ( T  functor)
inline

Register a hardware detect callback.

Your callback should take one parameter of type OSVR_PluginRegContext and return a value of type ::OSVR_ReturnCode

See also
osvr::pluginkit::registerHardwareDetectCallback()

§ registerObjectForDeletion()

template<typename T >
T* osvr::pluginkit::PluginContext::registerObjectForDeletion ( T obj)
inline

Register the given object (assumed to be deletable by delete) to be deleted on plugin unload.

(Transfers lifetime control to the plugin context)

See also
osvr::pluginkit::registerObjectForDeletion

The documentation for this class was generated from the following file: