Home
FAQ
Player
Stage
Gazebo
Contrib
Documentation
Publications
Contributors
Users

Project
Download
Bugs/Feedback
Mailing lists

Radish

Old news
Old stuff

StageDevice Class Reference

#include <stagedevice.h>

Inherits Driver.

List of all members.

Public Member Functions

 StageDevice (player_stage_info_t *info, int lockfd, int lockbyte)
virtual int Setup ()
 Initialize the driver.

virtual int Shutdown ()
 Finalize the driver.

virtual size_t GetData (player_device_id_t id, void *dest, size_t len, struct timeval *timestamp)
 Read data from the driver.

virtual void PutCommand (player_device_id_t id, void *src, size_t len, struct timeval *timestamp)
 Write a new command to the driver.

virtual void Update (void)
 Update non-threaded drivers.


Public Attributes

StageDevicenext
player_stage_info_tm_info
size_t m_info_len


Constructor & Destructor Documentation

StageDevice::StageDevice player_stage_info_t info,
int  lockfd,
int  lockbyte
 


Member Function Documentation

int StageDevice::Setup  )  [virtual]
 

Initialize the driver.

This function is called with the first client subscribes; it MUST be implemented by the driver.

Returns:
Returns 0 on success.

Implements Driver.

int StageDevice::Shutdown  )  [virtual]
 

Finalize the driver.

This function is called with the last client unsubscribes; it MUST be implemented by the driver.

Returns:
Returns 0 on success.

Implements Driver.

size_t StageDevice::GetData player_device_id_t  id,
void *  dest,
size_t  len,
struct timeval *  timestamp
[virtual]
 

Read data from the driver.

This function will usually be called by the server.

Parameters:
id Specifies the device to be read.
dest Pointer to data destination buffer.
len Size of the data destination buffer (bytes).
timestamp If non-null, will be filled with the data timestamp.
Returns:
Returns the number of bytes written to the destination buffer.

Reimplemented from Driver.

void StageDevice::PutCommand player_device_id_t  id,
void *  src,
size_t  len,
struct timeval *  timestamp
[virtual]
 

Write a new command to the driver.

This function will usually be called by the server.

Parameters:
id Specifies the device to be written.
src Pointer to command source buffer.
len Length of the command (bytes).
timestamp Command timestamp; if NULL, the current server time will be used.

Reimplemented from Driver.

void StageDevice::Update void   )  [virtual]
 

Update non-threaded drivers.

This method is called once per loop (in Linux, probably either 50Hz or 100Hz) by the server. Threaded drivers can use the default implementation, which does nothing. Non-threaded drivers should do whatever they have to do, and call PutData() when they have new data.

Reimplemented from Driver.


Member Data Documentation

StageDevice* StageDevice::next
 

player_stage_info_t* StageDevice::m_info
 

size_t StageDevice::m_info_len
 


The documentation for this class was generated from the following files:
Generated on Tue May 3 14:16:07 2005 for Player by doxygen 1.3.6