46 TGo4Task(
const char *name, Bool_t blockingmode,
47 Bool_t autostart = kFALSE,
48 Bool_t autocreate = kTRUE,
49 Bool_t ismaster = kFALSE);
86 void Terminate (Bool_t termapp=kTRUE)
override;
146 void SendObject(TObject *obj,
const char *receiver =
nullptr);
167 #if defined(__GNUC__) && !defined(__CLING__)
168 __attribute__((format(printf, 4, 5)))
Class containing a pointer queue for TBuffers.
This is the Go4 Abstract Command Class; part of the Base command pattern.
Class containing a pointer queue for objects.
Baseclass for all slave process entities.
Class containing all command prototypes of the TaskHandler system commands (and the basic test comman...
This class is responsible for the interconnection of two tasks: provided are three communication chan...
Baseclass for all instances that can own a TGo4Task.
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...
TGo4TaskHandlerCommandList * fxCommandPrototype
the command list which holds all command prototypes
TBuffer * GetAbortBuffer()
Use preallocated abort buffer to stop remote socket wait from taskhandler itself.
TBuffer * fxQuitBuffer
this buffer is used for quit command
TString fxCommanderName
remember name of localcommand thread
static Int_t Get_fgiTERMID()
virtual TGo4Command * NextCommand()
Delivers next command from command queue.
TGo4Task(const char *name, Bool_t blockingmode, Bool_t autostart=kFALSE, Bool_t autocreate=kTRUE, Bool_t ismaster=kFALSE)
virtual void GetStatus()
Send current status information of the task to the master; may be re-implemented by application subcl...
Bool_t SubmitEmergencyCommand(Go4EmergencyCommand_t val)
send emergency quit command to the current client task
void SetMaster(Bool_t on=kTRUE)
static const Int_t fgiTERMID
Id number of dummy command that wakes the command queue on termination.
TGo4ObjectQueue * GetLocalCommandQueue()
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.
void AddUserCommandList(TGo4CommandProtoList *comlist)
Add a user command list to the existing command list.
Bool_t SubmitCommand(const char *name)
send command specified by name to the current client task
void SetOwner(TGo4TaskOwner *owner)
Set owner object and switch automatically in master or slave mode, depending on owner type.
virtual void SendStatus(TGo4Status *stat, const char *receiver=nullptr)
Send status object via status channel to the master.
virtual TGo4BufferQueue * GetDataQueue(const char *task=nullptr)
TBuffer * fxStopBuffer
this buffer is used for stop message for threads
const char * GetCommanderName() const
virtual void Stop()
General stop method of client application to be called from remote command; should be re-implemented ...
virtual TGo4TaskHandlerCommandList * CreateCommandList()
factory method for command list; overridden by implementation
virtual void SendStatusBuffer()
Send internal status buffer to the master(s).
virtual void Quit()
Quit the client; method to be called from command object, may be overridden in user implementation.
TGo4Command * MakeCommand(const char *name)
Method using internal command prototype list to produce a clone of the specified command.
friend class TGo4TaskOwner
void SetSlave(TGo4Slave *s)
Bool_t SubmitLocalCommand(TGo4Command *com)
Send given command to the current client task.
void SendStatusMessage(Int_t level, Bool_t printout, const char *text,...)
Send message string in a status object to the gui.
void SetWorkIsStopped(Bool_t on)
virtual TGo4BufferQueue * GetStatusQueue(const char *task=nullptr)
TBuffer * fxStatusBuffer
Buffer containing the analysis status which is updated by the main thread.
TBuffer * fxAbortBuffer
this buffer is used for emergency socket aborting
TGo4Status * NextStatus(Bool_t wait=kTRUE)
Delivers next status object from status queue.
virtual void Start()
General start method of client application to be called from remote command; should be re-implemented...
void AddUserCommand(TGo4Command *com)
Add a user command object to the existing command list.
virtual void UpdateStatus(TGo4TaskStatus *state)
method needed by method CreateStatus of any status subclasses to set the values of the clienttask spe...
friend class TGo4LocalCommandRunnable
virtual void RestartMain()
Restart the main thread; method to be called from command, should be overridden in user implementatio...
TGo4TaskOwner * fxOwner
0..1
void SendObject(TObject *obj, const char *receiver=nullptr)
Send object via data channel to the master.
Bool_t SubmitEmergencyData(Go4EmergencyCommand_t val, const char *receiver=nullptr)
Send emergency command via data channel.
TGo4Slave * GetSlave() const
Bool_t fbWorkIsStopped
True if user work threads are stopped for connection change.
virtual void ExecuteString(const char *command)
Execute string command.
Bool_t fbCommandMaster
This flag indicates the main state of the task: either master (sends commands, receives data and stat...
TGo4TaskHandlerCommandList * GetPrototype()
get pointer to currently valid command list
virtual TGo4TaskHandler * GetTaskHandler()
void TerminateFast() override
Overwrites the Threadmanager TerminateFast to shutdown the objectserver properly.
virtual void KillMain()
Kill the main thread; method to be called from command, should be overridden in user implementation.
void UpdateStatusBuffer()
Create status object and stream it into the status send buffer.
virtual Int_t StartWorkThreads()
start the working threads of the task implementation; this method is used after the current connectio...
TMutex * fxStatusMutex
Mutex protecting status buffer between main and watch thread.
TMutex * GetStatusBufferMutex()
Access to the mutex of status buffer.
TGo4Master * GetMaster() const
Bool_t IsWorkStopped() const
TGo4Master * fxMaster
0..1
TObject * NextObject(Bool_t wait=kTRUE)
Delivers next object from data queue.
virtual TGo4TaskStatus * CreateStatus()
create a status object with information on the current (slave) task.
virtual TGo4BufferQueue * GetCommandQueue(const char *task=nullptr)
void WakeCommandQueue(Int_t id=0)
Put dummy object into command queue to wake up user threads which might wait for a command.
TGo4ObjectQueue * fxLocalCommandQueue
queue for the server side local commands, submitted by the gui or cli
TGo4ThreadManager(const TGo4ThreadManager &right)