GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4TaskHandlerRunnable Class Referenceabstract

This is the abstract interface for all runnables associated with the taskhandler class. More...

#include <TGo4TaskHandlerRunnable.h>

+ Inheritance diagram for TGo4TaskHandlerRunnable:

Public Member Functions

 TGo4TaskHandlerRunnable (const char *name, TGo4ThreadManager *man, TGo4TaskHandler *hand, Bool_t receivermode=kTRUE)
 
virtual ~TGo4TaskHandlerRunnable ()
 
TGo4TaskHandlerGetTaskHandler ()
 
Int_t Run (void *ptr) override=0
 The working function which runs in the thread.
 
- Public Member Functions inherited from TGo4Runnable
 TGo4Runnable (const char *name, TGo4ThreadManager *man)
 
 TGo4Runnable (const TGo4Runnable &right)
 
virtual ~TGo4Runnable ()
 
TGo4ThreadGetThread () const
 
TGo4ThreadManagerGetThreadManager () const
 
void SetThread (TGo4Thread *gthread)
 

Protected Member Functions

Bool_t CheckStopBuffer (TBuffer *buf, Int_t *result=nullptr)
 Test if buffer contains a message to stop this runnable.
 
Bool_t CheckTransportOpen ()
 Test if socket transport exists and is open.
 
- Protected Member Functions inherited from TGo4Runnable
 TGo4Runnable ()
 
virtual Int_t PostRun (void *ptr)
 Function which is called once after the Run()method on threadstop.
 
virtual Int_t PreRun (void *ptr)
 Function which is called once before the Run() method on threadstart.
 
virtual void ThreadCatch (TGo4Exception &ex)
 catch for exceptions occurring in workfunc
 
virtual void UnexpectedCatch ()
 catch for all unexpected exceptions happening in workfunc
 

Protected Attributes

Bool_t fbReceiverMode {kFALSE}
 flag indicating operation mode of runnable, depending on client or server mode of task handler
 
TGo4BufferQueuefxBufferQueue {nullptr}
 Link to external buffer queue.
 
TGo4TaskHandlerfxTaskHandler {nullptr}
 link to external task handler (for server mode) 1 1
 
TGo4SocketfxTransport {nullptr}
 link to external inter-tasl transport channel
 
- Protected Attributes inherited from TGo4Runnable
TGo4ThreadfxGo4Thread {nullptr}
 Backlink to thread which runs this.
 
TGo4ThreadManagerfxManager {nullptr}
 The threadmanager which is responsible for our thread.
 

Private Member Functions

 TGo4TaskHandlerRunnable ()
 

Detailed Description

This is the abstract interface for all runnables associated with the taskhandler class.

Definition at line 31 of file TGo4TaskHandlerRunnable.h.

Constructor & Destructor Documentation

◆ TGo4TaskHandlerRunnable() [1/2]

TGo4TaskHandlerRunnable::TGo4TaskHandlerRunnable ( const char * name,
TGo4ThreadManager * man,
TGo4TaskHandler * hand,
Bool_t receivermode = kTRUE )

◆ ~TGo4TaskHandlerRunnable()

TGo4TaskHandlerRunnable::~TGo4TaskHandlerRunnable ( )
virtual

Definition at line 32 of file TGo4TaskHandlerRunnable.cxx.

◆ TGo4TaskHandlerRunnable() [2/2]

TGo4TaskHandlerRunnable::TGo4TaskHandlerRunnable ( )
private

Member Function Documentation

◆ CheckStopBuffer()

Bool_t TGo4TaskHandlerRunnable::CheckStopBuffer ( TBuffer * buf,
Int_t * result = nullptr )
protected

Test if buffer contains a message to stop this runnable.

This mechanism is used to properly put taskhandler threads into parking position when connection is discarded. Value of buffer is set to external variable result optionally.

Definition at line 41 of file TGo4TaskHandlerRunnable.cxx.

References TGo4Log::Debug(), TGo4BufferQueue::DecodeValueBuffer(), TGo4Runnable::GetThread(), kComAbortTask, kComCloseInput, and TGo4Thread::Stop().

Referenced by TGo4CommandRunnable::Run(), TGo4DataRunnable::Run(), and TGo4StatusRunnable::Run().

◆ CheckTransportOpen()

Bool_t TGo4TaskHandlerRunnable::CheckTransportOpen ( )
protected

Test if socket transport exists and is open.

If not open, sleep a while to avoid deadlooping of Run()

Definition at line 63 of file TGo4TaskHandlerRunnable.cxx.

References fxTransport, TGo4TaskHandler::Get_fguPORTWAITTIME(), and TGo4Thread::Sleep().

Referenced by TGo4CommandRunnable::Run(), TGo4DataRunnable::Run(), and TGo4StatusRunnable::Run().

◆ GetTaskHandler()

TGo4TaskHandler * TGo4TaskHandlerRunnable::GetTaskHandler ( )

Definition at line 36 of file TGo4TaskHandlerRunnable.cxx.

References fxTaskHandler.

◆ Run()

Int_t TGo4TaskHandlerRunnable::Run ( void * ptr)
overridepure virtual

The working function which runs in the thread.

Implements TGo4Runnable.

Implemented in TGo4CommandRunnable, TGo4DataRunnable, and TGo4StatusRunnable.

Field Documentation

◆ fbReceiverMode

Bool_t TGo4TaskHandlerRunnable::fbReceiverMode {kFALSE}
protected

flag indicating operation mode of runnable, depending on client or server mode of task handler

Definition at line 66 of file TGo4TaskHandlerRunnable.h.

Referenced by TGo4TaskHandlerRunnable(), TGo4CommandRunnable::Run(), TGo4DataRunnable::Run(), and TGo4StatusRunnable::Run().

◆ fxBufferQueue

TGo4BufferQueue* TGo4TaskHandlerRunnable::fxBufferQueue {nullptr}
protected

◆ fxTaskHandler

TGo4TaskHandler* TGo4TaskHandlerRunnable::fxTaskHandler {nullptr}
protected

◆ fxTransport


The documentation for this class was generated from the following files: