clocktimer.h
来自「国内著名嵌入式培训机构内部资料,内含一些实例代码,包括技术专题书籍」· C头文件 代码 · 共 68 行
H
68 行
/*
============================================================================
Name : ClockTimer.h
Author : hou maoqing
Version : 1.0
Copyright : Copyright (c) Hou maoqing 2008
Description : CClockTimer declaration
============================================================================
*/
#ifndef CLOCKTIMER_H
#define CLOCKTIMER_H
#include <e32base.h> // For CActive, link against: euser.lib
#include <e32std.h> // For RTimer, link against: euser.lib
class CClockTimer : public CActive
{
public:
// Cancel and destroy
~CClockTimer();
// Two-phased constructor.
static CClockTimer* NewL();
// Two-phased constructor.
static CClockTimer* NewLC();
public:
// New functions
// Function for making the initial request
void StartL(TTimeIntervalMicroSeconds32 aDelay);
private:
// C++ constructor
CClockTimer();
// 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);
private:
enum TClockTimerState
{
EUninitialized, // Uninitialized
EInitialized, // Initalized
EError // Error condition
};
private:
TInt iState; // State of the active object
RTimer iTimer; // Provides async timing service
TInt m_nExitCount;
};
#endif // CLOCKTIMER_H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?