#include <TGo4TaskManager.h>
Public Member Functions | |
TGo4TaskManager (const char *name, TGo4ServerTask *server, UInt_t negotiationport=0, Bool_t createconnector=kTRUE) | |
virtual | ~TGo4TaskManager () |
Int_t | ServeClient () |
used by connector runnable to wait for a client connect/disonnect request | |
Go4CommandMode_t | ClientLogin () |
Check account and password of the client that requests a connection to this server. | |
Int_t | ConnectClient (const char *client, const char *host, Go4CommandMode_t role=kGo4ComModeController) |
used by connector runnable to wait for a client request to connect to this server task. | |
Int_t | DisConnectClient (const char *name, Bool_t clientwait=kTRUE) |
disonnect an existing client by name, wait for negotiation OK if clientwait is true | |
Int_t | DisConnectClient (TGo4TaskHandler *taskhandler, Bool_t clientwait=kTRUE) |
disonnect an existing client by name, wait for negotiation OK if clientwait is true | |
Bool_t | AddClient (const char *client, const char *host, Go4CommandMode_t role) |
adds client task of name to manager: create server task handler and try to connect to client Command execution role depends on previous login passowrd | |
Bool_t | AddTaskHandler (TGo4TaskHandler *han) |
adds external task handler to array | |
TGo4TaskHandler * | NewTaskHandler (const char *name) |
creates new task handler with given name and adds it into array | |
Bool_t | RemoveTaskHandler (const char *name) |
removes task handler from array by name | |
TGo4TaskHandler * | GetTaskHandler (const char *name) |
returns certain task handler by name | |
TGo4TaskHandler * | GetLastTaskHandler () |
returns last task handler in list | |
TGo4TaskHandler * | NextTaskHandler (Bool_t reset=kFALSE) |
For iteration over all connected task handlers. | |
TMutex * | GetMutex () |
UInt_t | GetTaskCount () const |
Number of entries in taskhandler list, i.e. | |
UInt_t | GetNegotiationPort () |
returns the portnumber for client server negotiation port which is actually used by the running taskmanager | |
Int_t | WaitForClientRemoved () |
Bool_t | HasControllerTask () |
Static Public Attributes | |
static const Int_t | fgiDISCONCYCLES = 360 |
cycles to wait for client disconnection | |
static const UInt_t | fguDISCONTIME = 500 |
time for each disonnection wait cycle | |
Private Member Functions | |
TGo4TaskManager () | |
TGo4TaskManager (const TGo4TaskManager &right) | |
Private Attributes | |
TGo4ServerTask * | fxServer |
TGo4Socket * | fxTransport |
TObjArray * | fxTaskList |
1. | |
TMutex * | fxListMutex |
TIterator * | fxTaskIter |
Iterator over list of tasks. | |
UInt_t | fuTaskCount |
1. | |
UInt_t | fuNegotiationPort |
port number for the server client negotiation connections | |
Bool_t | fbClientIsRemoved |
True if the last specified client is removed from server. | |
Bool_t | fbHasControllerConnection |
true if this server already has one connection to a master client that has the controller role. |
Definition at line 27 of file TGo4TaskManager.h.
TGo4TaskManager::TGo4TaskManager | ( | const char * | name, | |
TGo4ServerTask * | server, | |||
UInt_t | negotiationport = 0 , |
|||
Bool_t | createconnector = kTRUE | |||
) |
Definition at line 33 of file TGo4TaskManager.cxx.
TGo4TaskManager::~TGo4TaskManager | ( | ) | [virtual] |
Definition at line 69 of file TGo4TaskManager.cxx.
TGo4TaskManager::TGo4TaskManager | ( | ) | [private] |
TGo4TaskManager::TGo4TaskManager | ( | const TGo4TaskManager & | right | ) | [private] |
Int_t TGo4TaskManager::ServeClient | ( | ) |
used by connector runnable to wait for a client connect/disonnect request
Definition at line 81 of file TGo4TaskManager.cxx.
Go4CommandMode_t TGo4TaskManager::ClientLogin | ( | ) |
Check account and password of the client that requests a connection to this server.
Return value specifies client access priorities as defined in TGo4Command.h Returns 0 in case of incorrect login.
Definition at line 209 of file TGo4TaskManager.cxx.
Int_t TGo4TaskManager::ConnectClient | ( | const char * | client, | |
const char * | host, | |||
Go4CommandMode_t | role = kGo4ComModeController | |||
) |
used by connector runnable to wait for a client request to connect to this server task.
May specify mode of allowed commands in case of client is master.
Definition at line 300 of file TGo4TaskManager.cxx.
Int_t TGo4TaskManager::DisConnectClient | ( | const char * | name, | |
Bool_t | clientwait = kTRUE | |||
) |
disonnect an existing client by name, wait for negotiation OK if clientwait is true
Definition at line 310 of file TGo4TaskManager.cxx.
Int_t TGo4TaskManager::DisConnectClient | ( | TGo4TaskHandler * | taskhandler, | |
Bool_t | clientwait = kTRUE | |||
) |
disonnect an existing client by name, wait for negotiation OK if clientwait is true
Definition at line 324 of file TGo4TaskManager.cxx.
Bool_t TGo4TaskManager::AddClient | ( | const char * | client, | |
const char * | host, | |||
Go4CommandMode_t | role | |||
) |
adds client task of name to manager: create server task handler and try to connect to client Command execution role depends on previous login passowrd
Definition at line 371 of file TGo4TaskManager.cxx.
Bool_t TGo4TaskManager::AddTaskHandler | ( | TGo4TaskHandler * | han | ) |
TGo4TaskHandler * TGo4TaskManager::NewTaskHandler | ( | const char * | name | ) |
creates new task handler with given name and adds it into array
Definition at line 427 of file TGo4TaskManager.cxx.
Bool_t TGo4TaskManager::RemoveTaskHandler | ( | const char * | name | ) |
TGo4TaskHandler * TGo4TaskManager::GetTaskHandler | ( | const char * | name | ) |
TGo4TaskHandler * TGo4TaskManager::GetLastTaskHandler | ( | ) |
TGo4TaskHandler * TGo4TaskManager::NextTaskHandler | ( | Bool_t | reset = kFALSE |
) |
For iteration over all connected task handlers.
If reset is true, internal iterator will be reset. Otherwies, continue iterating list until last entry. Returns 0 when iteration finishes.
Definition at line 502 of file TGo4TaskManager.cxx.
TMutex* TGo4TaskManager::GetMutex | ( | ) | [inline] |
Definition at line 103 of file TGo4TaskManager.h.
UInt_t TGo4TaskManager::GetTaskCount | ( | ) | const [inline] |
Number of entries in taskhandler list, i.e.
number of connected clients
Definition at line 106 of file TGo4TaskManager.h.
UInt_t TGo4TaskManager::GetNegotiationPort | ( | ) |
returns the portnumber for client server negotiation port which is actually used by the running taskmanager
Definition at line 536 of file TGo4TaskManager.cxx.
Int_t TGo4TaskManager::WaitForClientRemoved | ( | ) |
Definition at line 511 of file TGo4TaskManager.cxx.
Bool_t TGo4TaskManager::HasControllerTask | ( | ) | [inline] |
Definition at line 118 of file TGo4TaskManager.h.
const Int_t TGo4TaskManager::fgiDISCONCYCLES = 360 [static] |
const UInt_t TGo4TaskManager::fguDISCONTIME = 500 [static] |
TGo4ServerTask* TGo4TaskManager::fxServer [private] |
Definition at line 138 of file TGo4TaskManager.h.
TGo4Socket* TGo4TaskManager::fxTransport [private] |
Definition at line 140 of file TGo4TaskManager.h.
TObjArray* TGo4TaskManager::fxTaskList [private] |
TMutex* TGo4TaskManager::fxListMutex [private] |
Definition at line 146 of file TGo4TaskManager.h.
TIterator* TGo4TaskManager::fxTaskIter [private] |
UInt_t TGo4TaskManager::fuTaskCount [private] |
UInt_t TGo4TaskManager::fuNegotiationPort [private] |
port number for the server client negotiation connections
Definition at line 162 of file TGo4TaskManager.h.
Bool_t TGo4TaskManager::fbClientIsRemoved [private] |
True if the last specified client is removed from server.
flag is set by connector thread who performs the DisconnectClient of TaskManager; is reset by WaitForClientRemoved method.
Definition at line 169 of file TGo4TaskManager.h.
Bool_t TGo4TaskManager::fbHasControllerConnection [private] |
true if this server already has one connection to a master client that has the controller role.
Only one controller or administrator taskhandler is allowed per server.
Definition at line 174 of file TGo4TaskManager.h.