OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
osvr::pluginhost::PluginSpecificRegistrationContext Class Referenceabstract

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

#include <osvr/PluginHost/PluginSpecificRegistrationContext.h>

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

Public Member Functions

OSVR_PluginRegContext extractOpaquePointer ()
 Extracts the opaque pointer for this interface to send to C.
 
virtual ~PluginSpecificRegistrationContext ()
 Destructor.
 
virtual RegistrationContextgetParent ()=0
 Get parent registration context. More...
 
virtual RegistrationContext const & getParent () const =0
 Get parent registration context. More...
 
virtual util::AnyMapdata ()=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.
 

Detailed Description

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

Definition at line 52 of file PluginSpecificRegistrationContext.h.

Member Function Documentation

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.

Definition at line 42 of file PluginSpecificRegistrationContext.cpp.

virtual 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.

virtual 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.

virtual 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.

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.

Definition at line 66 of file PluginSpecificRegistrationContext.cpp.


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