OSVR-Core
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
osvr::pluginhost::PluginSpecificRegistrationContext Class Referenceabstract

Class providing the external interface of a registration context backing a single plugin. More...

#include <PluginSpecificRegistrationContext.h>

Inheritance diagram for osvr::pluginhost::PluginSpecificRegistrationContext:
osvr::pluginhost::PluginSpecificRegistrationContextImpl

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 RegistrationContextgetParent ()=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::AnyMapdata ()=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 >
TregisterDataWithGenericDelete (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 PluginSpecificRegistrationContextget (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.
 

Detailed Description

Class providing the external interface of a registration context backing a single plugin.

Member Function Documentation

§ create()

PluginRegPtr osvr::pluginhost::PluginSpecificRegistrationContext::create ( std::string const &  name)
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.

Parameters
nameThe plugin name, conventionally in an underscore-delimited reverse DNS format.

§ get()

PluginSpecificRegistrationContext & osvr::pluginhost::PluginSpecificRegistrationContext::get ( OSVR_PluginRegContext  ctx)
static

Retrieve this interface from an OSVR_PluginRegContext opaque pointer.

§ getParent() [1/2]

virtual OSVR_PLUGINHOST_EXPORT RegistrationContext& osvr::pluginhost::PluginSpecificRegistrationContext::getParent ( )
pure virtual

Get parent registration context.

Exceptions
std::logic_errorif called when no parent is yet set.

Implemented in osvr::pluginhost::PluginSpecificRegistrationContextImpl.

§ getParent() [2/2]

virtual OSVR_PLUGINHOST_EXPORT RegistrationContext const& osvr::pluginhost::PluginSpecificRegistrationContext::getParent ( ) const
pure virtual

Get parent registration context.

Exceptions
std::logic_errorif called when no parent is yet set.

Implemented in osvr::pluginhost::PluginSpecificRegistrationContextImpl.

§ log()

void osvr::pluginhost::PluginSpecificRegistrationContext::log ( util::log::LogLevel  severity,
const char *  message 
)

Log a message to the plugin-specific channel.

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

§ registerDataWithDeleteCallback()

virtual OSVR_PLUGINHOST_EXPORT void osvr::pluginhost::PluginSpecificRegistrationContext::registerDataWithDeleteCallback ( OSVR_PluginDataDeleteCallback  deleteCallback,
void *  pluginData 
)
pure virtual

Register data and a delete callback to be called on plugin unload.

Implemented in osvr::pluginhost::PluginSpecificRegistrationContextImpl.

§ registerDataWithGenericDelete()

template<typename T >
T* osvr::pluginhost::PluginSpecificRegistrationContext::registerDataWithGenericDelete ( T data)
inline

Register data allocated with new to be deleted on plugin unload.

§ registerDriverInstantiationCallback()

virtual OSVR_PLUGINHOST_EXPORT void osvr::pluginhost::PluginSpecificRegistrationContext::registerDriverInstantiationCallback ( const char *  name,
OSVR_DriverInstantiationCallback  constructor,
void *  userData 
)
pure virtual

Register a callback for constructing a driver by name with parameters.

Parameters
nameDriver type name - must be non-empty and unique within this plugin.
constructorThe callback function.
userDataOptional opaque pointer to pass to callback
Exceptions
std::logic_errorif name is empty or already used within this plugin.

Implemented in osvr::pluginhost::PluginSpecificRegistrationContextImpl.

§ registerHardwareDetectCallback()

virtual OSVR_PLUGINHOST_EXPORT void osvr::pluginhost::PluginSpecificRegistrationContext::registerHardwareDetectCallback ( OSVR_HardwareDetectCallback  detectCallback,
void *  userData 
)
pure virtual

Register a callback to be invoked on some hardware detection event.

Implemented in osvr::pluginhost::PluginSpecificRegistrationContextImpl.


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