TTimer


class description - source file - inheritance tree

class TTimer : public TSysEvtHandler


    public:
TTimer TTimer(TObject* obj, Long_t milliSec, Bool_t mode = kTRUE) TTimer TTimer(Long_t milliSec, Bool_t mode = kTRUE) TTimer TTimer(const char* command, Long_t milliSec, Bool_t mode = kTRUE) TTimer TTimer(TTimer&) virtual void ~TTimer() Bool_t CheckTimer(const TTime& now) TClass* Class() TTime GetAbsTime() const const char* GetCommand() const TObject* GetObject() TTime GetTime() const UInt_t GetTimerID() Bool_t HasTimedOut() const virtual TClass* IsA() const Bool_t IsAsync() const Bool_t IsSync() const virtual Bool_t Notify() virtual void Remove() void Reset() void SetCommand(const char* command) void SetObject(TObject* object) void SetTime(Long_t milliSec) void SetTimerID(UInt_t id = 0) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) virtual void TurnOff() virtual void TurnOn()

Data Members

protected:
TTime fTime time out time in ms TTime fAbsTime absolute time out time in ms Bool_t fTimeout true if timer has timed out Bool_t fSync true if synchrounous timer UInt_t fTimeID the system ID of this timer (for WIN32) TObject* fObject object to be notified (if any) TString fCommand interpreter command to be executed


See also

TProcessEventTimer

Class Description

                                                                      
 TTimer                                                               
                                                                      
 Handles synchronous and a-synchronous timer events. To make use of   
 this class one can use one of the three cases:                       
   - Sub-class TTimer and implement Notify() and Remove() (if timer   
     has not been added to the gSystem timer list).                   
   - Give a pointer of an object to be notified.                      
   - Specify a command string to be executed by the interpreter.      
 Without sub-classing one can also use the HasTimedOut() method.      
 Use Reset() to reset the timer after expiration. To disable a timer  
 remove it using Remove() or destroy it.                              
                                                                      


TTimer(Long_t ms, Bool_t mode) : fTime(ms)
 Create timer that times out in ms milliseconds. If mode == kTRUE then
 the timer is synchronous else a-synchronous. The default is synchronous.
 Add a timer to the system eventloop by calling TurnOn().

TTimer(TObject *obj, Long_t ms, Bool_t mode) : fTime(ms)
 Create timer that times out in ms milliseconds. If mode == kTRUE then
 the timer is synchronous else a-synchronous. The default is synchronous.
 Add a timer to the system eventloop by calling TurnOn().
 The object's HandleTimer() will be called by Notify().

TTimer(const char *command, Long_t ms, Bool_t mode) : fTime(ms)
 Create timer that times out in ms milliseconds. If mode == kTRUE then
 the timer is synchronous else a-synchronous. The default is synchronous.
 Add a timer to the system eventloop by calling TurnOn().
 The interpreter will execute command from Notify().

Bool_t CheckTimer(const TTime &now)
 Check if timer timed out.

Bool_t Notify()
 Notify when timer times out. When a command string is executed
 the timer is implicitely reset. To stop the timer in that case
 call TurnOff(). When an object's HandleTimer() is called the timer
 has to be reset in that method.

void Reset()
 Reset the timer.

void SetCommand(const char *command)
 Set the interpreter command to be executed at time out.

void SetObject(TObject *object)
 Set the object to be notified  at time out.

void TurnOff()
 Remove timer from system timer list. This requires that a timer
 has been placed in the system timer list (using TurnOn()).
 If a TTimer subclass is placed on another list, override TurnOff() to
 remove the timer from the correct list.

void TurnOn()
 Add the timer to the system timer list. If a TTimer subclass has to be
 placed on another list, override TurnOn() to add the timer to the correct
 list.



Inline Functions


        const char* GetCommand() const
           TObject* GetObject()
              TTime GetTime() const
             UInt_t GetTimerID()
              TTime GetAbsTime() const
             Bool_t HasTimedOut() const
             Bool_t IsSync() const
             Bool_t IsAsync() const
               void Remove()
               void SetTime(Long_t milliSec)
               void SetTimerID(UInt_t id = 0)
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
             TTimer TTimer(TTimer&)
               void ~TTimer()


Author: Fons Rademakers 28/11/96
Last update: 2.23/03 22/09/99 18.07.48 by Rene Brun
Copyright (c) 1995-1999, The ROOT System, All rights reserved. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.