oneshottimer.h
来自「大名鼎鼎的远程登录软件putty的Symbian版源码」· C头文件 代码 · 共 70 行
H
70 行
/* oneshottimer.h
*
* A one-shot timer class
*
* Copyright 2004 Petteri Kangaslampi
*
* See license.txt for full copyright and license information.
*/
#ifndef __ONESHOTTIMER_H__
#define __ONESHOTTIMER_H__
#include <e32std.h>
#include <e32base.h>
/**
* A one-shot timer class, providing a single callback after a period
* of time. The time countdown can be restarted at any point.
*/
class COneShotTimer : public CActive {
public:
/**
* Factory method.
*
* @param aCallBack Callback function for timer callbacks
* @param aPriority Active object priority
*
* @return New COneShotTimer instance
*/
static COneShotTimer *NewL(TCallBack aCallBack,
TInt aPriority = EPriorityStandard);
/**
* Destructor.
*/
~COneShotTimer();
/**
* Starts the timer. The callback will be called after the given time
* period. If a timer request is already in progress, the old request is
* cancelled.
*
* @param aTime Time interval in microseconds. Note that the final timing
* accuracy depends on the timer accuracy on the platform.
*/
void After(TTimeIntervalMicroSeconds32 aTime);
/**
* Cancels an outstanding timing request.
*/
void CancelTimer();
private:
COneShotTimer(TCallBack aCallBack, TInt aPriority);
void ConstructL();
void RunL();
void DoCancel();
RTimer iTimer;
TBool iTimerOpen;
TCallBack iCallBack;
TBool iTimerRequestActive;
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?