OSVR-Core
Public Member Functions | List of all members
osvr::vrpnserver::VRPNDeviceRegistration Class Reference

Public Member Functions

 VRPNDeviceRegistration (VRPNDeviceRegistration const &)=delete
 noncopyable
 
VRPNDeviceRegistrationoperator= (VRPNDeviceRegistration const &)=delete
 nonassignable
 
OSVR_VRPNSERVER_EXPORT VRPNDeviceRegistration (OSVR_PluginRegContext ctx)
 Start the process of registering a manually-created VRPN device into the OSVR server core. More...
 
OSVR_VRPNSERVER_EXPORT VRPNDeviceRegistration (pluginhost::PluginSpecificRegistrationContext &context)
 
OSVR_VRPNSERVER_EXPORT ~VRPNDeviceRegistration ()
 destructor More...
 
OSVR_VRPNSERVER_EXPORT 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...
 
OSVR_VRPNSERVER_EXPORT vrpn_Connection * getVRPNConnection ()
 Get the vrpn_Connection object to use in constructing your object. More...
 
template<typename T >
TregisterDevice (T *dev)
 Registers your custom device with the server and takes ownership of the object. More...
 
template<typename T >
TconstructAndRegisterDevice (std::string const &name)
 Constructs and registers your custom device with the server and takes ownership of the object. More...
 
OSVR_VRPNSERVER_EXPORT void setDeviceDescriptor (std::string const &jsonString)
 

Constructor & Destructor Documentation

§ VRPNDeviceRegistration() [1/2]

osvr::vrpnserver::VRPNDeviceRegistration::VRPNDeviceRegistration ( OSVR_PluginRegContext  ctx)

Start the process of registering a manually-created VRPN device into the OSVR server core.

§ VRPNDeviceRegistration() [2/2]

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.

§ ~VRPNDeviceRegistration()

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

destructor

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

Member Function Documentation

§ constructAndRegisterDevice()

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.

§ getVRPNConnection()

vrpn_Connection * osvr::vrpnserver::VRPNDeviceRegistration::getVRPNConnection ( )

Get the vrpn_Connection object to use in constructing your object.

§ registerDevice()

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.

§ useDecoratedName()

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.


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