diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-8B938FEF-4D70-4589-921C-C99667193E20.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-8B938FEF-4D70-4589-921C-C99667193E20.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,65 @@ + + + + + +<codeph>TaskSchedulerExample</codeph>: +Using Task Scheduler for Creating and Executing Tasks This example application demonstrates the usage of the Task Scheduler +API. +
Download

Click on the following link to download +the examples:

TaskSchedulerExample.zip

Click the following +links to view the example code.

TaskSchedulerExample

+
PurposeThe scheduler example has two applications; +one to schedule the tasks, and the other to run the scheduled tasks. The scheduler +application launches the application that runs the scheduled tasks, when the +tasks are due to be completed.
+
The scheduler application is the client of the scheduler server. +It connects and registers itself with the scheduler server using the RScheduler::Connect() and + RScheduler::Register() methods, respectively. While registering +itself with the scheduler server, the scheduler application provides the name +of the application that runs the scheduled tasks, along with its complete +path and its priority relative to other clients.
+
When a session with the scheduler server is started, the scheduler +creates a persistent time-based schedule using the RScheduler::CreatePersistentSchedule() method. +Then, it adds a task to the persistent schedule using the RScheduler::ScheduleTask()method.
+
The scheduler application also creates a transient time-based schedule +using the RScheduler::ScheduleTask() method. The application +passes the schedule information to the method using the TScheduleEntryInfo2andTTaskInfo + objects. It also edits the transient schedule entry to change its validity +using RScheduler::EditSchedule()
+
The scheduler application launches the executor application, which +runs the scheduled tasks when they are due to be completed. The executor +checks whether it has the necessary capability to run the scheduled tasks +using the CScheduledTask::SecurityInfo() method. The executor +application also checks whether the Secure ID (SID) is the same as that of +the task requester, to be able to run the tasks. If these security checks +pass, the executor prints the details of the scheduled task to the console.
+
Finally, the scheduled tasks are deleted using the RScheduler::DeleteSchedule() + and RScheduler::DeleteTask()methods, respectively.
+
Class summary

The example shows the following APIs:

    +
  • RScheduler

  • +
  • CScheduledTask

  • +
  • TScheduleEntryInfo2

  • +
  • TTaskInfo

  • +
  • TSchedulerItemRef

  • +
  • TSecurityInfo

  • +
+
Building and configuring

To build the example:

    +
  • You can build the example from the Carbide.c++ IDE or the command line.

    If +you use an IDE, import the bld.inf file of the example into your IDE, and +use the build command of the IDE. If you use the command line, open a command +prompt, and set the current directory to examples\SysLibs\TaskSchedulerExample +folder which contains the bld.inf file. You can then build the example with +the following build commands:

    bldmake bldfiles +abld build winsw (For WINSCW platforms) +abld build ARMV5 (For hardware)

    for running the obtained +.exe, go to epoc32\release\winscw\udeb\ (or urel\), launch taskexecutor.exe +:

    taskexecutor.exe

  • +
+
\ No newline at end of file