18#include "TGo4BufferQueue.h"
20#include "TGo4ThreadHandler.h"
24 const char *serverhost,
25 UInt_t negotiationport,
32 TGo4Task(name,blockingmode,autostart,autocreate,ismaster),
38 TString nomen(
"TaskHandler of ");
84 TGo4Log::Warn(
" ClientTask::ConnectServer ''%s'': ServerTask already connected", GetName());
94 TGo4Log::Info(
"TGo4ClientTask::ConnectServer with role %d and passwd %s", role, passwd);
110 SendStatusMessage(1, kTRUE,
"Client %s connected successfully to Server task at node %s", GetName(),
114 TGo4Log::Error(
" ClientTask ''%s'': FAILED connection to ServerTask at node %s", GetName(), node);
176 TGo4Log::Debug(
" !!! ClientTask - ERROR adding local command - no command queue !!! ");
Go4CommandMode_t
These values define command execution rights.
@ kGo4ComModeAdministrator
Class containing a pointer queue for TBuffers.
void SetNames(const char *serverhost)
virtual ~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)
TGo4TaskHandler * fxTaskHandler
aggregationByValue
void UpdateStatus(TGo4TaskStatus *state) override
method needed by method CreateStatus of any status subclasses to set the values of the clienttask spe...
TGo4BufferQueue * fxDataQ
TGo4BufferQueue * GetStatusQueue(const char *task=nullptr) override
Int_t Initialization() override
override the ThreadManager Initialization used by AppControlTimer to let this thing initialize the cl...
TGo4BufferQueue * GetDataQueue(const char *task=nullptr) override
const char * GetServerHostName() const
Bool_t fbAutoConnect
!True if client task shall try to connect automatically at Initialization.
Bool_t ConnectServer(const char *node, UInt_t negport, Go4CommandMode_t role=kGo4ComModeRefused, const char *passwd=nullptr)
Connect this client to a waiting server task on node with negotiation channel negport.
void AddLocalCommand(TGo4Command *com)
Put command into the command queue for local execution in main thread.
Bool_t fbServerConnected
true if connection to server is established, otherwise false
TGo4TaskStatus * CreateStatus() override
create a status object with information on the current client state.
TGo4BufferQueue * fxCommandQ
Bool_t DisconnectServer(Bool_t isterminating=kFALSE)
Disconnect the current server task, but do not terminate the client.
TGo4BufferQueue * fxStatusQ
TGo4BufferQueue * GetCommandQueue(const char *task=nullptr) override
TGo4TaskHandler * GetTaskHandler() override
void Quit() override
Quit the client; method to be called from command object, may be overridden in user implementation.
TString fxServerHostname
hostname of server machine
This is the Go4 Abstract Command Class; part of the Base command pattern.
static void Warn(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 2.
static void Info(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 1.
static void Debug(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 0.
static void Error(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 3.
Base class for all threadsafe pointer queues.
void Clear(Option_t *opt="") override
This class is responsible for the interconnection of two tasks: provided are three communication chan...
static void SetCtrlAccount(const char *name, const char *passwd)
Specify login name and password for controller account.
static void SetAdminAccount(const char *name, const char *passwd)
Specify login name and password for administrator account.
TGo4Queue * GetStatusQueue() const
TGo4Queue * GetDataQueue() const
static void SetObservAccount(const char *name, const char *passwd)
Specify login name and password for observer account.
TGo4Queue * GetCommandQueue() const
Int_t Initialization() override
Overrides the ThreadManager Initialization; is used to setup the client connections on demand; checks...
virtual Int_t StopWorkThreads()
stop the working threads of the task implementation; this method is used before the current connectio...
static Int_t Get_fgiTERMID()
TGo4Task(const char *name, Bool_t blockingmode, Bool_t autostart=kFALSE, Bool_t autocreate=kTRUE, Bool_t ismaster=kFALSE)
void SendStopBuffers(const char *taskname=nullptr)
Send message buffers with stop values into queues and via socket connections.
void Terminate(Bool_t termapp=kTRUE) override
deletes the Manager instance via Control timer.
virtual void Quit()
Quit the client; method to be called from command object, may be overridden in user implementation.
void SendStatusMessage(Int_t level, Bool_t printout, const char *text,...)
Send message string in a status object to the gui.
virtual void UpdateStatus(TGo4TaskStatus *state)
method needed by method CreateStatus of any status subclasses to set the values of the clienttask spe...
virtual Int_t StartWorkThreads()
start the working threads of the task implementation; this method is used after the current connectio...
void WakeCommandQueue(Int_t id=0)
Put dummy object into command queue to wake up user threads which might wait for a command.
Bool_t fbInitDone
is set kTRUE after first Initialize is done
TGo4ThreadHandler * fxWorkHandler
Thread handler aggregate (threadsafe list of go4 threads) aggregationByValue 1 1.
void Launch()
This Method has to be called to create the startup threads and to turn on the application control tim...