PlayerCc::ClientProxy Class Reference

#include <clientproxy.h>

Inherited by PlayerCc::ActArrayProxy, PlayerCc::AioProxy, PlayerCc::BlobfinderProxy, PlayerCc::BumperProxy, PlayerCc::CameraProxy, PlayerCc::DioProxy, PlayerCc::FiducialProxy, PlayerCc::GpsProxy, PlayerCc::Graphics2dProxy, PlayerCc::Graphics3dProxy, PlayerCc::GripperProxy, PlayerCc::IrProxy, PlayerCc::LaserProxy, PlayerCc::LimbProxy, PlayerCc::LocalizeProxy, PlayerCc::LogProxy, PlayerCc::MapProxy, PlayerCc::OpaqueProxy, PlayerCc::PlannerProxy, PlayerCc::Position1dProxy, PlayerCc::Position2dProxy, PlayerCc::Position3dProxy, PlayerCc::PowerProxy, PlayerCc::PtzProxy, PlayerCc::RFIDProxy, PlayerCc::SimulationProxy, PlayerCc::SonarProxy, PlayerCc::SpeechProxy, PlayerCc::SpeechRecognitionProxy, PlayerCc::WiFiProxy, and PlayerCc::WSNProxy.

List of all members.


Detailed Description

The client proxy base class.

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.

Since the ConnectReadSignal() and DisconnectReadSignal() member functions are based on the Boost signals library, they are conditionally available depending on Boost's presence in the system. See the configure script for more information.


Public Types

typedef int connection_t
typedef boost::mutex::scoped_lock scoped_lock_t
typedef int read_signal_t

Public Member Functions

bool IsValid () const
 Returns true if we have received any data from the device.
bool IsFresh () const
 Fresh is set to true on each new read.
void NotFresh ()
 This states that the data in a client is currently not Fresh.
std::string GetDriverName () const
 Returns the driver name.
double GetDataTime () const
 Returns the received timestamp [s].
double GetElapsedTime () const
 Returns the received timestamp [s].
PlayerClientGetPlayerClient () const
 Returns a pointer to the Player Client.
uint GetIndex () const
 Returns device index.
uint GetInterface () const
 Returns device interface.
std::string GetInterfaceStr () const
 Returns device interface.
void SetReplaceRule (bool aReplace, int aType=-1, int aSubtype=-1)
 Set a replace rule for this proxy on the server.
int HasCapability (uint aType, uint aSubtype)
 Request capabilities of device.
template<typename T>
connection_t ConnectReadSignal (T aSubscriber)
 Connect a signal to this proxy For more information check out Signals & multithreading.
void DisconnectReadSignal (connection_t aSubscriber)
 Disconnect a signal to this proxy.

Protected Member Functions

 ClientProxy (PlayerClient *aPc, uint aIndex)
virtual void Subscribe (uint aIndex)
virtual void Unsubscribe ()
template<typename T>
GetVar (const T &aV) const
template<typename T>
void GetVarByRef (const T aBegin, const T aEnd, T aDest) const

Protected Attributes

PlayerClientmPc
playerc_client_tmClient
playerc_device_tmInfo
bool mFresh

Member Function Documentation

std::string PlayerCc::ClientProxy::GetDriverName  )  const [inline]
 

Returns the driver name.

Todo:
GetDriverName isn't guarded by locks yet

int PlayerCc::ClientProxy::HasCapability uint  aType,
uint  aSubtype
 

Request capabilities of device.

Send a message asking if the device supports the given message type and subtype. If it does, the return value will be 1, and 0 otherwise.

bool PlayerCc::ClientProxy::IsFresh  )  const [inline]
 

Fresh is set to true on each new read.

It is up to the user to set it to false if the data has already been read. This is most useful when used in conjunction with the PlayerMultiClient

void PlayerCc::ClientProxy::SetReplaceRule bool  aReplace,
int  aType = -1,
int  aSubtype = -1
 

Set a replace rule for this proxy on the server.

If a rule with the same pattern already exists, it will be replaced with the new rule (i.e., its setting to replace will be updated).

Parameters:
aReplace Should we replace these messages
aType The type to set replace rule for (-1 for wildcard), see Message types.
aSubtype Message subtype to set replace rule for (-1 for wildcard). This is dependent on the Interface specifications.
Exceptions:
throws PlayerError if unsuccessfull
See also:
PlayerClient::SetReplaceRule, PlayerClient::SetDataMode

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

Last updated 12 September 2005 21:38:45