v2.10-0 (21000JUN2005)

Go4TaskHandler
Class TGo4ClientTask

Direct Known Subclasses:
TGo4ExampleClient

class TGo4ClientTask
derived from TGo4Task

This class controls a client application running in a task which is controlled
by another server task via transport channels which are held by a task handler object.
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


Field Summary
 private Bool_tfbAutoConnect
          !
 private Bool_tfbServerConnected
          true if connection to server is established, otherwise false
 private TGo4BufferQueue*fxCommandQ
           
 private TGo4BufferQueue*fxDataQ
           
 private TStringfxServerHostname
          hostname of server machine
 private TGo4BufferQueue*fxStatusQ
           
 private TGo4TaskHandler*fxTaskHandler
           

Fields inherited from class Go4TaskHandler.TGo4Task
fgiTERMID, fxStatusBuffer, fxStatusMutex

Fields inherited from class Go4ThreadManager.TGo4ThreadManager
fbAppBlocking, fbAutoCreate, fbAutoStart, fbInitDone, fbTerminateApplication, fbTerminating, fglTIMERPERIOD, fguTEXTLENGTH, fxBlocker, fxWorkHandler

Fields inherited from class TNamed
fName, fTitle

Constructor Summary
TGo4ClientTask(const char * name, const char * serverhost, UInt_t negotiationport, Bool_t blockingmode, Bool_t standalone, Bool_t autostart, Bool_t autocreate, Bool_t ismaster, Bool_t autoconnect)
           

Destructor Summary
 virtual synchronized ~TGo4ClientTask()
           

Method Summary
 voidAddLocalCommand(TGo4Command* com)
          Put command into the command queue for local execution in main thread
 Bool_tConnectServer(const char * node, UInt_t negport, Go4CommandMode_t role, const char * passwd)
          Connect this client to a waiting server task on node with
negotiation channel negport.
 virtual TGo4TaskStatus*CreateStatus()
          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
 Bool_tDisconnectServer(Bool_t isterminating)
          Disconnect the current server task, but do not terminate the client.
 TGo4BufferQueue*GetCommandQueue(const char * task)
           
 TGo4BufferQueue*GetDataQueue(const char * task)
           
 const const char *GetServerHostName()
           
 TGo4BufferQueue*GetStatusQueue(const char * task)
           
 TGo4TaskHandler*GetTaskHandler()
           
 virtual Int_tInitialization()
          override the ThreadManager Initialization used by AppControlTimer
to let this thing initialize the client transport connection
 Bool_tIsConnected()
           
 virtual voidQuit()
          Quit the client; method to be called from
command object, may be overridden in user
implementation
 protected virtual voidUpdateStatus(TGo4TaskStatus* state)
          method needed by method
CreateStatus of any status subclasses to
set the values of the clienttask specific
part of the status object.

Methods inherited from class Go4TaskHandler.TGo4Task
AddUserCommand, AddUserCommandList, CreateCommandList, ExecuteString, GetCommanderName, GetLocalCommandQueue, GetMaster, GetPrototype, GetSlave, GetStatus, IsMaster, IsWorkStopped, KillMain, MakeCommand, NextCommand, NextObject, NextStatus, RestartMain, SendObject, SendStatus, SendStatusBuffer, SendStatusMessage, SendStopBuffers, SetMaster, SetOwner, SetWorkIsStopped, Start, StartWorkThreads, Stop, StopWorkThreads, SubmitCommand, SubmitCommand, SubmitEmergencyCommand, SubmitEmergencyData, SubmitLocalCommand, Terminate, TerminateFast, UpdateStatusBuffer, WakeCommandQueue

Methods inherited from class Go4ThreadManager.TGo4ThreadManager
BlockApp, GetWorkHandler, IsAppBlocking, IsInitDone, IsTerminateApp, IsTerminating, Launch, operator=, SetTimer, UnBlockApp

Methods inherited from class TNamed
operator=, Clear, Clone, Compare, Copy, FillBuffer, GetName, GetTitle, Hash, IsSortable, SetName, SetNameTitle, SetTitle, ls, Print, Sizeof, Class, Class_Name, Class_Version, Dictionary, IsA, ShowMembers, Streamer, StreamerNVirtual, DeclFileName, ImplFileLine, ImplFileName, DeclFileLine

Field Detail

fbAutoConnect

private Bool_t fbAutoConnect
!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.

fbServerConnected

private Bool_t fbServerConnected
true if connection to server is established, otherwise false

fxCommandQ

private TGo4BufferQueue* fxCommandQ

fxDataQ

private TGo4BufferQueue* fxDataQ

fxServerHostname

private TString fxServerHostname
hostname of server machine

fxStatusQ

private TGo4BufferQueue* fxStatusQ

fxTaskHandler

private TGo4TaskHandler* fxTaskHandler
supplierCardinality 1
link aggregationByValue
directed
clientCardinality 1
Constructor Detail

TGo4ClientTask

public TGo4ClientTask(const char * name, const char * serverhost, UInt_t negotiationport, Bool_t blockingmode, Bool_t standalone, Bool_t autostart, Bool_t autocreate, Bool_t ismaster, Bool_t autoconnect)
Method Detail

~TGo4ClientTask

public virtual synchronized ~TGo4ClientTask()
Method Detail

AddLocalCommand

public void AddLocalCommand(TGo4Command* com)
Put command into the command queue for local execution in main thread

ConnectServer

public Bool_t ConnectServer(const char * node, UInt_t negport, Go4CommandMode_t role, const char * passwd)
Connect this client to a waiting server task on node with
negotiation channel negport. Returns connection state,
true if connection is established, otherwise false.

CreateStatus

public virtual TGo4TaskStatus* CreateStatus()
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

DisconnectServer

public Bool_t DisconnectServer(Bool_t isterminating)
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.

GetCommandQueue

public TGo4BufferQueue* GetCommandQueue(const char * task)

GetDataQueue

public TGo4BufferQueue* GetDataQueue(const char * task)

GetServerHostName

public const const char * GetServerHostName()

GetStatusQueue

public TGo4BufferQueue* GetStatusQueue(const char * task)

GetTaskHandler

public TGo4TaskHandler* GetTaskHandler()

Initialization

public virtual Int_t Initialization()
override the ThreadManager Initialization used by AppControlTimer
to let this thing initialize the client transport connection

IsConnected

public Bool_t IsConnected()

Quit

public virtual void Quit()
Quit the client; method to be called from
command object, may be overridden in user
implementation

UpdateStatus

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

Association Links

to Class TGo4BufferQueue

to Class TGo4BufferQueue

to Class TGo4BufferQueue

to Class TGo4TaskHandler

Client Cardinality 1
Supplier Cardinality 1
Is directed
Type aggregationByValue

J.Adamczewski, M.Al-Turany, D.Bertini, H.G.Essel, S.Linev

30-06-2005