slide1
Download
Skip this Video
Download Presentation
活动对象

Loading in 2 Seconds...

play fullscreen
1 / 7

活动对象 - PowerPoint PPT Presentation


  • 188 Views
  • Uploaded on

活动对象. 主要内容. 活动对象机制 活动对象的使用 用活动对象处理复杂事务. 活动对象机制. 活动对象框架 活动对象调度器 CActiveScheduler class CActiveScheduler : public CBase { friend class CActiveSchedulerWait; public: struct TLoop; typedef TLoop* TLoopOwner; public: IMPORT\_C CActiveScheduler(); IMPORT\_C ~CActiveScheduler();

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about '活动对象' - swain


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide2
主要内容
  • 活动对象机制
  • 活动对象的使用
  • 用活动对象处理复杂事务
slide3
活动对象机制
  • 活动对象框架
    • 活动对象调度器CActiveScheduler

class CActiveScheduler : public CBase

{

friend class CActiveSchedulerWait;

public:

struct TLoop;

typedef TLoop* TLoopOwner;

public:

IMPORT_C CActiveScheduler();

IMPORT_C ~CActiveScheduler();

IMPORT_C static void Install(CActiveScheduler* aScheduler);

IMPORT_C static void Add(CActive* aActive);

IMPORT_C static void Start();

IMPORT_C static void Stop();

... ...

};

slide4
活动对象机制
  • 活动对象框架
    • 活动对象类CActive
      • class CActive : public CBase
      • {
      • public:
      • IMPORT_C ~CActive();
      • IMPORT_C void Cancel();
      • ... ...
      • protected:
      • IMPORT_C CActive(TInt aPriority);
      • IMPORT_C void SetActive();
      • virtual void DoCancel() =0;
      • virtual void RunL() =0;
      • IMPORT_C virtual TInt RunError(TInt aError);
      • public:
      • TRequestStatus iStatus;
      • };
slide5
活动对象机制
  • 活动对象的生命周期及操作顺序
slide6
活动对象的使用
  • 实现活动对象的必要步骤
    • (1)从CActive类派生活动对象类
    • (2)实现活动对象类的构造函数
    • (3)实现活动对象的二阶段构造函数ConstructL()
    • (4)实现CActive类的三个虚函数RunL()、DoCancel()、RunError()
    • (5)实现活动对象的析构函数
slide7
用活动对象处理复杂事务
  • 活动对象的RunL()方法不能长时间占用CPU
  • 把复杂大任务分割成许多小任务进行处理
ad