Warning, file /include/root/TTimer.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TTimer
0013 #define ROOT_TTimer
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045 #include "TSysEvtHandler.h"
0046 #include "TTime.h"
0047 #include "TString.h"
0048
0049
0050
0051 class TTimer : public TSysEvtHandler {
0052
0053 protected:
0054 TTime fTime;
0055 TTime fAbsTime;
0056 Bool_t fTimeout;
0057 Bool_t fSync;
0058 Bool_t fIntSyscalls;
0059 UInt_t fTimeID;
0060 TObject *fObject;
0061 TString fCommand;
0062
0063 private:
0064 TTimer(const TTimer&) = delete;
0065 TTimer& operator=(const TTimer&) = delete;
0066
0067 public:
0068 TTimer(Long_t milliSec = 0, Bool_t mode = kTRUE);
0069 TTimer(TObject *obj, Long_t milliSec, Bool_t mode = kTRUE);
0070 TTimer(const char *command, Long_t milliSec, Bool_t mode = kTRUE);
0071 virtual ~TTimer() { Remove(); }
0072
0073 Bool_t CheckTimer(const TTime &now);
0074 const char *GetCommand() const { return fCommand.Data(); }
0075 TObject *GetObject() { return fObject; }
0076 TTime GetTime() const { return fTime; }
0077 UInt_t GetTimerID() { return fTimeID;}
0078 TTime GetAbsTime() const { return fAbsTime; }
0079 Bool_t HasTimedOut() const { return fTimeout; }
0080 Bool_t IsSync() const { return fSync; }
0081 Bool_t IsAsync() const { return !fSync; }
0082 Bool_t IsInterruptingSyscalls() const { return fIntSyscalls; }
0083 Bool_t IsRunning();
0084 Bool_t Notify() override;
0085 void Add() override { TurnOn(); }
0086 void Remove() override { TurnOff(); }
0087 void Reset();
0088 void SetCommand(const char *command);
0089 void SetObject(TObject *object);
0090 void SetInterruptSyscalls(Bool_t set = kTRUE);
0091 void SetTime(Long_t milliSec) { fTime = milliSec; }
0092 void SetTimerID(UInt_t id = 0) { fTimeID = id; }
0093 virtual void Start(Long_t milliSec = -1, Bool_t singleShot = kFALSE);
0094 virtual void Stop() { TurnOff(); }
0095 virtual void TurnOn();
0096 virtual void TurnOff();
0097 virtual void Timeout() { Emit("Timeout()"); }
0098
0099 static void SingleShot(Int_t milliSec, const char *receiver_class,
0100 void *receiver, const char *method);
0101
0102 ClassDefOverride(TTimer,0)
0103 };
0104
0105 #endif