Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

DataClient Class Reference

#include <dataclient.h>

Inheritance diagram for DataClient::

RemoteSocket List of all members.

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...

KeyTableGetTable ()
 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...


Constructor & Destructor Documentation

DataClient::DataClient  
 

Default constructor recommended to be used with Connect(host, port) for correct error handling.

DataClient::DataClient char *    host,
int    port = 4096
 

Constructor to connect to server "host" at port "port".

DataClient::~DataClient  
 

Destructor (calls Disconnect()).


Member Function Documentation

double DataClient::BytesRecd   [inline]
 

Total number of bytes received through the DataClient class.

Reimplemented from TCPSocket.

double DataClient::BytesSent   [inline]
 

Total number of bytes sent through the DataClient class.

Reimplemented from TCPSocket.

int DataClient::Connect char *    host,
int    port = 4096
 

Connect to server "host" at port "port" Returns POSSE_SUCCESS on success.

Reimplemented from TCPSocket.

int DataClient::Disconnect  
 

Disconect from server.

int DataClient::getArrayDim char *    keyword,
int    dim
 

Get the "dim"th dimension for the dynamic array registered by "keyword".

KeyTable * DataClient::GetTable  
 

Get the keytable.

bool DataClient::isBigEndian  
 

Returns whether DataServer is running on Big Endian architecture.

bool DataClient::isValidKeyword char *    keyword,
int *    handle = NULL
 

Returns whether "keyword" is registered by DataServer. Returns the integer "handle" corresponding to the keyword.

bool DataClient::isWritable char *    keyword
 

Returns whether the data pointed by "keyword" is READ-WRITE.

void DataClient::ListKeywords  
 

List the keywords registered by DataServer on standard output.

void DataClient::ListValues  
 

List variable and their values registered by DataServer.

int DataClient::Port   [inline]
 

Returns the port number cf the server connected to.

int DataClient::RecvArray char *    keyword,
void *    a
 

Receive 1D/2D/3D/4D static array registered by "keyword".

template<class Etype>
int DataClient::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.

template<class Etype>
int DataClient::RecvArray1D char *    keyword,
Etype *    a
 

Receive 1D dynamic array registered by "keyword".

template<class Etype>
int DataClient::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.

template<class Etype>
int DataClient::RecvArray2D char *    keyword,
Etype **    a
 

Receive 2D dynamic array registered by "keyword".

template<class Etype>
int DataClient::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.

template<class Etype>
int DataClient::RecvArray3D char *    keyword,
Etype ***    a
 

Receive 3D dynamic array registered by "keyword".

template<class Etype>
int DataClient::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.

template<class Etype>
int DataClient::RecvArray4D char *    keyword,
Etype ****    a
 

Receive 4D dynamic array registered by "keyword".

int DataClient::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".

int DataClient::RecvKeyTable KeyTable   K = NULL
 

Receives keytable from DataServer into "K", else updates the copy within the class.

double DataClient::RecvRate   [inline]
 

Network bandwidth (in Mbps) for data received.

Reimplemented from TCPSocket.

template<class myStruct>
double DataClient::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.

int DataClient::RecvTime   [inline]
 

Time to receive BytesRecd() bytes of data (in ms).

Reimplemented from TCPSocket.

char * DataClient::RecvValue char *    keyword
 

Retuns value (as a string) for "keyword" if it is a valid variable.

template<class Etype>
Etype DataClient::RecvVariable char *    keyword
 

Receive variable value registered by "keyword".

template<class Etype>
int DataClient::RecvVariable char *    keyword,
Etype *    a
 

Receive variable value registered by "keyword".

int DataClient::SendArray char *    keyword,
void *    a
 

Send 1D/2D/3D/4D static array registered by "keyword".

template<class Etype>
int DataClient::SendArray1D char *    keyword,
Etype *    a
 

Send 1D dynamic array registered by "keyword".

template<class Etype>
int DataClient::SendArray2D char *    keyword,
Etype **    a
 

Send 2D dynamic array registered by "keyword".

template<class Etype>
int DataClient::SendArray3D char *    keyword,
Etype ***    a
 

Send 3D dynamic array registered by "keyword".

template<class Etype>
int DataClient::SendArray4D char *    keyword,
Etype ****    a
 

Send 4D dynamic array registered by "keyword".

int DataClient::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".

double DataClient::SendRate   [inline]
 

Network bandwidth (in Mbps) for data sent.

Reimplemented from TCPSocket.

template<class myStruct>
int DataClient::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.

int DataClient::SendTime   [inline]
 

Time to send BytesSent() bytes of data (in ms).

Reimplemented from TCPSocket.

int DataClient::SendValue char *    keyword,
char *    value
 

Send string "value" for "keyword" if it is a valid variable.

template<class Etype>
int DataClient::SendVariable char *    keyword,
Etype    a
 

Send variable value for "keyword".

char* DataClient::ServerName   [inline]
 

Returns the name cf the server connected to.

int DataClient::SetPrintFlag int    flag [inline]
 

Set Print Flag for miscellaneous output.

Reimplemented from RemoteSocket.

VariableType DataClient::VarType char *    keyword
 

Returns type of variable "keyword". Possible types: UNKNOWN, CHAR, SHORT, INT, LONG, FLOAT, DOUBLE.


The documentation for this class was generated from the following files:
Generated on Sun Jun 16 17:36:47 2002 for Anirudh's Vortex-Wake Simulation Code by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001