| Line | |
|---|
| 1 | #ifndef MTIMEOUT_H
|
|---|
| 2 | #define MTIMEOUT_H
|
|---|
| 3 |
|
|---|
| 4 | #include <TTimer.h>
|
|---|
| 5 |
|
|---|
| 6 | class MTimeout : public TTimer
|
|---|
| 7 | {
|
|---|
| 8 | Bool_t Notify(TTimer *t)
|
|---|
| 9 | {
|
|---|
| 10 | TurnOff(); // remove from system list
|
|---|
| 11 | return kFALSE;
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | public:
|
|---|
| 15 | MTimeout(Long_t ms=500) : TTimer(ms, kFALSE)
|
|---|
| 16 | {
|
|---|
| 17 | // Use SetTime to change the timing
|
|---|
| 18 | if (ms) TurnOn(); // Add to system list
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | void Start()
|
|---|
| 22 | {
|
|---|
| 23 | Reset(); // reset before adding
|
|---|
| 24 | TurnOn(); // Add to system list
|
|---|
| 25 | }
|
|---|
| 26 | };
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.