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::signals::connection connection_t;
94 typedef boost::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;
192 bool IsValid()
const {
return 0!=GetVar(mInfo->datatime); };
197 bool IsFresh()
const {
return GetVar(mFresh); };
211 {
return GetVar(mInfo->datatime) - GetVar(mInfo->lasttime); };
216 uint32_t
GetIndex()
const {
return GetVar(mInfo->addr.index); };
223 {
return interf_to_str(GetVar(mInfo->addr.interf)); };
238 void SetReplaceRule(
bool aReplace,
246 int HasCapability(uint32_t aType, uint32_t aSubtype);
249 int GetBoolProp(
char *aProperty,
bool *aValue);
252 int SetBoolProp(
char *aProperty,
bool aValue);
255 int GetIntProp(
char *aProperty, int32_t *aValue);
258 int SetIntProp(
char *aProperty, int32_t aValue);
261 int GetDblProp(
char *aProperty,
double *aValue);
264 int SetDblProp(
char *aProperty,
double aValue);
267 int GetStrProp(
char *aProperty,
char **aValue);
270 int SetStrProp(
char *aProperty,
char *aValue);
277 #ifdef HAVE_BOOST_SIGNALS
279 return mReadSignal.connect(aSubscriber);
288 #ifdef HAVE_BOOST_SIGNALS
290 aSubscriber.disconnect();
293 aSubscriber = aSubscriber;
std::string GetDriverName() const
Returns the driver name.
Definition: clientproxy.h:204
bool IsFresh() const
Fresh is set to true on each new read.
Definition: clientproxy.h:197
double GetElapsedTime() const
Returns the received timestamp [s].
Definition: clientproxy.h:210
Common device info.
Definition: playerc.h:814
double GetDataTime() const
Returns the received timestamp [s].
Definition: clientproxy.h:207
uint32_t GetInterface() const
Returns device interface.
Definition: clientproxy.h:219
void DisconnectReadSignal(connection_t aSubscriber)
Disconnect a signal to this proxy.
Definition: clientproxy.h:286
The PlayerClient is used for communicating with the player server.
Definition: playerclient.h:115
The client proxy base class.
Definition: clientproxy.h:79
Definition: playerclient.h:90
connection_t ConnectReadSignal(T aSubscriber)
Connect a signal to this proxy For more information check out Signals & multithreading.
Definition: clientproxy.h:275
Client object data.
Definition: playerc.h:460
uint32_t GetIndex() const
Returns device index.
Definition: clientproxy.h:216
std::string GetInterfaceStr() const
Returns device interface.
Definition: clientproxy.h:222
bool IsValid() const
Returns true if we have received any data from the device.
Definition: clientproxy.h:192
PlayerClient * GetPlayerClient() const
Returns a pointer to the Player Client.
Definition: clientproxy.h:214