#include <dataclient.h>
Inheritance diagram for DataClient::

Public Methods | |
| DataClient () | |
| Default constructor recommended to be used with Connect(host, port) for correct error handling. More... | |
| DataClient (char *host, int port=4096) | |
| Constructor to connect to server "host" at port "port". More... | |
| ~DataClient () | |
| Destructor (calls Disconnect()). More... | |
| int | Connect (char *host, int port=4096) |
| Connect to server "host" at port "port" Returns POSSE_SUCCESS on success. More... | |
| int | Disconnect () |
| Disconect from server. More... | |
| char * | ServerName () |
| Returns the name cf the server connected to. More... | |
| int | Port () |
| Returns the port number cf the server connected to. More... | |
| bool | isBigEndian () |
| Returns whether DataServer is running on Big Endian architecture. More... | |
| bool | isValidKeyword (char *keyword, int *handle=NULL) |
| Returns whether "keyword" is registered by DataServer. Returns the integer "handle" corresponding to the keyword. More... | |
| int | SetPrintFlag (int flag) |
| Set Print Flag for miscellaneous output. More... | |
| KeyTable * | GetTable () |
| Get the keytable. More... | |
| bool | isWritable (char *keyword) |
| Returns whether the data pointed by "keyword" is READ-WRITE. More... | |
| int | RecvKeyTable (KeyTable *K=NULL) |
| Receives keytable from DataServer into "K", else updates the copy within the class. More... | |
| VariableType | VarType (char *keyword) |
| Returns type of variable "keyword". Possible types: UNKNOWN, CHAR, SHORT, INT, LONG, FLOAT, DOUBLE. More... | |
| char * | RecvValue (char *keyword) |
| Retuns value (as a string) for "keyword" if it is a valid variable. More... | |
| int | SendValue (char *keyword, char *value) |
| Send string "value" for "keyword" if it is a valid variable. More... | |
| void | ListKeywords () |
| List the keywords registered by DataServer on standard output. More... | |
| void | ListValues () |
| List variable and their values registered by DataServer. More... | |
| template<class Etype> int | SendVariable (char *keyword, Etype a) |
| Send variable value for "keyword". More... | |
| template<class Etype> int | RecvVariable (char *keyword, Etype *a) |
| Receive variable value registered by "keyword". More... | |
| template<class Etype> Etype | RecvVariable (char *keyword) |
| Receive variable value registered by "keyword". More... | |
| int | SendArray (char *keyword, void *a) |
| Send 1D/2D/3D/4D static array registered by "keyword". More... | |
| int | RecvArray (char *keyword, void *a) |
| Receive 1D/2D/3D/4D static array registered by "keyword". More... | |
| int | getArrayDim (char *keyword, int dim) |
| Get the "dim"th dimension for the dynamic array registered by "keyword". More... | |
| template<class Etype> int | SendArray1D (char *keyword, Etype *a) |
| Send 1D dynamic array registered by "keyword". More... | |
| template<class Etype> int | RecvArray1D (char *keyword, Etype *a) |
| Receive 1D dynamic array registered by "keyword". More... | |
| template<class Etype> int | RecvArray1D (char *keyword, Etype **ptr) |
| Receive 1D dynamic array registered by "keyword" after allocating the correct dimensions (memory) to "ptr". It assumes that "ptr" has not been allocated any memory prior to this call. More... | |
| template<class Etype> int | SendArray2D (char *keyword, Etype **a) |
| Send 2D dynamic array registered by "keyword". More... | |
| template<class Etype> int | RecvArray2D (char *keyword, Etype **a) |
| Receive 2D dynamic array registered by "keyword". More... | |
| template<class Etype> int | RecvArray2D (char *keyword, Etype ***ptr) |
| Receive 2D dynamic array registered by "keyword" after allocating the correct dimensions (memory) to "ptr". It assumes that "ptr" has not been allocated any memory prior to this call. More... | |
| template<class Etype> int | SendArray3D (char *keyword, Etype ***a) |
| Send 3D dynamic array registered by "keyword". More... | |
| template<class Etype> int | RecvArray3D (char *keyword, Etype ***a) |
| Receive 3D dynamic array registered by "keyword". More... | |
| template<class Etype> int | RecvArray3D (char *keyword, Etype ****ptr) |
| Receive 3D dynamic array registered by "keyword" after allocating the correct dimensions (memory) to "ptr". It assumes that "ptr" has not been allocated any memory prior to this call. More... | |
| template<class Etype> int | SendArray4D (char *keyword, Etype ****a) |
| Send 4D dynamic array registered by "keyword". More... | |
| template<class Etype> int | RecvArray4D (char *keyword, Etype ****a) |
| Receive 4D dynamic array registered by "keyword". More... | |
| template<class Etype> int | RecvArray4D (char *keyword, Etype *****ptr) |
| Receive 4D dynamic array registered by "keyword" after allocating the correct dimensions (memory) to "ptr". It assumes that "ptr" has not been allocated any memory prior to this call. More... | |
| template<class myStruct> int | SendStruct (char *keyword, myStruct *S, Semaphore *sem=NULL) |
| Send User-Defined Structure registered by "keyword". Assumes that fuction packStruct(myStruct *S, unsigned char **dataptr, int &totsize) is defined. More... | |
| template<class myStruct> double | RecvStruct (char *keyword, myStruct *S, Semaphore *sem=NULL) |
| Receive User-Defined Structure registered by "keyword". Assumes that fuction unpackStruct(myStruct *S, unsigned char *dataptr, int size) is defined. More... | |
| int | SendFile (char *filename, char *destfile=NULL) |
| Send local file "filename" to DataServer as "destfile". If "destfile" is not specifed, destination file name is same as "filename". More... | |
| int | RecvFile (char *filename, char *destfile=NULL) |
| Receive remote file "filename" from DataServer as "destfile". If "destfile" is not specifed, the received file is same as "filename". More... | |
| double | BytesSent () |
| Total number of bytes sent through the DataClient class. More... | |
| double | BytesRecd () |
| Total number of bytes received through the DataClient class. More... | |
| int | SendTime () |
| Time to send BytesSent() bytes of data (in ms). More... | |
| int | RecvTime () |
| Time to receive BytesRecd() bytes of data (in ms). More... | |
| double | SendRate () |
| Network bandwidth (in Mbps) for data sent. More... | |
| double | RecvRate () |
| Network bandwidth (in Mbps) for data received. More... | |
|
|
Default constructor recommended to be used with Connect(host, port) for correct error handling.
Definition at line 8 of file dataclient.cc. |
|
||||||||||||
|
Constructor to connect to server "host" at port "port".
Definition at line 16 of file dataclient.cc. References Connect(). |
|
|
Destructor (calls Disconnect()).
Definition at line 25 of file dataclient.cc. References Disconnect(). |
|
|
Total number of bytes received through the DataClient class.
Reimplemented from TCPSocket. Definition at line 200 of file dataclient.h. References TCPSocket::BytesRecd(). Referenced by RecvRate(). |
|
|
Total number of bytes sent through the DataClient class.
Reimplemented from TCPSocket. Definition at line 197 of file dataclient.h. References TCPSocket::BytesSent(). Referenced by SendRate(). |
|
||||||||||||
|
Connect to server "host" at port "port" Returns POSSE_SUCCESS on success.
Reimplemented from TCPSocket. Definition at line 31 of file dataclient.cc. References TCPSocket::Connect(), ERR_RECV_MESG, POSSE_FAILURE, POSSE_RETRY, POSSE_SUCCESS, RecvKeyTable(), and VERIFICATION_NUMBER. Referenced by DataClient(). |
|
|
Disconect from server.
Definition at line 81 of file dataclient.cc. References TCPSocket::Close(). Referenced by ~DataClient(). |
|
||||||||||||
|
Get the "dim"th dimension for the dynamic array registered by "keyword".
Definition at line 418 of file dataclient.cc. References KeyTable::Description(), DYNAMIC_1D_ARRAY, ERR_BAD_DATA, isValidKeyword(), and KeyTable::key. |
|
|
Get the keytable.
Definition at line 273 of file dataclient.cc. |
|
|
Returns whether DataServer is running on Big Endian architecture.
Definition at line 389 of file dataclient.cc. References DYNAMIC_1D_ARRAY. |
|
||||||||||||
|
Returns whether "keyword" is registered by DataServer. Returns the integer "handle" corresponding to the keyword.
Definition at line 278 of file dataclient.cc. References KeyTable::getKeyHandle(), and KeyTable::n. Referenced by getArrayDim(). |
|
|
Returns whether the data pointed by "keyword" is READ-WRITE.
Definition at line 305 of file dataclient.cc. References KeyTable::getKeyHandle(), and KeyTable::n. Referenced by SendValue(). |
|
|
List the keywords registered by DataServer on standard output.
Definition at line 262 of file dataclient.cc. References KeyTable::List(). |
|
|
List variable and their values registered by DataServer.
Definition at line 267 of file dataclient.cc. References KeyTable::ListValues(), and RecvKeyTable(). |
|
|
Returns the port number cf the server connected to.
Definition at line 56 of file dataclient.h. |
|
||||||||||||
|
Receive 1D/2D/3D/4D static array registered by "keyword".
Referenced by RecvValue(). |
|
||||||||||||||||
|
Receive 1D dynamic array registered by "keyword" after allocating the correct dimensions (memory) to "ptr". It assumes that "ptr" has not been allocated any memory prior to this call.
|
|
||||||||||||||||
|
Receive 1D dynamic array registered by "keyword".
|
|
||||||||||||||||
|
Receive 2D dynamic array registered by "keyword" after allocating the correct dimensions (memory) to "ptr". It assumes that "ptr" has not been allocated any memory prior to this call.
|
|
||||||||||||||||
|
Receive 2D dynamic array registered by "keyword".
|
|
||||||||||||||||
|
Receive 3D dynamic array registered by "keyword" after allocating the correct dimensions (memory) to "ptr". It assumes that "ptr" has not been allocated any memory prior to this call.
|
|
||||||||||||||||
|
Receive 3D dynamic array registered by "keyword".
|
|
||||||||||||||||
|
Receive 4D dynamic array registered by "keyword" after allocating the correct dimensions (memory) to "ptr". It assumes that "ptr" has not been allocated any memory prior to this call.
|
|
||||||||||||||||
|
Receive 4D dynamic array registered by "keyword".
|
|
||||||||||||
|
Receive remote file "filename" from DataServer as "destfile". If "destfile" is not specifed, the received file is same as "filename".
|
|
|
Receives keytable from DataServer into "K", else updates the copy within the class.
Definition at line 100 of file dataclient.cc. References RemoteSocket::RecvStruct(). Referenced by Connect(), and ListValues(). |
|
|
Network bandwidth (in Mbps) for data received.
Reimplemented from TCPSocket. Definition at line 212 of file dataclient.h. |
|
||||||||||||||||||||
|
Receive User-Defined Structure registered by "keyword". Assumes that fuction unpackStruct(myStruct *S, unsigned char *dataptr, int size) is defined.
|
|
|
Time to receive BytesRecd() bytes of data (in ms).
Reimplemented from TCPSocket. Definition at line 206 of file dataclient.h. References TCPSocket::RecvTime(). Referenced by RecvRate(). |
|
|
Retuns value (as a string) for "keyword" if it is a valid variable.
Definition at line 121 of file dataclient.cc. References CHAR, DOUBLE, FLOAT, KeyTable::getKeyHandle(), INT, KeyTable::isCharArray(), KeyTable::isViewableVar(), KeyTable::key, LONG, KeyTable::n, RecvArray(), RecvVariable(), SHORT, UNKNOWN, and VariableType. |
|
||||||||||
|
Receive variable value registered by "keyword".
|
|
||||||||||||||||
|
Receive variable value registered by "keyword".
Referenced by RecvValue(). |
|
||||||||||||
|
Send 1D/2D/3D/4D static array registered by "keyword".
Referenced by SendValue(). |
|
||||||||||||||||
|
Send 1D dynamic array registered by "keyword".
|
|
||||||||||||||||
|
Send 2D dynamic array registered by "keyword".
|
|
||||||||||||||||
|
Send 3D dynamic array registered by "keyword".
|
|
||||||||||||||||
|
Send 4D dynamic array registered by "keyword".
|
|
||||||||||||
|
Send local file "filename" to DataServer as "destfile". If "destfile" is not specifed, destination file name is same as "filename".
|
|
|
Network bandwidth (in Mbps) for data sent.
Reimplemented from TCPSocket. Definition at line 209 of file dataclient.h. |
|
||||||||||||||||||||
|
Send User-Defined Structure registered by "keyword". Assumes that fuction packStruct(myStruct *S, unsigned char **dataptr, int &totsize) is defined.
|
|
|
Time to send BytesSent() bytes of data (in ms).
Reimplemented from TCPSocket. Definition at line 203 of file dataclient.h. References TCPSocket::SendTime(). Referenced by SendRate(). |
|
||||||||||||
|
Send string "value" for "keyword" if it is a valid variable.
Definition at line 186 of file dataclient.cc. References CHAR, DOUBLE, FLOAT, KeyTable::getKeyHandle(), INT, KeyTable::isCharArray(), KeyTable::isViewableVar(), isWritable(), KeyTable::key, LONG, KeyTable::n, POSSE_INVALID_KEY, POSSE_INVALID_VARIABLE, POSSE_READONLY_KEY, POSSE_SUCCESS, SendArray(), SendVariable(), and SHORT. |
|
||||||||||||||||
|
Send variable value for "keyword".
Referenced by SendValue(). |
|
|
Returns the name cf the server connected to.
Definition at line 53 of file dataclient.h. |
|
|
Set Print Flag for miscellaneous output.
Reimplemented from RemoteSocket. Definition at line 66 of file dataclient.h. References RemoteSocket::SetPrintFlag(), and VariableType. |
|
|
Returns type of variable "keyword". Possible types: UNKNOWN, CHAR, SHORT, INT, LONG, FLOAT, DOUBLE.
Definition at line 109 of file dataclient.cc. References KeyTable::getKeyHandle(), KeyTable::key, KeyTable::n, UNKNOWN, and VariableType. |
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001