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

Public Member Functions

 VRPNDeviceRegistration (VRPNDeviceRegistration const &)=delete
 noncopyable
 
VRPNDeviceRegistrationoperator= (VRPNDeviceRegistration const &)=delete
 nonassignable
 
 VRPNDeviceRegistration (OSVR_PluginRegContext ctx)
 Start the process of registering a manually-created VRPN device into the OSVR server core.
 
 VRPNDeviceRegistration (pluginhost::PluginSpecificRegistrationContext &context)
 
 ~VRPNDeviceRegistration ()
 destructor More...
 
std::string useDecoratedName (std::string const &name)
 Decorates a device name with the plugin name and returns it, as well as records it for registration with the connection. More...
 
vrpn_Connection * getVRPNConnection ()
 Get the vrpn_Connection object to use in constructing your object.
 
template<typename T >
T * registerDevice (T *dev)
 Registers your custom device with the server and takes ownership of the object. More...
 
template<typename T >
T * constructAndRegisterDevice (std::string const &name)
 Constructs and registers your custom device with the server and takes ownership of the object. Requires that your device only need a name and a vrpn_Connection to construct. More...
 
void setDeviceDescriptor (std::string const &jsonString)
 

Detailed Description

Definition at line 59 of file VRPNDeviceRegistration.h.

Constructor & Destructor Documentation

osvr::vrpnserver::VRPNDeviceRegistration::VRPNDeviceRegistration ( pluginhost::PluginSpecificRegistrationContext context)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 93 of file VRPNDeviceRegistration.cpp.

osvr::vrpnserver::VRPNDeviceRegistration::~VRPNDeviceRegistration ( )

destructor

Must be in .cpp file to handle pimpl deletion here.

Definition at line 98 of file VRPNDeviceRegistration.cpp.

Member Function Documentation

std::string osvr::vrpnserver::VRPNDeviceRegistration::useDecoratedName ( std::string const &  name)

Decorates a device name with the plugin name and returns it, as well as records it for registration with the connection.

You must make at least one call to this, to get a proper name for your device.

If you make more calls, then the first call should be for the "primary" device. Note that order of evaluation of arguments (for instance, to a constructor call) is undefined, so you'll want to call this first and store its result in a temporary string before your constructor call if you need more than one name.

Definition at line 101 of file VRPNDeviceRegistration.cpp.

template<typename T >
T* osvr::vrpnserver::VRPNDeviceRegistration::registerDevice ( T *  dev)
inline

Registers your custom device with the server and takes ownership of the object.

Returns
the pointer you passed in, to make it easy to use this method to wrap a call to new.

Definition at line 99 of file VRPNDeviceRegistration.h.

template<typename T >
T* osvr::vrpnserver::VRPNDeviceRegistration::constructAndRegisterDevice ( std::string const &  name)
inline

Constructs and registers your custom device with the server and takes ownership of the object. Requires that your device only need a name and a vrpn_Connection to construct.

This is a shortcut method that handles calling useDecoratedName() and registerDevice() for you for the trivial case.

Parameters
nameUn-decorated name for your device - the function will take care of decorating it for you.
Returns
A pointer to your device, in case post-construction configuration is required.

Definition at line 119 of file VRPNDeviceRegistration.h.


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