25 #ifndef INCLUDED_PluginSpecificRegistrationContextImpl_h_GUID_E8A348C1_28DC_4691_6214_32F75A6665F0
26 #define INCLUDED_PluginSpecificRegistrationContextImpl_h_GUID_E8A348C1_28DC_4691_6214_32F75A6665F0
36 #include <libfunctionality/PluginHandle.h>
44 namespace pluginhost {
93 const std::string ¶ms = std::string())
const;
120 typedef unique_ptr<void, OSVR_PluginDataDeleteCallback> PluginDataPtr;
122 typedef std::vector<PluginDataPtr> PluginDataList;
124 PluginDataList m_dataList;
125 libfunc::PluginHandle m_handle;
130 typedef std::vector<HardwareDetectCallback> HardwareDetectCallbackList;
131 HardwareDetectCallbackList m_hardwareDetectCallbacks;
133 typedef std::function<OSVR_ReturnCode(const char *)>
134 DriverInstantiationCallback;
135 typedef std::map<std::string, DriverInstantiationCallback>
136 DriverInstantiationMap;
137 DriverInstantiationMap m_driverInstantiationCallbacks;
145 #endif // INCLUDED_PluginSpecificRegistrationContextImpl_h_GUID_E8A348C1_28DC_4691_6214_32F75A6665F0
void setParent(RegistrationContext &parent)
Set parent registration context.
virtual void registerDriverInstantiationCallback(const char *name, OSVR_DriverInstantiationCallback constructor, void *userData)
Register a callback for constructing a driver by name with parameters.
Class responsible for hosting plugins, along with their registration and destruction.
virtual util::AnyMap & data()
Access the data storage map.
Header providing a templated functor wrapping the holding and calling of function pointer and userdat...
void instantiateDriver(const std::string &driverName, const std::string ¶ms=std::string()) const
Call a driver instantiation callback for the given driver name.
Class providing the external interface of a registration context backing a single plugin...
Header to bring unique_ptr into the osvr namespace.
void(* OSVR_PluginDataDeleteCallback)(void *pluginData)
Function type of a Plugin Data Delete callback.
A data structure storing "any" by name, to reduce coupling.
OSVR_ReturnCode(* OSVR_HardwareDetectCallback)(OSVR_PluginRegContext ctx, void *userData)
Function type of a Hardware Detect callback.
Header including the full PluginKit C API.
void takePluginHandle(libfunc::PluginHandle &handle)
Assume ownership of the plugin handle keeping the plugin library loaded.
Header declaring the osvr::util::AnyMap structure.
void triggerHardwareDetectCallbacks()
Call all hardware detect callbacks registered by this plugin, if any.
virtual RegistrationContext & getParent()
Get parent registration context.
~PluginSpecificRegistrationContextImpl()
Destructor.
PluginSpecificRegistrationContextImpl(std::string const &name)
Constructor.
OSVR_ReturnCode(* OSVR_DriverInstantiationCallback)(OSVR_PluginRegContext ctx, const char *params, void *userData)
Function type of a driver instantiation callback.
A class template turning a callback with some number of arguments, with a userdata pointer last...
virtual void registerHardwareDetectCallback(OSVR_HardwareDetectCallback detectCallback, void *userData)
Register a callback to be invoked on some hardware detection event.
Internal class backing the context of registrations performed by a single plugin. ...
virtual void registerDataWithDeleteCallback(OSVR_PluginDataDeleteCallback deleteCallback, void *pluginData)
Register data and a delete callback to be called on plugin unload.