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

Base class for connection-specific device data, owned by a DeviceToken. More...

#include <osvr/Connection/ConnectionDevice.h>

Inheritance diagram for osvr::connection::ConnectionDevice:
osvr::connection::GenericConnectionDevice osvr::connection::VrpnConnectionDevice

Public Types

typedef std::vector< std::string > NameList
 

Public Member Functions

virtual ~ConnectionDevice ()
 destructor
 
std::string const & getName () const
 accessor for (primary) device name
 
NameList const & getNames () const
 accessor for device names
 
void process ()
 Process messages. This shouldn't block. More...
 
void sendData (util::time::TimeValue const &timestamp, MessageType *type, const char *bytestream, size_t len)
 Send message (as primary device name)
 
void setDeviceToken (DeviceToken &token)
 For use only by DeviceToken.
 
void setDeviceDescriptor (std::string const &jsonString)
 Send new/updated JSON device descriptor. More...
 
std::string const & getDeviceDescriptor () const
 Get the most current JSON device descriptor.
 

Protected Member Functions

bool m_hasDeviceToken () const
 Does this connection device have a device token? Should be true in nearly every case.
 
DeviceTokenm_getDeviceToken ()
 accessor for device token
 
virtual void m_process ()=0
 (Subclass implementation) Process messages. This shouldn't block.
 
virtual void m_sendData (util::time::TimeValue const &timestamp, MessageType *type, const char *bytestream, size_t len)=0
 (Subclass implementation) Send message.
 
 ConnectionDevice (std::string const &name)
 Constructor for use by derived classes only.
 
 ConnectionDevice (NameList const &names)
 Constructor for use by derived classes only.
 

Detailed Description

Base class for connection-specific device data, owned by a DeviceToken.

Definition at line 46 of file ConnectionDevice.h.

Member Function Documentation

void osvr::connection::ConnectionDevice::process ( )

Process messages. This shouldn't block.

Someone needs to call this method frequently.

Definition at line 54 of file ConnectionDevice.cpp.

void osvr::connection::ConnectionDevice::setDeviceDescriptor ( std::string const &  jsonString)

Send new/updated JSON device descriptor.

Note: does not trigger the descriptor handlers in connection - those must be triggered by the caller!

Todo:
validate descriptor here

Definition at line 68 of file ConnectionDevice.cpp.


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