49 #ifndef PLAYERCC_CLIENTPROXY_H
50 #define PLAYERCC_CLIENTPROXY_H
53 #if defined (PLAYER_STATIC)
54 #define PLAYERCC_EXPORT
55 #elif defined (playerc___EXPORTS)
56 #define PLAYERCC_EXPORT __declspec (dllexport)
58 #define PLAYERCC_EXPORT __declspec (dllimport)
61 #define PLAYERCC_EXPORT
85 #ifdef HAVE_BOOST_SIGNALS
86 typedef boost::signals2::connection connection_t;
94 typedef boost::signals2::signal<void (
void)> read_signal_t;
97 typedef int connection_t;
101 typedef int read_signal_t;
121 virtual void Subscribe(uint32_t ) {};
125 virtual void Unsubscribe() {};
143 T GetVar(
const T &aV)
const
157 void GetVarByRef(
const T aBegin,
const T aEnd, T aDest)
const
160 std::copy(aBegin, aEnd, aDest);
184 read_signal_t mReadSignal;
206 bool IsFresh()
const {
return GetVar(mFresh); };
259 {
return interf_to_str(GetVar(mInfo->
addr.
interf)); };
275 void SetReplaceRule(
bool aReplace,
287 int HasCapability(uint32_t aType, uint32_t aSubtype);
297 int GetBoolProp(
char *aProperty,
bool *aValue);
307 int SetBoolProp(
char *aProperty,
bool aValue);
317 int GetIntProp(
char *aProperty, int32_t *aValue);
327 int SetIntProp(
char *aProperty, int32_t aValue);
337 int GetDblProp(
char *aProperty,
double *aValue);
347 int SetDblProp(
char *aProperty,
double aValue);
357 int GetStrProp(
char *aProperty,
char **aValue);
367 int SetStrProp(
char *aProperty,
char *aValue);
378 #ifdef HAVE_BOOST_SIGNALS
380 return mReadSignal.connect(aSubscriber);
392 #ifdef HAVE_BOOST_SIGNALS
394 aSubscriber.disconnect();
397 aSubscriber = aSubscriber;
char drivername[PLAYER_MAX_DRIVER_STRING_LEN]
The driver name.
Definition: playerc.h:877
PlayerClient * GetPlayerClient() const
Get a pointer to the Player Client.
Definition: clientproxy.h:235
double lasttime
Data timestamp from the previous data.
Definition: playerc.h:887
Common device info.
Definition: playerc.h:863
void DisconnectReadSignal(connection_t aSubscriber)
Disconnect a signal from this proxy.
Definition: clientproxy.h:390
bool IsValid() const
Proxy has any information.
Definition: clientproxy.h:197
Definition: playerclient.h:95
uint32_t GetInterface() const
Get Interface Code.
Definition: clientproxy.h:251
std::string GetInterfaceStr() const
Get Interface Name.
Definition: clientproxy.h:258
connection_t ConnectReadSignal(T aSubscriber)
Connect a read signal to this proxy.
Definition: clientproxy.h:376
player_devaddr_t addr
Device address.
Definition: playerc.h:874
The client proxy base class.
Definition: clientproxy.h:79
bool IsFresh() const
Check for fresh data.
Definition: clientproxy.h:206
Client object data.
Definition: playerc.h:506
std::string GetDriverName() const
Get the underlying driver's name.
Definition: clientproxy.h:221
double GetElapsedTime() const
Returns the time between the current data time and the time of the last data sample [s].
Definition: clientproxy.h:228
mutex_t mMutex
A mutex for handling synchronization.
Definition: playerclient.h:181
The PlayerClient is used for communicating with the player server.
Definition: playerclient.h:120
double datatime
Data timestamp, i.e., the time at which the data was generated (s).
Definition: playerc.h:884
double GetDataTime() const
Returns the received timestamp of the last data sample [s].
Definition: clientproxy.h:224
uint32_t GetIndex() const
Get device index.
Definition: clientproxy.h:243
uint16_t index
Which device of that interface.
Definition: player.h:155
uint16_t interf
The interface provided by the device; must be one of PLAYER_*_CODE.
Definition: player.h:153