home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-28 | 1.8 KB | 65 lines | [TEXT/CWIE] |
- // ===========================================================================
- // • LDelayedTask.h © 1995, Éric Forget. All rights reserved.
- // ===========================================================================
- //
- // ************************************************************************
- // * *
- // * Before using this code you should read the "License Agreement" *
- // * document and agree with it. *
- // * *
- // ************************************************************************
- //
- // Instruction and usage notes are in the LDelayedTask.cp file.
- //
- // ---------------------------------------------------------------------------
-
-
- #pragma once
-
- #include "LTask.h"
-
-
- // ---------------------------------------------------------------------------
- // • Class LDelayedTask
- // ---------------------------------------------------------------------------
-
- class LDelayedTask : public LTask {
-
- private:
- LDelayedTask() {} // Impossible constructor!
- public:
- LDelayedTask(Int32 inFirstDelay,
- Int32 inNextDelay,
- Boolean inDeleteOnCompletion = false);
- virtual ~LDelayedTask();
-
- virtual void StartTask();
- virtual void StopTask();
- void RestartTask()
- {
- if(!IsExecuting()) {
-
- StartTask();
- }
- mIsFirstTask = true;
- mStartTime = ::TickCount();
- }
-
- virtual Boolean IsItTimeToExecute();
-
- Boolean IsFirstTask()
- {
- return mIsFirstTask;
- }
-
- protected:
- Int32 mStartTime;
- Boolean mIsFirstTask;
-
- virtual void ContinueTask();
-
- virtual void StartTaskSelf();
- virtual void StopTaskSelf();
- };
-
-