several bugfixes
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttleTrigger.h
CommitLineData
d477ad88 1#ifndef ALI_SHUTTLE_TRIGGER_H
2#define ALI_SHUTTLE_TRIGGER_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
8
9//
10// This class is to deal with DAQ LogBook and DAQ end run notification.
11// It executes AliShuttle for retrieval of conditions data.
58bc3020 12// For more info see AliShuttleTrigger.cxx
d477ad88 13//
14
15#include <TObject.h>
16#include <TSysEvtHandler.h>
17#include <TMutex.h>
18#include <TCondition.h>
19
20
d477ad88 21class AliShuttle;
22class AliShuttleConfig;
23
24class AliShuttleTrigger;
25class DATENotifier;
26
27class TerminateSignalHandler: public TSignalHandler {
28
d477ad88 29public:
58bc3020 30 TerminateSignalHandler(): TSignalHandler((ESignals) 0,0), fTrigger(0) { }
d477ad88 31 TerminateSignalHandler(AliShuttleTrigger* trigger, ESignals signal):
cb343cfd 32 TSignalHandler(signal, kFALSE), fTrigger(trigger) {}
d477ad88 33
58bc3020 34 virtual ~TerminateSignalHandler() { }
d477ad88 35 virtual Bool_t Notify();
36
58bc3020 37private:
cb343cfd 38 TerminateSignalHandler(const TerminateSignalHandler& other);
39 TerminateSignalHandler& operator= (const TerminateSignalHandler& other);
40
58bc3020 41 AliShuttleTrigger* fTrigger; // pointer to the current AliShuttleTrigger
42
d477ad88 43 ClassDef(TerminateSignalHandler, 0)
44};
45
46class AliShuttleTrigger: public TObject {
2bb7b766 47
d477ad88 48public:
b948db8d 49 AliShuttleTrigger(const AliShuttleConfig* config, UInt_t timeout = 5000, Int_t retries = 5);
d477ad88 50 ~AliShuttleTrigger();
51
52 AliShuttle* GetShuttle() {return fShuttle;}
53
cb343cfd 54 Bool_t Collect(Int_t run = -1);
7bfb2090 55
d477ad88 56 virtual Bool_t Notify();
57 void Terminate();
58
59 void Run();
60
61private:
58bc3020 62 AliShuttleTrigger(const AliShuttleTrigger& other);
63 AliShuttleTrigger& operator= (const AliShuttleTrigger& other);
64
d477ad88 65 const AliShuttleConfig* fConfig;
d477ad88 66
58bc3020 67 AliShuttle* fShuttle; // Pointer to the actual Shuttle instance
d477ad88 68
58bc3020 69 Bool_t fNotified; // Notified flag
70 Bool_t fTerminate; // Terminate flag
d477ad88 71
58bc3020 72 TMutex fMutex; // Mutex
73 TCondition fCondition; // Condition
d477ad88 74
cb343cfd 75 TerminateSignalHandler* fQuitSignalHandler; // Quit signal
76 TerminateSignalHandler* fInterruptSignalHandler; // Interrupt signal
d477ad88 77
78
79 ClassDef(AliShuttleTrigger, 0)
80};
81
82#endif