Public Methods |
| | DataServer () |
| | Default constructor recommended to be used with Start(port) for correct error handling. More...
|
| | DataServer (int port) |
| | Constructor to spawn a DataServer thread at port "port". More...
|
| int | Start (int port=4096) |
| | Spawn a DataServer thread at port "port". More...
|
| | ~DataServer () |
| | Destructor for cleanup. More...
|
| void | RegisterCallback (void(*cb)(char *)) |
| | Register callback function of the form "void callback(char *keyword)" which is executed when any READ-WRITE data is modified by a DataClient. "keyword" contains the handle of the variable/data which has been modified. More...
|
| void | RegisterCallback (char *key, void(*cb)(void *), void *data) |
| | Register callback function of the form "void callback(void *data)" which is executed when READ-WRITE data registered by "keyword" is modified by a DataClient. More...
|
| int | isRunning () |
| | Returns whether the DataServer is running (or is Dead!). More...
|
| int | Stop () |
| | Stop the DataServer. It waits for existing DataClient connections to end. More...
|
| int | Wait () |
| | Get global lock. Wait if any other DataClient is accessing the critical section. More...
|
| int | Post () |
| | Release/Post global lock. More...
|
| int | Wait (char *keyword) |
| | Get lock on data registered by "keyword". Wait if any other DataClient is accessing the critical section. More...
|
| int | Post (char *keyword) |
| | Release/Post the lock on data registered by "keyword". More...
|
| int | SetDirty (char *keyword) |
| | Mark the data registered by "keyword" as dirty (modified). More...
|
| int | IsDirty (int change=1) |
| | Check whether any READ-WRITE data registered by DataServer has been modified by a DataClient. If "change" is omitted, the lock table is reset after returning the status. Else if "change" is specified as "zero", the lock table is unaltered. More...
|
| int | IsDirty (char *keyword, int change=1) |
| | Check whether the READ-WRITE data registered by "keyword" has been modified by a DataClient. If "change" is omitted, the lock table is reset after returning the status. Else if "change" is specified as "zero", the lock table is unaltered. More...
|
| int | IsDirtyID (int id, int change=1) |
| | Same as above, except that the internal KeyTable handle "id" is specified instead of the keyword. More...
|
| void | PrintDirty (ostream &out=cout, int change=0) |
| | Print modified READ-WRITE variables to the stream "out". If "change" is omitted, the lock table is reset after r eturning the status. Else if "change" is specified as "zero", the lock table is unaltered. More...
|
| int | NumKeys () |
| | Returns the number of keywords registered by DataServer. More...
|
| char * | Key (int i) |
| | Returns the key pointed to by KeyTable handle "i". More...
|
| char * | GetValue (char *keyword) |
| | Get the value (as a string) of the variable registered by "keyword". More...
|
| char * | GetValue (int i) |
| | Get the value (as a string) of the variable registered by the "keyword" whose internal KeyTable handle is "i". More...
|
| double | BytesSent () |
| | Total number of bytes sent through the DataServer class. More...
|
| double | BytesRecd () |
| | Total number of bytes received through the DataServer 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...
|
Protected Methods |
| virtual bool | isMaster () |
| virtual void | BroadcastData (void *var, int size) |
| template<class Etype> void | BroadcastVariable (Etype *var, int n=1) |
| virtual void | GetKeyword (RemoteSocket *C, char *key) |
| virtual int | AcceptClient () |
| virtual bool | isRunningMPI () |
| int | Synchronize (char *filename=NULL) |
| int | RegisterKey (char *key, DataType desc, char *type, int elem_size, int num_elems, char *perm, void *ptr=NULL) |
| template<class Etype> int | Register_Variable (RemoteSocket *C, int &flag, bool register_flag, char *inpkey, char *key, char *perm, Etype &data) |
| | Functions for data registration. More...
|
| template<class Etype> int | Register_Structure (RemoteSocket *C, int &flag, bool register_flag, char *inpkey, char *key, char *perm, Etype &data) |
| template<class Etype> int | Register_Static_Array (RemoteSocket *C, int &flag, bool register_flag, char *inpkey, char *key, char *perm, void *data, Etype &element, int totsize, int dim) |
| template<class Etype> int | Register_Dynamic_1D_Array (RemoteSocket *C, int &flag, bool register_flag, char *inpkey, char *key, char *perm, Etype *data, int &n1) |
| template<class Etype> int | Register_Dynamic_2D_Array (RemoteSocket *C, int &flag, bool register_flag, char *inpkey, char *key, char *perm, Etype **data, int &n1, int &n2) |
| template<class Etype> int | Register_Dynamic_3D_Array (RemoteSocket *C, int &flag, bool register_flag, char *inpkey, char *key, char *perm, Etype ***data, int &n1, int &n2, int &n3) |
| template<class Etype> int | Register_Dynamic_4D_Array (RemoteSocket *C, int &flag, bool register_flag, char *inpkey, char *key, char *perm, Etype ****data, int &n1, int &n2, int &n3, int &n4) |
Protected Attributes |
| KeyTable * | keytable |
| void(* | callback )(char *) |
Friends |
| class | DataServerMainThread |
| class | DataServerChildThread |