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

BaseDevice component, for the VRPN built-in common messages. More...

#include <osvr/Common/CommonComponent.h>

Inheritance diagram for osvr::common::CommonComponent:
osvr::common::DeviceComponent

Public Types

typedef std::function< void()> Handler
 
- Public Types inherited from osvr::common::DeviceComponent
typedef BaseDevice Parent
 

Public Member Functions

void registerPingHandler (Handler const &handler)
 Register a ping handler: a ping is sent from a client device to the corresponding server device upon connection or reconnection. More...
 
void registerPongHandler (Handler const &handler)
 Register a pong handler: a pong replies to a ping, and is sent from a server device to the corresponding client device. More...
 
template<typename T >
void registerHandler (MessageRegistration< T > const &message, Handler const &handler)
 
- Public Member Functions inherited from osvr::common::DeviceComponent
void recordParent (Parent &dev)
 Called (only) by BaseDevice when being added: effectively records a "parent pointer" that does not convey ownership.
 
void update ()
 Called during mainloop.
 

Static Public Member Functions

static shared_ptr
< CommonComponent
create ()
 Factory method. More...
 

Public Attributes

messages::VRPNPing ping
 
messages::VRPNPong pong
 
messages::VRPNGotFirstConnection gotFirstConnection
 
messages::VRPNGotConnection gotConnection
 
messages::VRPNDroppedConnection droppedConnection
 
messages::VRPNDroppedLastConnection droppedLastConnection
 

Additional Inherited Members

- Protected Member Functions inherited from osvr::common::DeviceComponent
 DeviceComponent ()
 Protected constructor, to require subclassing.
 
bool m_hasParent () const
 Returns true if we have a parent registered.
 
Parentm_getParent ()
 Gets the parent - only call if m_hasParent() is true.
 
void m_registerHandler (vrpn_MESSAGEHANDLER handler, void *userdata, RawMessageType const &msgType)
 Registers a handler whose lifetime is tied to the lifetime of the component. More...
 
virtual void m_update ()
 Implementation-specific (optional) stuff to do during mainloop.
 

Detailed Description

BaseDevice component, for the VRPN built-in common messages.

Definition at line 82 of file CommonComponent.h.

Member Function Documentation

shared_ptr< CommonComponent > osvr::common::CommonComponent::create ( )
static

Factory method.

Required to ensure that allocation and deallocation stay on the same side of a DLL line.

Definition at line 64 of file CommonComponent.cpp.

void osvr::common::CommonComponent::registerPingHandler ( Handler const &  handler)

Register a ping handler: a ping is sent from a client device to the corresponding server device upon connection or reconnection.

Just forward to the templated implementation.

Definition at line 69 of file CommonComponent.cpp.

void osvr::common::CommonComponent::registerPongHandler ( Handler const &  handler)

Register a pong handler: a pong replies to a ping, and is sent from a server device to the corresponding client device.

Just forward to the templated implementation.

Definition at line 74 of file CommonComponent.cpp.


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