⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cactivetimer.cpp

📁 使用CarbideC++编程工具
💻 CPP
字号:
/*
 ============================================================================
 Name		: CActiveTimer.cpp
 Author	  : 
 Version	 : 1.0
 Copyright   : 
 Description : CCActiveTimer implementation
 ============================================================================
 */

#include "CActiveTimer.h"
#include "ActiveTimerNotify.h"

CCActiveTimer::CCActiveTimer(MActiveTimerNotify& aNotifier) :
	CActive(EPriorityStandard), // Standard priority
	iNotifier(aNotifier)
	{
	CActiveScheduler::Add(this);
	}

CCActiveTimer* CCActiveTimer::NewL(MActiveTimerNotify& aNotifier)
	{
	CCActiveTimer* self = new (ELeave) CCActiveTimer(aNotifier);
	CleanupStack::PushL(self); // self
	self->ConstructL();
	CleanupStack::Pop();
	return self;
	}

void CCActiveTimer::ConstructL()
	{
	User::LeaveIfError(iTimer.CreateLocal()); // Initialize timer
	}

CCActiveTimer::~CCActiveTimer()
	{
	Cancel(); // Cancel any request, if outstanding
	iTimer.Close(); // Destroy the RTimer object
	// Delete instance variables if any
	}

void CCActiveTimer::DoCancel()
	{
	iTimer.Cancel();
	}

void CCActiveTimer::RunL()
	{
	iNotifier.TimerComplete(iStatus.Int());
	}

void CCActiveTimer::After(TTimeIntervalMicroSeconds32 anInterval)
	{
	iTimer.After(iStatus,anInterval);
	SetActive();
	}
TInt CCActiveTimer::RunError(TInt aError)
	{
	return aError;
	}

⌨️ 快捷键说明

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