Class providing the external interface of a registration context backing a single plugin. More...
#include <osvr/PluginHost/PluginSpecificRegistrationContext.h>
Public Member Functions | |
| OSVR_PluginRegContext | extractOpaquePointer () |
| Extracts the opaque pointer for this interface to send to C. | |
| virtual | ~PluginSpecificRegistrationContext () |
| Destructor. | |
| virtual RegistrationContext & | getParent ()=0 |
| Get parent registration context. More... | |
| virtual RegistrationContext const & | getParent () const =0 |
| Get parent registration context. More... | |
| virtual util::AnyMap & | data ()=0 |
| Access the data storage map. | |
| virtual util::AnyMap const & | data () const =0 |
| Const access the data storage map. | |
| const std::string & | getName () const |
| Accessor for plugin name. | |
| 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 void | registerDataWithDeleteCallback (OSVR_PluginDataDeleteCallback deleteCallback, void *pluginData)=0 |
| Register data and a delete callback to be called on plugin unload. | |
| template<typename T > | |
| T * | registerDataWithGenericDelete (T *data) |
| Register data allocated with new to be deleted on plugin unload. | |
| virtual void | registerHardwareDetectCallback (OSVR_HardwareDetectCallback detectCallback, void *userData)=0 |
| Register a callback to be invoked on some hardware detection event. | |
| virtual 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 PluginRegPtr | create (std::string const &name) |
| Factory function that creates a plugin-specific registration context. Ownership is transferred to the caller. More... | |
|
static PluginSpecificRegistrationContext & | get (OSVR_PluginRegContext ctx) |
| Retrieve this interface from an OSVR_PluginRegContext opaque pointer. | |
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.
Definition at line 52 of file PluginSpecificRegistrationContext.h.
|
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. |
Definition at line 42 of file PluginSpecificRegistrationContext.cpp.
|
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.
|
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.
| 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. |
Definition at line 66 of file PluginSpecificRegistrationContext.cpp.