OSVR-Core  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
osvr::pluginkit::PluginContext Class Reference

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

#include <osvr/PluginKit/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 >
T * registerObjectForDeletion (T *obj)
 Register the given object (assumed to be deletable by delete) to be deleted on plugin unload. (Transfers lifetime control to the plugin context) 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.

Definition at line 59 of file PluginKit.h.

Member Function Documentation

template<typename T >
void osvr::pluginkit::PluginContext::registerHardwareDetectCallback ( 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()

Definition at line 70 of file PluginKit.h.

template<typename T >
void osvr::pluginkit::PluginContext::registerDriverInstantiationCallback ( const char  driverName[],
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()

Definition at line 83 of file PluginKit.h.

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

Definition at line 93 of file PluginKit.h.

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.

Definition at line 101 of file PluginKit.h.


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