OSVR-Core
Public Types | Public Member Functions | List of all members
osvr::connection::VrpnBasedConnection Class Reference
Inheritance diagram for osvr::connection::VrpnBasedConnection:
osvr::connection::Connection

Public Types

enum  ConnectionType { VRPN_LOCAL_ONLY, VRPN_SHARED, VRPN_LOOPBACK }
 
- Public Types inherited from osvr::connection::Connection
typedef std::vector< ConnectionDevicePtrDeviceList
 
typedef std::vector< std::string > NameList
 Type of list of device names.
 

Public Member Functions

 VrpnBasedConnection (ConnectionType type)
 Constructor for the VRPN connection.
 
 VrpnBasedConnection (boost::optional< std::string const &> iface, boost::optional< int > port)
 Constructor for a (likely) shared VRPN connection specifying the interface to listen on as well as the port. More...
 
virtual void * getUnderlyingObject ()
 Returns the vrpn_Connection pointer.
 
virtual const char * getConnectionKindID ()
 Returns some implementation-defined string based on the dynamic type of the connection. More...
 
virtual ~VrpnBasedConnection ()
 
- Public Member Functions inherited from osvr::connection::Connection
OSVR_CONNECTION_EXPORT MessageTypePtr registerMessageType (std::string const &messageId)
 Register (or retrieve registration) of a message type. More...
 
OSVR_CONNECTION_EXPORT ConnectionDevicePtr createConnectionDevice (std::string const &deviceName)
 Create a ConnectionDevice by registering a full device name. More...
 
OSVR_CONNECTION_EXPORT ConnectionDevicePtr createConnectionDevice (DeviceInitObject &init)
 
OSVR_CONNECTION_EXPORT void addDevice (ConnectionDevicePtr device)
 Add an externally-constructed device to the device list.
 
OSVR_CONNECTION_EXPORT void process ()
 Process messages. More...
 
OSVR_CONNECTION_EXPORT void registerConnectionHandler (std::function< void()> handler)
 Register a function to be called when a client connects or pings. More...
 
OSVR_CONNECTION_EXPORT void registerDescriptorHandler (std::function< void()> handler)
 Register a function to be called when a descriptor changes.
 
OSVR_CONNECTION_EXPORT void triggerDescriptorHandlers ()
 Signal a descriptor update and call any/all descriptor handlers. More...
 
virtual OSVR_CONNECTION_EXPORT ~Connection ()
 Destructor.
 
boost::iterator_range< DeviceList::const_iterator > getDevices () const
 Get the devices, as a range.
 
OSVR_CONNECTION_EXPORT ConnectionDevicePtr registerAdvancedDevice (std::string const &deviceName, OSVR_DeviceUpdateCallback updateFunction, void *userdata)
 Record a full device name (namespaced with the plugin name) associated with a given callback. More...
 
OSVR_CONNECTION_EXPORT ConnectionDevicePtr registerAdvancedDevice (NameList const &deviceNames, OSVR_DeviceUpdateCallback updateFunction, void *userdata)
 Record more than one full device name (namespaced with the plugin name) associated with a given callback. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from osvr::connection::Connection
static OSVR_CONNECTION_EXPORT ConnectionPtr createLocalConnection ()
 
static OSVR_CONNECTION_EXPORT ConnectionPtr createSharedConnection (boost::optional< std::string const &> iface, boost::optional< int > port)
 Factory method to create a shared connection. More...
 
static OSVR_CONNECTION_EXPORT std::tuple< void *, ConnectionPtrcreateLoopbackConnection ()
 
static OSVR_CONNECTION_EXPORT ConnectionPtr retrieveConnection (const pluginhost::RegistrationContext &ctx)
 
static OSVR_CONNECTION_EXPORT void storeConnection (pluginhost::RegistrationContext &ctx, ConnectionPtr conn)
 Store a connection pointer in a RegistrationContext.
 
- Protected Member Functions inherited from osvr::connection::Connection
 Connection ()
 brief Constructor
 

Constructor & Destructor Documentation

§ VrpnBasedConnection()

osvr::connection::VrpnBasedConnection::VrpnBasedConnection ( boost::optional< std::string const &>  iface,
boost::optional< int >  port 
)

Constructor for a (likely) shared VRPN connection specifying the interface to listen on as well as the port.

§ ~VrpnBasedConnection()

osvr::connection::VrpnBasedConnection::~VrpnBasedConnection ( )
virtual
Todo:
wait until all async threads are done

Member Function Documentation

§ getConnectionKindID()

const char * osvr::connection::VrpnBasedConnection::getConnectionKindID ( )
virtual

Returns some implementation-defined string based on the dynamic type of the connection.

Reimplemented from osvr::connection::Connection.


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