MyPeriodic Class Reference

Inheritance diagram for MyPeriodic:
Inheritance graph
[legend]
Collaboration diagram for MyPeriodic:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Definition at line 61 of file analyzer.cxx.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

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   }

Here is the call graph for this function:

MyPeriodic::~MyPeriodic (  )  [inline]

Definition at line 97 of file analyzer.cxx.

00098   {
00099     TurnOff();
00100   }

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   }

Here is the call graph for this function:

MyPeriodic::~MyPeriodic (  )  [inline]

Definition at line 82 of file test_midasServer.cxx.

00083   {
00084     TurnOff();
00085   }


Member Function Documentation

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   }

Here is the call graph for this function:

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   }

Here is the call graph for this function:


Member Data Documentation

Definition at line 67 of file analyzer.cxx.

Referenced by MyPeriodic(), and Notify().

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().


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

Generated on 12 Feb 2016 for ROOT Analyzer by  doxygen 1.6.1