#include <TGo4ClientTask.h>
Public Member Functions | |
TGo4ClientTask (const char *name, const char *serverhost="localhost", UInt_t negotiationport=0, Bool_t blockingmode=kTRUE, Bool_t standalone=kFALSE, Bool_t autostart=kFALSE, Bool_t autocreate=kTRUE, Bool_t ismaster=kFALSE, Bool_t autoconnect=kTRUE) | |
virtual | ~TGo4ClientTask () |
virtual Int_t | Initialization () |
override the ThreadManager Initialization used by AppControlTimer to let this thing initialize the client transport connection | |
virtual void | Quit () |
Quit the client; method to be called from command object, may be overridden in user implementation. | |
virtual TGo4TaskStatus * | CreateStatus () |
create a status object with information on the current client state. | |
TGo4TaskHandler * | GetTaskHandler () |
void | AddLocalCommand (TGo4Command *com) |
Put command into the command queue for local execution in main thread. | |
TGo4BufferQueue * | GetCommandQueue (const char *task=0) |
TGo4BufferQueue * | GetStatusQueue (const char *task=0) |
TGo4BufferQueue * | GetDataQueue (const char *task=0) |
Bool_t | ConnectServer (const char *node, UInt_t negport, Go4CommandMode_t role=kGo4ComModeRefused, const char *passwd=0) |
Connect this client to a waiting server task on node with negotiation channel negport. | |
Bool_t | DisconnectServer (Bool_t isterminating=kFALSE) |
Disconnect the current server task, but do not terminate the client. | |
const char * | GetServerHostName () |
Bool_t | IsConnected () |
Protected Member Functions | |
virtual void | UpdateStatus (TGo4TaskStatus *state) |
method needed by method CreateStatus of any status subclasses to set the values of the clienttask specific part of the status object. | |
Private Attributes | |
TGo4BufferQueue * | fxStatusQ |
TGo4BufferQueue * | fxDataQ |
TGo4BufferQueue * | fxCommandQ |
TGo4TaskHandler * | fxTaskHandler |
1 1 | |
TString | fxServerHostname |
hostname of server machine | |
Bool_t | fbAutoConnect |
!True if client task shall try to connect automatically at Initialization. | |
Bool_t | fbServerConnected |
true if connection to server is established, otherwise false |
Apart from the transport threads, the application class which inherits from client task may provide working threads to serve the data queues and do the actual work
Definition at line 34 of file TGo4ClientTask.h.
TGo4ClientTask::TGo4ClientTask | ( | const char * | name, | |
const char * | serverhost = "localhost" , |
|||
UInt_t | negotiationport = 0 , |
|||
Bool_t | blockingmode = kTRUE , |
|||
Bool_t | standalone = kFALSE , |
|||
Bool_t | autostart = kFALSE , |
|||
Bool_t | autocreate = kTRUE , |
|||
Bool_t | ismaster = kFALSE , |
|||
Bool_t | autoconnect = kTRUE | |||
) |
Definition at line 27 of file TGo4ClientTask.cxx.
TGo4ClientTask::~TGo4ClientTask | ( | ) | [virtual] |
Definition at line 54 of file TGo4ClientTask.cxx.
Int_t TGo4ClientTask::Initialization | ( | ) | [virtual] |
override the ThreadManager Initialization used by AppControlTimer to let this thing initialize the client transport connection
Reimplemented from TGo4Task.
Definition at line 65 of file TGo4ClientTask.cxx.
void TGo4ClientTask::Quit | ( | ) | [virtual] |
Quit the client; method to be called from command object, may be overridden in user implementation.
Reimplemented from TGo4Task.
Definition at line 173 of file TGo4ClientTask.cxx.
TGo4TaskStatus * TGo4ClientTask::CreateStatus | ( | ) | [virtual] |
create a status object with information on the current client state.
this object may be sent to the server or may be used to restore current status by memento mechanism
Reimplemented from TGo4Task.
Reimplemented in TGo4ExampleClient.
Definition at line 183 of file TGo4ClientTask.cxx.
TGo4TaskHandler * TGo4ClientTask::GetTaskHandler | ( | ) | [virtual] |
void TGo4ClientTask::AddLocalCommand | ( | TGo4Command * | com | ) |
Put command into the command queue for local execution in main thread.
Definition at line 199 of file TGo4ClientTask.cxx.
TGo4BufferQueue * TGo4ClientTask::GetCommandQueue | ( | const char * | task = 0 |
) | [virtual] |
TGo4BufferQueue * TGo4ClientTask::GetStatusQueue | ( | const char * | task = 0 |
) | [virtual] |
TGo4BufferQueue * TGo4ClientTask::GetDataQueue | ( | const char * | task = 0 |
) | [virtual] |
Bool_t TGo4ClientTask::ConnectServer | ( | const char * | node, | |
UInt_t | negport, | |||
Go4CommandMode_t | role = kGo4ComModeRefused , |
|||
const char * | passwd = 0 | |||
) |
Connect this client to a waiting server task on node with negotiation channel negport.
Returns connection state, true if connection is established, otherwise false.
Definition at line 94 of file TGo4ClientTask.cxx.
Bool_t TGo4ClientTask::DisconnectServer | ( | Bool_t | isterminating = kFALSE |
) |
Disconnect the current server task, but do not terminate the client.
Return value indicates success state: true if disconnected, false if connection is still existing. If isterminating=true, work threads are not restarted again.
Definition at line 149 of file TGo4ClientTask.cxx.
const char* TGo4ClientTask::GetServerHostName | ( | ) | [inline] |
Definition at line 101 of file TGo4ClientTask.h.
Bool_t TGo4ClientTask::IsConnected | ( | ) | [inline] |
Definition at line 104 of file TGo4ClientTask.h.
void TGo4ClientTask::UpdateStatus | ( | TGo4TaskStatus * | state | ) | [protected, virtual] |
method needed by method CreateStatus of any status subclasses to set the values of the clienttask specific part of the status object.
Reimplemented from TGo4Task.
Definition at line 191 of file TGo4ClientTask.cxx.
TGo4BufferQueue* TGo4ClientTask::fxStatusQ [private] |
Definition at line 118 of file TGo4ClientTask.h.
TGo4BufferQueue* TGo4ClientTask::fxDataQ [private] |
Definition at line 119 of file TGo4ClientTask.h.
TGo4BufferQueue* TGo4ClientTask::fxCommandQ [private] |
Definition at line 120 of file TGo4ClientTask.h.
TGo4TaskHandler* TGo4ClientTask::fxTaskHandler [private] |
TString TGo4ClientTask::fxServerHostname [private] |
Bool_t TGo4ClientTask::fbAutoConnect [private] |
!True if client task shall try to connect automatically at Initialization.
This is the previous behaviour with standalone client. If false, connection will be done on ConnectServer method.
Definition at line 135 of file TGo4ClientTask.h.
Bool_t TGo4ClientTask::fbServerConnected [private] |
true if connection to server is established, otherwise false
Definition at line 140 of file TGo4ClientTask.h.