OSVR-Core
|
Class providing the external interface of a registration context backing a single plugin. More...
#include <PluginSpecificRegistrationContext.h>
Public Member Functions | |
OSVR_PLUGINHOST_EXPORT OSVR_PluginRegContext | extractOpaquePointer () |
Extracts the opaque pointer for this interface to send to C. | |
virtual OSVR_PLUGINHOST_EXPORT | ~PluginSpecificRegistrationContext () |
Destructor. | |
virtual OSVR_PLUGINHOST_EXPORT RegistrationContext & | getParent ()=0 |
Get parent registration context. More... | |
virtual OSVR_PLUGINHOST_EXPORT RegistrationContext const & | getParent () const =0 |
Get parent registration context. More... | |
virtual OSVR_PLUGINHOST_EXPORT util::AnyMap & | data ()=0 |
Access the data storage map. | |
virtual OSVR_PLUGINHOST_EXPORT util::AnyMap const & | data () const =0 |
Const access the data storage map. | |
OSVR_PLUGINHOST_EXPORT const std::string & | getName () const |
Accessor for plugin name. | |
OSVR_PLUGINHOST_EXPORT void | log (util::log::LogLevel severity, const char *message) |
Log a message to the plugin-specific channel. More... | |
Plugin API | |
Called by the C API wrappers in the plugin registration headers. | |
virtual OSVR_PLUGINHOST_EXPORT void | registerDataWithDeleteCallback (OSVR_PluginDataDeleteCallback deleteCallback, void *pluginData)=0 |
Register data and a delete callback to be called on plugin unload. More... | |
template<typename T > | |
T * | registerDataWithGenericDelete (T *data) |
Register data allocated with new to be deleted on plugin unload. More... | |
virtual OSVR_PLUGINHOST_EXPORT void | registerHardwareDetectCallback (OSVR_HardwareDetectCallback detectCallback, void *userData)=0 |
Register a callback to be invoked on some hardware detection event. More... | |
virtual OSVR_PLUGINHOST_EXPORT void | registerDriverInstantiationCallback (const char *name, OSVR_DriverInstantiationCallback constructor, void *userData)=0 |
Register a callback for constructing a driver by name with parameters. More... | |
Static Public Member Functions | |
static OSVR_PLUGINHOST_EXPORT PluginRegPtr | create (std::string const &name) |
Factory function that creates a plugin-specific registration context. More... | |
static OSVR_PLUGINHOST_EXPORT PluginSpecificRegistrationContext & | get (OSVR_PluginRegContext ctx) |
Retrieve this interface from an OSVR_PluginRegContext opaque pointer. More... | |
Protected Member Functions | |
PluginSpecificRegistrationContext (std::string const &name) | |
Constructor for derived class use only. | |
Class providing the external interface of a registration context backing a single plugin.
|
static |
Factory function that creates a plugin-specific registration context.
Ownership is transferred to the caller.
Typically called by a RegistrationContext in the loadPlugin method, this may also be used for statically-linked "plugins" whether in deployment or testing.
name | The plugin name, conventionally in an underscore-delimited reverse DNS format. |
|
static |
Retrieve this interface from an OSVR_PluginRegContext opaque pointer.
|
pure virtual |
Get parent registration context.
std::logic_error | if called when no parent is yet set. |
Implemented in osvr::pluginhost::PluginSpecificRegistrationContextImpl.
|
pure virtual |
Get parent registration context.
std::logic_error | if called when no parent is yet set. |
Implemented in osvr::pluginhost::PluginSpecificRegistrationContextImpl.
void osvr::pluginhost::PluginSpecificRegistrationContext::log | ( | util::log::LogLevel | severity, |
const char * | message | ||
) |
Log a message to the plugin-specific channel.
severity | The severity of the message. |
message | The message to be logged. |
|
pure virtual |
Register data and a delete callback to be called on plugin unload.
Implemented in osvr::pluginhost::PluginSpecificRegistrationContextImpl.
|
inline |
Register data allocated with new to be deleted on plugin unload.
|
pure virtual |
Register a callback for constructing a driver by name with parameters.
name | Driver type name - must be non-empty and unique within this plugin. |
constructor | The callback function. |
userData | Optional opaque pointer to pass to callback |
std::logic_error | if name is empty or already used within this plugin. |
Implemented in osvr::pluginhost::PluginSpecificRegistrationContextImpl.
|
pure virtual |
Register a callback to be invoked on some hardware detection event.
Implemented in osvr::pluginhost::PluginSpecificRegistrationContextImpl.