活动对象
This presentation is the property of its rightful owner.
Sponsored Links
1 / 7

活动对象 PowerPoint PPT Presentation


  • 141 Views
  • Uploaded on
  • Presentation posted in: General

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

Download Presentation

活动对象

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


5781710

活动对象


5781710

主要内容

  • 活动对象机制

  • 活动对象的使用

  • 用活动对象处理复杂事务


5781710

活动对象机制

  • 活动对象框架

    • 活动对象调度器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();

      ... ...

      };


5781710

活动对象机制

  • 活动对象框架

    • 活动对象类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;

      • };


5781710

活动对象机制

  • 活动对象的生命周期及操作顺序


5781710

活动对象的使用

  • 实现活动对象的必要步骤

    • (1)从CActive类派生活动对象类

    • (2)实现活动对象类的构造函数

    • (3)实现活动对象的二阶段构造函数ConstructL()

    • (4)实现CActive类的三个虚函数RunL()、DoCancel()、RunError()

    • (5)实现活动对象的析构函数


5781710

用活动对象处理复杂事务

  • 活动对象的RunL()方法不能长时间占用CPU

  • 把复杂大任务分割成许多小任务进行处理


  • Login