#include <rldataprovider.h>
|
| rlDataProviderClient () |
|
virtual | ~rlDataProviderClient () |
|
int | getInt (rlSocket *socket, int id, int *status) |
|
float | getFloat (rlSocket *socket, int id, int *status) |
|
int | getIntArray (rlSocket *socket, int id, int *array, int nmax) |
|
int | getFloatArray (rlSocket *socket, int id, float *array, int nmax) |
|
const char * | getString (rlSocket *socket, int id, int *status) |
|
int | setInt (rlSocket *socket, int id, int i) |
|
int | setFloat (rlSocket *socket, int id, float f) |
|
int | setIntArray (rlSocket *socket, int id, int *i, int num) |
|
int | setFloatArray (rlSocket *socket, int id, float *f, int num) |
|
int | setString (rlSocket *socket, int id, const char *str) |
|
int | getIntAndReset (rlSocket *socket, int id, int *status) |
|
int | setIntAndWaitForReset (rlSocket *socket, int id, int i) |
|
int | getInt0Semaphore (rlSocket *socket, int *status) |
|
This class is a client that can access rlDataProvider over TCP.
Definition at line 62 of file rldataprovider.h.
◆ rlDataProviderClient()
rlDataProviderClient::rlDataProviderClient |
( |
| ) |
|
◆ ~rlDataProviderClient()
rlDataProviderClient::~rlDataProviderClient |
( |
| ) |
|
|
virtual |
◆ getFloat()
float rlDataProviderClient::getFloat |
( |
rlSocket * |
socket, |
|
|
int |
id, |
|
|
int * |
status |
|
) |
| |
Definition at line 368 of file rldataprovider.cpp.
375 socket->
printf(
"getFloat(%d)\n",
id);
int readStr(char *buf, int len, int timeout=0)
int isCommand(const char *command)
rlInterpreter interpreter
int printf(const char *format,...)
◆ getFloatArray()
int rlDataProviderClient::getFloatArray |
( |
rlSocket * |
socket, |
|
|
int |
id, |
|
|
float * |
array, |
|
|
int |
nmax |
|
) |
| |
Definition at line 418 of file rldataprovider.cpp.
421 const char *cptr =
getString(socket,
id,&status);
422 if(status != 0)
return -1;
427 if(cptr == NULL || *cptr ==
'\0')
break;
428 if(*cptr !=
',' && *cptr !=
'\"')
430 sscanf(cptr,
"%f",&array[ret++]);
431 cptr = strchr(cptr,
',');
432 if(cptr != NULL) cptr++;
433 if(ret >= nmax)
break;
const char * getString(rlSocket *socket, int id, int *status)
◆ getInt()
int rlDataProviderClient::getInt |
( |
rlSocket * |
socket, |
|
|
int |
id, |
|
|
int * |
status |
|
) |
| |
Definition at line 344 of file rldataprovider.cpp.
350 socket->
printf(
"getInt(%d)\n",
id);
int readStr(char *buf, int len, int timeout=0)
int isCommand(const char *command)
rlInterpreter interpreter
int printf(const char *format,...)
◆ getInt0Semaphore()
int rlDataProviderClient::getInt0Semaphore |
( |
rlSocket * |
socket, |
|
|
int * |
status |
|
) |
| |
Definition at line 555 of file rldataprovider.cpp.
561 socket->
printf(
"getInt0Semaphore()\n");
563 if(ret == 0) { *status = -2;
return 0; }
int readStr(char *buf, int len, int timeout=0)
int isCommand(const char *command)
rlInterpreter interpreter
int printf(const char *format,...)
◆ getIntAndReset()
int rlDataProviderClient::getIntAndReset |
( |
rlSocket * |
socket, |
|
|
int |
id, |
|
|
int * |
status |
|
) |
| |
Definition at line 525 of file rldataprovider.cpp.
531 socket->
printf(
"getIntAndReset(%d)\n",
id);
int readStr(char *buf, int len, int timeout=0)
int isCommand(const char *command)
rlInterpreter interpreter
int printf(const char *format,...)
◆ getIntArray()
int rlDataProviderClient::getIntArray |
( |
rlSocket * |
socket, |
|
|
int |
id, |
|
|
int * |
array, |
|
|
int |
nmax |
|
) |
| |
Definition at line 393 of file rldataprovider.cpp.
396 const char *cptr =
getString(socket,
id,&status);
397 if(status != 0)
return -1;
402 if(cptr == NULL || *cptr ==
'\0')
break;
403 if(*cptr !=
',' && *cptr !=
'\"')
405 sscanf(cptr,
"%d",&array[ret++]);
406 cptr = strchr(cptr,
',');
407 if(cptr != NULL) cptr++;
408 if(ret >= nmax)
break;
const char * getString(rlSocket *socket, int id, int *status)
◆ getString()
const char * rlDataProviderClient::getString |
( |
rlSocket * |
socket, |
|
|
int |
id, |
|
|
int * |
status |
|
) |
| |
Definition at line 443 of file rldataprovider.cpp.
449 socket->
printf(
"getString(%d)\n",
id);
int readStr(char *buf, int len, int timeout=0)
char cret[rl_PRINTF_LENGTH]
int isCommand(const char *command)
rlInterpreter interpreter
void copyStringParam(char *destination, int index)
int printf(const char *format,...)
◆ setFloat()
int rlDataProviderClient::setFloat |
( |
rlSocket * |
socket, |
|
|
int |
id, |
|
|
float |
f |
|
) |
| |
Definition at line 473 of file rldataprovider.cpp.
476 return socket->
printf(
"float(%d,%d)\n",
id,f);
int printf(const char *format,...)
◆ setFloatArray()
int rlDataProviderClient::setFloatArray |
( |
rlSocket * |
socket, |
|
|
int |
id, |
|
|
float * |
f, |
|
|
int |
num |
|
) |
| |
Definition at line 499 of file rldataprovider.cpp.
504 if(num <= 0)
return -1;
506 sprintf(buf,
"string(%d,\"",
id);
508 for(ind=0; ind<num; ind++)
510 sprintf(val,
"%f,",f[ind]);
511 if(ipos+(
int)strlen(val) >= nmax)
return -1;
516 return socket->
printf(buf);
int printf(const char *format,...)
◆ setInt()
int rlDataProviderClient::setInt |
( |
rlSocket * |
socket, |
|
|
int |
id, |
|
|
int |
i |
|
) |
| |
◆ setIntAndWaitForReset()
int rlDataProviderClient::setIntAndWaitForReset |
( |
rlSocket * |
socket, |
|
|
int |
id, |
|
|
int |
i |
|
) |
| |
Definition at line 549 of file rldataprovider.cpp.
552 return socket->
printf(
"intAndReset(%d,%d)\n",
id,i);
int printf(const char *format,...)
◆ setIntArray()
int rlDataProviderClient::setIntArray |
( |
rlSocket * |
socket, |
|
|
int |
id, |
|
|
int * |
i, |
|
|
int |
num |
|
) |
| |
Definition at line 479 of file rldataprovider.cpp.
484 if(num <= 0)
return -1;
486 sprintf(buf,
"string(%d,\"",
id);
488 for(ind=0; ind<num; ind++)
490 sprintf(val,
"%d,",i[ind]);
491 if(ipos+(
int)strlen(val) >= nmax)
return -1;
496 return socket->
printf(buf);
int printf(const char *format,...)
◆ setString()
int rlDataProviderClient::setString |
( |
rlSocket * |
socket, |
|
|
int |
id, |
|
|
const char * |
str |
|
) |
| |
Definition at line 519 of file rldataprovider.cpp.
522 return socket->
printf(
"string(%d,\"%d\")\n",
id,str);
int printf(const char *format,...)
◆ cret
◆ interpreter
The documentation for this class was generated from the following files: