cactivetimer.h

来自「使用CarbideC++编程工具」· C头文件 代码 · 共 59 行

H
59
字号
/*
 ============================================================================
 Name		: CActiveTimer.h
 Author	  : 
 Version	 : 1.0
 Copyright   : 
 Description : CCActiveTimer declaration
 ============================================================================
 */

#ifndef CACTIVETIMER_H
#define CACTIVETIMER_H

#include <e32base.h>	// For CActive, link against: euser.lib
#include <e32std.h>		// For RTimer, link against: euser.lib

class MActiveTimerNotify;

class CCActiveTimer : public CActive
	{
public:
	// Cancel and destroy
	~CCActiveTimer();

	// Two-phased constructor.
	static CCActiveTimer* NewL(MActiveTimerNotify& aNotifier);

public:
	// New functions
	// Function for making the initial request
//	void StartL(TTimeIntervalMicroSeconds32 aDelay);
	void After(TTimeIntervalMicroSeconds32 anInterval);

private:
	// C++ constructor
	CCActiveTimer(MActiveTimerNotify& aNotifier);

	// Second-phase constructor
	void ConstructL();

private:
	// From CActive
	// Handle completion
	void RunL();

	// How to cancel me
	void DoCancel();

	// Override to handle leaves from RunL(). Default implementation causes
	// the active scheduler to panic.
	TInt RunError(TInt aError);

protected:
	MActiveTimerNotify& iNotifier;
	RTimer iTimer;
	};

#endif // CACTIVETIMER_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?