OSVR-Core
Classes | Public Member Functions | List of all members
osvr::pluginhost::RegistrationContext Class Reference

Class responsible for hosting plugins, along with their registration and destruction. More...

#include <RegistrationContext.h>

Inheritance diagram for osvr::pluginhost::RegistrationContext:

Classes

struct  Impl
 

Public Member Functions

OSVR_PLUGINHOST_EXPORT RegistrationContext ()
 basic constructor
 
OSVR_PLUGINHOST_EXPORT ~RegistrationContext ()
 Destructor responsible for destroying plugins in reverse order. More...
 
Host-side (internal) API

Load a plugin from a dynamic library in this context

OSVR_PLUGINHOST_EXPORT void loadPlugin (std::string const &pluginName)
 
OSVR_PLUGINHOST_EXPORT void loadPlugins ()
 Load all detected plugins except those with a .manualload suffix.
 
OSVR_PLUGINHOST_EXPORT void adoptPluginRegistrationContext (PluginRegPtr ctx)
 Assume ownership of a plugin-specific registration context created and initialized outside of loadPlugin. More...
 
OSVR_PLUGINHOST_EXPORT void triggerHardwareDetect ()
 Trigger any registered hardware detect callbacks.
 
OSVR_PLUGINHOST_EXPORT void instantiateDriver (const std::string &pluginName, const std::string &driverName, const std::string &params=std::string()) const
 Call a driver instantiation callback for the given plugin name and driver name. More...
 
OSVR_PLUGINHOST_EXPORT util::AnyMapdata ()
 Access the data storage map.
 
OSVR_PLUGINHOST_EXPORT util::AnyMap const & data () const
 Const access the data storage map.
 

Detailed Description

Class responsible for hosting plugins, along with their registration and destruction.

Constructor & Destructor Documentation

§ ~RegistrationContext()

osvr::pluginhost::RegistrationContext::~RegistrationContext ( )

Destructor responsible for destroying plugins in reverse order.

Member Function Documentation

§ adoptPluginRegistrationContext()

void osvr::pluginhost::RegistrationContext::adoptPluginRegistrationContext ( PluginRegPtr  ctx)

Assume ownership of a plugin-specific registration context created and initialized outside of loadPlugin.

This set parent might be a duplicate, but won't be if the plugin reg ctx is not created by loadPlugin above.

§ instantiateDriver()

void osvr::pluginhost::RegistrationContext::instantiateDriver ( const std::string &  pluginName,
const std::string &  driverName,
const std::string &  params = std::string() 
) const

Call a driver instantiation callback for the given plugin name and driver name.

Exceptions
std::runtime_errorif the plugin named hasn't been loaded, if there is no driver registered by that name in the given plugin, or if the constructor returns failure.

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