Home
FAQ
Player
Stage
Gazebo
Contrib
Documentation
Publications
Contributors
Users

Project
Download
Bugs/Feedback
Mailing lists

Radish

Old news
Old stuff

ClientProxy Class Reference
[Core functionality]

#include <playerclient.h>

Inherited by AIOProxy, AudioDSPProxy, AudioMixerProxy, AudioProxy, BlinkenlightProxy, BlobfinderProxy, BumperProxy, CameraProxy, DIOProxy, EnergyProxy, FiducialProxy, GpsProxy, GripperProxy, IRProxy, LaserProxy, LocalizeProxy, LogProxy, MapProxy, MComProxy, MotorProxy, PlannerProxy, Position2DProxy, Position3DProxy, PositionProxy, PowerProxy, PtzProxy, SimulationProxy, SonarProxy, SoundProxy, SpeechProxy, SpeechRecognitionProxy, TruthProxy, WaveformProxy, and WiFiProxy.

List of all members.


Detailed Description

Base class for all proxy devices. Access to a device is provided by a device-specific proxy class. These classes all inherit from the ClientProxy class which defines an interface for device proxies. As such, a few methods are common to all devices and we explain them here.


Public Member Functions

 ClientProxy (PlayerClient *pc, unsigned short req_device, unsigned short req_index, unsigned char req_access= 'c')
virtual ~ClientProxy ()
unsigned char GetAccess ()
int ChangeAccess (unsigned char req_access, unsigned char *grant_access=NULL)
int Close ()
virtual void FillData (player_msghdr_t hdr, const char *buffer)
virtual void Print ()
int Lock ()
int Unlock ()

Public Attributes

PlayerClientclient
bool valid
bool fresh
unsigned char access
player_device_id_t m_device_id
char driver_name [PLAYER_MAX_DEVICE_STRING_LEN]
timeval timestamp
timeval senttime
timeval receivedtime

Friends

class PlayerClient


Constructor & Destructor Documentation

ClientProxy::ClientProxy PlayerClient pc,
unsigned short  req_device,
unsigned short  req_index,
unsigned char  req_access = 'c'
 

This constructor will try to get access to the device, unless req_device is 0 or req_access is 'c'. The pointer pc must refer to an already connected PlayerClient proxy. The index indicates which one of the devices to use (usually 0). Note that a request executed by this the constructor can fail, but the constructor cannot indicate the failure. Thus, if you request a particular access mode, you should verify that the current access is identical to your requested access using GetAccess(). In any case, you can use ChangeAccess() later to change your access mode for the device.

virtual ClientProxy::~ClientProxy  )  [virtual]
 


Member Function Documentation

unsigned char ClientProxy::GetAccess  )  [inline]
 

Returns the current access mode for the device.

int ClientProxy::ChangeAccess unsigned char  req_access,
unsigned char *  grant_access = NULL
 

Request different access for the device. If grant_access is non-NULL, then it is filled in with the granted access. Returns 0 on success, -1 otherwise.

int ClientProxy::Close  )  [inline]
 

Convenience method for requesting 'c' access.

virtual void ClientProxy::FillData player_msghdr_t  hdr,
const char *  buffer
[virtual]
 

All proxies must provide this method. It is used internally to parse new data when it is received.

Reimplemented in AIOProxy, GpsProxy, GripperProxy, SoundProxy, FiducialProxy, LaserProxy, LocalizeProxy, MotorProxy, PositionProxy, Position2DProxy, Position3DProxy, PtzProxy, SonarProxy, TruthProxy, BlobfinderProxy, IRProxy, WiFiProxy, PowerProxy, AudioProxy, AudioDSPProxy, AudioMixerProxy, BumperProxy, DIOProxy, WaveformProxy, MComProxy, BlinkenlightProxy, CameraProxy, PlannerProxy, EnergyProxy, MapProxy, SpeechRecognitionProxy, SimulationProxy, and LogProxy.

virtual void ClientProxy::Print  )  [virtual]
 

All proxies SHOULD provide this method, which should print out, in a human-readable form, the device's current state.

Reimplemented in AIOProxy, GpsProxy, GripperProxy, SoundProxy, FiducialProxy, LaserProxy, LocalizeProxy, MotorProxy, PositionProxy, Position2DProxy, Position3DProxy, PtzProxy, SonarProxy, TruthProxy, BlobfinderProxy, IRProxy, WiFiProxy, PowerProxy, AudioProxy, AudioDSPProxy, AudioMixerProxy, BumperProxy, DIOProxy, WaveformProxy, MComProxy, BlinkenlightProxy, CameraProxy, EnergyProxy, SimulationProxy, and LogProxy.

int ClientProxy::Lock  ) 
 

Methods for providing the ability to achieve thread safety, the class is not thread safe without additional protection in the client app. if PLAYERCLIENT_THREAD is not defined then Lock and Unlock do nothing and always succeed These are called by the playerclient during a read if data is to be updated

int ClientProxy::Unlock  ) 
 


Friends And Related Function Documentation

friend class PlayerClient [friend]
 


Member Data Documentation

PlayerClient* ClientProxy::client
 

The controlling client object.

bool ClientProxy::valid
 

Have we yet received any data from this device?

bool ClientProxy::fresh
 

Flag set if data has just been read into this device. If you use it, you must set it to false yourself after examining the data.

unsigned char ClientProxy::access
 

the last message header and body will be copied here by StoreData(), so that it's available for later use.

player_device_id_t ClientProxy::m_device_id
 

char ClientProxy::driver_name[PLAYER_MAX_DEVICE_STRING_LEN]
 

The name of the driver used to implement this device in the server.

struct timeval ClientProxy::timestamp
 

Time at which this data was generated by the device.

struct timeval ClientProxy::senttime
 

Time at which this data was sent by the server.

struct timeval ClientProxy::receivedtime
 

Time at which this data was received by the client.


The documentation for this class was generated from the following file:
Generated on Tue May 3 14:15:48 2005 for Player by doxygen 1.3.6