Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

VrpnClient Class Reference

A specific ClientBase that connects to a VRPN server and records information on the connected VRPN devices. More...

#include "vrpnClient.h"

Inheritance diagram for VrpnClient:
ClientBase TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

List of all members.

Public Member Functions

 VrpnClient (const string &server_name)
virtual TypeHandle force_init_type ()
const string & get_server_name () const
 Returns the name of the server as passed to the VrpnClient constructor.
virtual TypeHandle get_type () const
bool is_connected () const
 Returns true if the connection is established successfully, false otherwise.
bool is_valid () const
 Returns true if everything seems to be kosher with the server (even if there is no connection), or false otherwise.
void write (ostream &out, int indent_level=0) const
 Writes a list of the active devices that the VrpnClient is currently polling each frame.

Static Public Member Functions

static double convert_to_secs (struct timeval msg_time)
 Little inline function to convert a struct timeval to only seconds.
static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.

Protected Member Functions

virtual bool disconnect_device (TypeHandle device_type, const string &device_name, ClientDevice *device)
 Removes the device, which is presumably about to destruct, from the list of connected devices, and frees any data required to support it.
virtual void do_poll ()
 Implements the polling and updating of connected devices, if the ClientBase requires this.
virtual PT (ClientDevice) make_device(TypeHandle device_type

Protected Attributes

virtual const string & device_name

Detailed Description

A specific ClientBase that connects to a VRPN server and records information on the connected VRPN devices.

Definition at line 38 of file vrpnClient.h.


Member Function Documentation

double VrpnClient::convert_to_secs ( struct timeval  msg_time) [inline, static]

Little inline function to convert a struct timeval to only seconds.

Definition at line 59 of file vrpnClient.I.

bool VrpnClient::disconnect_device ( TypeHandle  device_type,
const string &  device_name,
ClientDevice device 
) [protected, virtual]

Removes the device, which is presumably about to destruct, from the list of connected devices, and frees any data required to support it.

This device will no longer receive automatic updates with each poll.

The return value is true if the device was disconnected, or false if it was unknown (e.g. it was disconnected previously).

Reimplemented from ClientBase.

Definition at line 172 of file vrpnClient.cxx.

References ClientBase::disconnect_device(), and TypedObject::is_of_type().

void VrpnClient::do_poll ( ) [protected, virtual]

Implements the polling and updating of connected devices, if the ClientBase requires this.

This may be called in a sub-thread if fork_asynchronous_thread() was called; otherwise, it will be called once per frame.

Reimplemented from ClientBase.

Definition at line 209 of file vrpnClient.cxx.

References VrpnDial::poll(), VrpnAnalog::poll(), VrpnButton::poll(), and VrpnTracker::poll().

const string & VrpnClient::get_server_name ( ) const [inline]

Returns the name of the server as passed to the VrpnClient constructor.

Definition at line 24 of file vrpnClient.I.

static void VrpnClient::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from ClientBase.

Definition at line 103 of file vrpnClient.h.

References ClientBase::init_type().

bool VrpnClient::is_connected ( ) const [inline]

Returns true if the connection is established successfully, false otherwise.

Definition at line 47 of file vrpnClient.I.

Referenced by write().

bool VrpnClient::is_valid ( ) const [inline]

Returns true if everything seems to be kosher with the server (even if there is no connection), or false otherwise.

Definition at line 36 of file vrpnClient.I.

Referenced by write().

void VrpnClient::write ( ostream &  out,
int  indent_level = 0 
) const

Writes a list of the active devices that the VrpnClient is currently polling each frame.

Definition at line 73 of file vrpnClient.cxx.

References is_connected(), and is_valid().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations