GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
TGo4Runnable Class Referenceabstract

#include <TGo4Runnable.h>

+ Inheritance diagram for TGo4Runnable:

Public Member Functions

 TGo4Runnable (const TGo4Runnable &right)
 
 TGo4Runnable (const char *name, TGo4ThreadManager *man)
 
virtual ~TGo4Runnable ()
 
void SetThread (TGo4Thread *gthread)
 
TGo4ThreadGetThread () const
 
TGo4ThreadManagerGetThreadManager () const
 

Protected Member Functions

 TGo4Runnable ()
 
virtual Int_t Run (void *ptr)=0
 
virtual Int_t PreRun (void *ptr)
 
virtual Int_t PostRun (void *ptr)
 
virtual void ThreadCatch (TGo4Exception &ex)
 
virtual void UnexpectedCatch ()
 

Protected Attributes

TGo4ThreadManagerfxManager {nullptr}
 
TGo4ThreadfxGo4Thread {nullptr}
 

Friends

class TGo4Thread
 

Detailed Description

Base class for all go4 runnables. Virtual method Run() is working in the thread, this must be overridden by the user runnables.

Author
J. Adamczewski
Go4 project-DVEE-GSI Darmstadt
Germany
Version
0.9
Since
jul 2000-oct 2001

Definition at line 32 of file TGo4Runnable.h.

Constructor & Destructor Documentation

◆ TGo4Runnable() [1/3]

TGo4Runnable::TGo4Runnable ( const TGo4Runnable right)

Definition at line 24 of file TGo4Runnable.cxx.

References GO4TRACE.

◆ TGo4Runnable() [2/3]

TGo4Runnable::TGo4Runnable ( const char *  name,
TGo4ThreadManager man 
)

Definition at line 32 of file TGo4Runnable.cxx.

References fxManager, and GO4TRACE.

◆ ~TGo4Runnable()

TGo4Runnable::~TGo4Runnable ( )
virtual

Definition at line 39 of file TGo4Runnable.cxx.

References GO4TRACE.

◆ TGo4Runnable() [3/3]

TGo4Runnable::TGo4Runnable ( )
inlineprotected

Definition at line 50 of file TGo4Runnable.h.

References PostRun(), PreRun(), Run(), ThreadCatch(), and UnexpectedCatch().

Member Function Documentation

◆ GetThread()

TGo4Thread* TGo4Runnable::GetThread ( ) const
inline

◆ GetThreadManager()

TGo4ThreadManager* TGo4Runnable::GetThreadManager ( ) const
inline

◆ PostRun()

Int_t TGo4Runnable::PostRun ( void *  ptr)
protectedvirtual

Function which is called once after the Run()method on threadstop

Reimplemented in TGo4AnalysisMainRunnable.

Definition at line 72 of file TGo4Runnable.cxx.

References TGo4Log::Debug(), and GO4TRACE.

Referenced by TGo4Runnable(), and TGo4Thread::Threadfunc().

◆ PreRun()

Int_t TGo4Runnable::PreRun ( void *  ptr)
protectedvirtual

Function which is called once before the Run() method on threadstart

Reimplemented in TGo4AnalysisMainRunnable.

Definition at line 64 of file TGo4Runnable.cxx.

References TGo4Log::Debug(), and GO4TRACE.

Referenced by TGo4Runnable(), and TGo4Thread::Threadfunc().

◆ Run()

virtual Int_t TGo4Runnable::Run ( void *  ptr)
protectedpure virtual

◆ SetThread()

void TGo4Runnable::SetThread ( TGo4Thread gthread)
inline

Definition at line 42 of file TGo4Runnable.h.

References fxGo4Thread.

Referenced by TGo4Thread::TGo4Thread().

◆ ThreadCatch()

void TGo4Runnable::ThreadCatch ( TGo4Exception ex)
protectedvirtual

catch for exceptions occurring in workfunc

Reimplemented in TGo4TestRunnable.

Definition at line 44 of file TGo4Runnable.cxx.

References TGo4Log::Debug(), fxGo4Thread, TGo4Thread::GetPID(), GO4TRACE, TGo4Exception::Handle(), and TGo4Exception::What().

Referenced by TGo4Runnable(), TGo4TestRunnable::ThreadCatch(), and TGo4Thread::Threadfunc().

◆ UnexpectedCatch()

void TGo4Runnable::UnexpectedCatch ( )
protectedvirtual

catch for all unexpected exceptions happening in workfunc

Reimplemented in TGo4TestRunnable.

Definition at line 53 of file TGo4Runnable.cxx.

References TGo4Log::Debug(), fxGo4Thread, fxManager, TGo4Thread::GetPID(), GO4TRACE, and TGo4ThreadManager::Terminate().

Referenced by TGo4Runnable(), and TGo4TestRunnable::UnexpectedCatch().

Friends And Related Function Documentation

◆ TGo4Thread

friend class TGo4Thread
friend

Definition at line 33 of file TGo4Runnable.h.

Referenced by TGo4TestRunnable::Run().

Member Data Documentation

◆ fxGo4Thread

TGo4Thread* TGo4Runnable::fxGo4Thread {nullptr}
protected

Backlink to thread which runs this. 1 1

Definition at line 75 of file TGo4Runnable.h.

Referenced by GetThread(), TGo4ObjConnectorRunnable::Run(), TGo4ConnectorRunnable::Run(), TGo4TestRunnable::Run(), SetThread(), ThreadCatch(), and UnexpectedCatch().

◆ fxManager

TGo4ThreadManager* TGo4Runnable::fxManager {nullptr}
protected

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