Name: | Task |
Version: | 1.0 |
ID: | ID_TASK |
Status: | Stable |
Category: | System |
Include: | system/task.h |
Date: | October 2002 |
Author: | Rocklyte Systems |
Copyright: | Rocklyte Systems, 1996-2002. All rights reserved. |
Tasks are one of the most basic features used for program execution in most operating systems. In the Pandora Engine, Task objects are created to represent each individual process within the system. You can inspect any Task object to reveal information the program's Author, Copyright, Location and other details. You can spawn new Tasks by using the standard object creation and initialisation procedures.
If you want to execute a compiled program, set the Location field to point to the executable file before initialising the Task. You may pass arguments to the executable by setting the ArgsList field. Once the Task object is successfully initiialised, use the Activate action to run the executable. If the file is run successfully, a new Task object will be spawned that represents the executable (which means it is safe to destroy your Task object immediately afterwards). If the Activate action returns with ERR_Okay then the executable program was run successfully.
If you want to find the Task that belongs to your current execution process, use the CurrentTask() function to retrieve it.
If you want to send messages to a Task, you need to gain access to the Task object and then read the MessageQueue field. This will return a message queue ID that you can then use to send messages to the Task via the SendMessage() function.
The Task class supports the following actions:
Activate Activating a Task object will execute it. GetUnlistedField Retrieves unlisted field values. SetUnlistedField Unlisted fields are supported by the Task class for the storage of program variables.
The Task class implements the following methods:
AddTaskArgument Adds new arguments to the ArgsList field. ExpungeTask Forces a Task to expunge unused code. Quit Sends a quit message to a task.
The Task object consists of the following public fields:
Actions Used to gain direct access to a Task's actions. Args Command line arguments (string format). ArgsList Command line arguments (list format). Author Describes the person that wrote the program. Copyright Copyright/licensing details. Date The date that the program was last updated or compiled. Location Location to load an executable file from. MessageQueue Read this field to acquire a Task's message queue ID. Name Name of the Task. Output Defines the object that will receive printed output from a Task. Path The current path being used by a task object. Short Short description of the program/task.
Action: | Activate | |||||||||
Short: | Activating a Task object will execute it. | |||||||||
|
Method: | AddTaskArgument() | |||||||||||
Short: | Adds new arguments to the ArgsList field. | |||||||||||
Arguments: |
| |||||||||||
|
Method: | Quit() | |
Short: | Sends a quit message to a task. | |
|
Field: | Actions | |
Short: | Used to gain direct access to a Task's actions. | |
Type: | APTR * | |
Status: | Get | |
|
Field: | Args | |
Short: | Command line arguments (string format). | |
Type: | STRING | |
Status: | Set | |
|
Field: | ArgsList | |
Short: | Command line arguments (list format). | |
Type: | STRING * | |
Status: | Get/Set | |
|
Field: | Author | |
Short: | Describes the person that wrote the program. | |
Type: | STRING | |
Status: | Read/Init | |
|
Field: | Copyright | |
Short: | Copyright/licensing details. | |
Type: | STRING | |
Status: | Read/Init | |
|
Field: | Date | |
Short: | The date that the program was last updated or compiled. | |
Type: | STRING | |
Status: | Read/Init | |
|
Field: | Location | |
Short: | Location to load an executable file from. | |
Type: | STRING | |
Status: | Read/Init | |
|
Field: | MessageQueue | |
Short: | Read this field to acquire a Task's message queue ID. | |
Type: | MEMORYID | |
Status: | Read | |
|
Field: | Name | |
Short: | Name of the Task. | |
Type: | STRING | |
Status: | Read/Init | |
|
Field: | Output | |
Short: | Defines the object that will receive printed output from a Task. | |
Type: | OBJECTID | |
Status: | Read/Write | |
|
Field: | Path | |
Short: | The current path being used by a task object. | |
Type: | STRING | |
Status: | Get/Set | |
|
Field: | Short | |
Short: | Short description of the program/task. | |
Type: | STRING | |
Status: | Read/Init | |
|