StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StCloseFileOnTerminate.h
1 #ifndef STAR_STCLOSEFILEONTERMINATE
2 #define STAR_STCLOSEFILEONTERMINATE
3 // $Id: StCloseFileOnTerminate.h,v 1.7 2011/06/20 22:36:48 fisyak Exp $
4 
5 #include "TSysEvtHandler.h"
6 
18  private:
19  StNotifyOnTerminate *fTerminateHandler;
20  public:
22  virtual ~StTerminateNotified();
23  virtual void SetNotifiedCallBack() = 0;
24 };
25 
33 class StCloseFileOnTerminate : public TSignalHandler {
34  private:
35  static StCloseFileOnTerminate *fgCloseFileOnTerminate;
36  protected:
37  // ! singleton ctor
40  public:
42  protected:
43  static bool Exists() {return fgCloseFileOnTerminate;}
45  virtual Bool_t Notify();
46  ClassDef(StCloseFileOnTerminate,0)
47 };
48 
50  friend class StTerminateNotified;
51  private:
52  StTerminateNotified &fNotificator;
53  protected:
54  StNotifyOnTerminate(StTerminateNotified &notificator):StCloseFileOnTerminate(),fNotificator(notificator)
55  {}
56  public:
58  virtual Bool_t Notify();
59  StTerminateNotified &Notificator() const { return fNotificator; }
60  ClassDef(StNotifyOnTerminate,0)
61 };
62 
63 #endif
64 
Class StCloseFileOnTerminate - it is a singleton to catch the SIGTERM signal (sent by Condor for exam...
Class StTerminateNotified is a abstract visitor to propagate the termination signal It is to provide ...
virtual Bool_t Notify()
Close the open ROOT files upon SIGTERM sent by system to terminate the job.
virtual Bool_t Notify()
Close the open ROOT files upon SIGTERM sent by system to terminate the job.
static StCloseFileOnTerminate & Instantiate()
Create an instance of the signal handler (Should be called at once by code)