46 TGo4Task(
const char *name, Bool_t blockingmode,
47 Bool_t autostart = kFALSE,
48 Bool_t autocreate = kTRUE,
49 Bool_t ismaster = kFALSE);
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 void UpdateStatus(TGo4TaskStatus *state)
method needed by method CreateStatus of any status subclasses to set the values of the clienttask spe...
TBuffer * GetAbortBuffer()
Use preallocated abort buffer to stop remote socket wait from taskhandler itself.
TBuffer * fxStopBuffer
this buffer is used for stop message for threads
TString fxCommanderName
remember name of localcommand thread
TGo4Master * fxMaster
0..1
TGo4Task(const char *name, Bool_t blockingmode, Bool_t autostart=kFALSE, Bool_t autocreate=kTRUE, Bool_t ismaster=kFALSE)
TMutex * fxStatusMutex
Mutex protecting status buffer between main and watch thread.
Bool_t SubmitEmergencyCommand(Go4EmergencyCommand_t val)
send emergency quit command to the current client task
void SetMaster(Bool_t on=kTRUE)
static Int_t Get_fgiTERMID()
virtual void GetStatus()
Send current status information of the task to the master; may be re-implemented by application subcl...
virtual TGo4TaskHandlerCommandList * CreateCommandList()
factory method for command list; overridden by implementation
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.
friend class TGo4TaskOwner
void AddUserCommandList(TGo4CommandProtoList *comlist)
Add a user command list to the existing command list.
virtual void Stop()
General stop method of client application to be called from remote command; should be re-implemented ...
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 RestartMain()
Restart the main thread; method to be called from command, should be overridden in user implementatio...
virtual TGo4BufferQueue * GetDataQueue(const char *task=nullptr)
const char * GetCommanderName() const
virtual void KillMain()
Kill the main thread; method to be called from command, should be overridden in user implementation.
TGo4Command * MakeCommand(const char *name)
Method using internal command prototype list to produce a clone of the specified command.
void SetSlave(TGo4Slave *s)
virtual Int_t StartWorkThreads()
start the working threads of the task implementation; this method is used after the current connectio...
friend class TGo4LocalCommandRunnable
TGo4TaskOwner * fxOwner
0..1
Bool_t SubmitLocalCommand(TGo4Command *com)
Send given command to the current client task.
void SetMaster(TGo4Master *m)
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)
TBuffer * fxAbortBuffer
this buffer is used for emergency socket aborting
virtual TGo4BufferQueue * GetStatusQueue(const char *task=nullptr)
TGo4Status * NextStatus(Bool_t wait=kTRUE)
Delivers next status object from status queue.
void AddUserCommand(TGo4Command *com)
Add a user command object to the existing command list.
static const Int_t fgiTERMID
Id number of dummy command that wakes the command queue on termination.
virtual TGo4TaskStatus * CreateStatus()
create a status object with information on the current (slave) task.
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
virtual void Quit()
Quit the client; method to be called from command object, may be overridden in user implementation.
Bool_t fbWorkIsStopped
True if user work threads are stopped for connection change.
TGo4ObjectQueue * fxLocalCommandQueue
queue for the server side local commands, submitted by the gui or cli
TBuffer * fxQuitBuffer
this buffer is used for quit 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()
virtual void SendStatus(TGo4Status *stat, const char *receiver=nullptr)
Send status object via status channel to the master.
void TerminateFast() override
Overwrites the Threadmanager TerminateFast to shutdown the objectserver properly.
virtual void Start()
General start method of client application to be called from remote command; should be re-implemented...
void UpdateStatusBuffer()
Create status object and stream it into the status send buffer.
TBuffer * fxStatusBuffer
Buffer containing the analysis status which is updated by the main thread.
virtual void ExecuteString(const char *command)
Execute string command.
virtual TGo4Command * NextCommand()
Delivers next command from command queue.
TMutex * GetStatusBufferMutex()
Access to the mutex of status buffer.
TGo4Master * GetMaster() const
Bool_t IsWorkStopped() const
TObject * NextObject(Bool_t wait=kTRUE)
Delivers next object from data queue.
virtual void SendStatusBuffer()
Send internal status buffer to the master(s).
Bool_t SubmitCommand(TGo4Command *com)
send given command to the current client task.
TGo4TaskHandlerCommandList * fxCommandPrototype
the command list which holds all command prototypes
virtual TGo4BufferQueue * GetCommandQueue(const char *task=nullptr)
virtual Int_t StopWorkThreads()
stop the working threads of the task implementation; this method is used before 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.