Public Types | |
typedef void(* | TimerHandler )(void) |
typedef void(* | TimerHandler )(void) |
Public Member Functions | |
MyPeriodic (int period_msec, TimerHandler handler) | |
Bool_t | Notify () |
~MyPeriodic () | |
MyPeriodic (int period_msec, TimerHandler handler) | |
Bool_t | Notify () |
~MyPeriodic () | |
Public Attributes | |
int | fPeriod_msec |
TimerHandler | fHandler |
double | fLastTime |
Definition at line 61 of file analyzer.cxx.
typedef void(* MyPeriodic::TimerHandler)(void) |
Definition at line 49 of file test_midasServer.cxx.
typedef void(* MyPeriodic::TimerHandler)(void) |
Definition at line 64 of file analyzer.cxx.
MyPeriodic::MyPeriodic | ( | int | period_msec, | |
TimerHandler | handler | |||
) | [inline] |
Definition at line 70 of file analyzer.cxx.
References fHandler, fLastTime, fPeriod_msec, and GetTimeSec().
00071 { 00072 assert(handler != NULL); 00073 fPeriod_msec = period_msec; 00074 fHandler = handler; 00075 fLastTime = GetTimeSec(); 00076 Start(period_msec,kTRUE); 00077 }
MyPeriodic::~MyPeriodic | ( | ) | [inline] |
Definition at line 97 of file analyzer.cxx.
MyPeriodic::MyPeriodic | ( | int | period_msec, | |
TimerHandler | handler | |||
) | [inline] |
Definition at line 55 of file test_midasServer.cxx.
References fHandler, fLastTime, fPeriod_msec, and GetTimeSec().
00056 { 00057 assert(handler != NULL); 00058 fPeriod_msec = period_msec; 00059 fHandler = handler; 00060 fLastTime = GetTimeSec(); 00061 Start(period_msec,kTRUE); 00062 }
MyPeriodic::~MyPeriodic | ( | ) | [inline] |
Definition at line 82 of file test_midasServer.cxx.
Bool_t MyPeriodic::Notify | ( | ) | [inline] |
Definition at line 64 of file test_midasServer.cxx.
References fHandler, fLastTime, fPeriod_msec, and GetTimeSec().
00065 { 00066 double t = GetTimeSec(); 00067 //printf("timer notify, period %f should be %f!\n",t-fLastTime,fPeriod_msec*0.001); 00068 00069 if (t - fLastTime >= 0.9*fPeriod_msec*0.001) 00070 { 00071 //printf("timer: call handler %p\n",fHandler); 00072 if (fHandler) 00073 (*fHandler)(); 00074 00075 fLastTime = t; 00076 } 00077 00078 Reset(); 00079 return kTRUE; 00080 }
Bool_t MyPeriodic::Notify | ( | ) | [inline] |
Definition at line 79 of file analyzer.cxx.
References fHandler, fLastTime, fPeriod_msec, and GetTimeSec().
00080 { 00081 double t = GetTimeSec(); 00082 //printf("timer notify, period %f should be %f!\n",t-fLastTime,fPeriod_msec*0.001); 00083 00084 if (t - fLastTime >= 0.9*fPeriod_msec*0.001) 00085 { 00086 //printf("timer: call handler %p\n",fHandler); 00087 if (fHandler) 00088 (*fHandler)(); 00089 00090 fLastTime = t; 00091 } 00092 00093 Reset(); 00094 return kTRUE; 00095 }
Definition at line 67 of file analyzer.cxx.
Referenced by MyPeriodic(), and Notify().
double MyPeriodic::fLastTime |
Definition at line 68 of file analyzer.cxx.
Referenced by MyPeriodic(), and Notify().
Definition at line 66 of file analyzer.cxx.
Referenced by MyPeriodic(), and Notify().