WEB开发网
开发学院手机开发Android 开发 关于 RMsgQueue 类的使用 阅读

关于 RMsgQueue 类的使用

 2010-04-18 06:50:00 来源:WEB开发网   
核心提示:void ConstructL();private:// From CActive// Handle completionvoid RunL();// How to cancel mevoid DoCancel();// Override to handle leaves from RunL(). Default im

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);

};

#endif /* MESSAGEQUEUEAO_H_ */

实现文件内容

/*

* MessageQueueAO.cpp

*

* Created on: 2010-3-30

* Author: frank

*/

#include "MessageQueueAO.h"

RMsgQueue g_NetWorkMsgQue;

CMessageQueueAO::CMessageQueueAO()

:CActive(EPriorityHigh)

{

// TODO Auto-generated constructor stub

}

CMessageQueueAO::~CMessageQueueAO()

{

// TODO Auto-generated destructor stub

Cancel();

}

CMessageQueueAO* CMessageQueueAO::NewL()

{

CMessageQueueAO* self = CMessageQueueAO::NewLC();

CleanupStack::Pop(); // self;

return self;

}

CMessageQueueAO* CMessageQueueAO::NewLC()

{

CMessageQueueAO* self = new (ELeave) CMessageQueueAO();

CleanupStack::PushL(self);

self->ConstructL();

return self;

}

void CMessageQueueAO::ConstructL()

{

CActiveScheduler::Add(this); // Add to scheduler

g_NetWorkMsgQue.CreateLocal(KNumberOfMsgs);

}

TInt CMessageQueueAO::StartMessageGet(const TDesC& aText)

{

g_NetWorkMsgQue.NotifyDataAvailable(iStatus);

SetActive(); // Tell scheduler a request is active

}

void SocketCreate(TInt32 aFd)

{

}

void SocketRecv(TInt32 aFd)

{

上一页  1 2 3 4 5 6  下一页

Tags:关于 RMsgQueue 使用

编辑录入:coldstar [复制链接] [打 印]
赞助商链接