1.3.11 OcaTaskManager
Class Hierarchy:
OcaRoot : OcaManager : OcaTaskManager
-
class OcaTaskManager : OcaManager
This class is deprecated in version 2 (OCA 1.5). Optional manager that collects OcaTask and OcaProgram objects.
May be instantiated once in any device.
If instantiated, object number must be 11.
Tasks shall be device execution threads that start, execute, and (normally) stop. The action of an OcaTask is defined by an OcaProgram. The idea is that OcaTasks shall execute OcaPrograms. OcaTaskManager offers global control over tasks in the device.
Device task processing state is Enabled by default. In Enabled state, tasks may be running.
Device task processing state may be Disabled by the OcaTaskManager Disable command.
The Disable command will succeed only if no tasks are running.
Tasks may be stopped by: passing the OcaTaskManager a Stop or Abort command, which will stop designated tasks in the device;.
Properties:
-
static const OcaClassID ClassID = "1.3.11"
Number that uniquely identifies the class. Note that this differs from the object number, which identifies the instantiated object. This property is an override of the OcaRoot property.
This property has id
1.1
.
-
static const OcaClassVersionNumber ClassVersion = 3
Identifies the interface version of the class. Any change to the class definition leads to a higher class version. This property is an override of the OcaRoot property.
This property has id
1.2
.
-
OcaTaskManagerState State
Current state of task processing. State is Disabled after a Disable command has been received, Enabled otherwise.
This property has id
3.1
.
Properties inherited from 1.3 OcaManager:
Methods:
-
OcaStatus Enable(OcaBoolean Enable)
Enables (parameter =TRUE) or disables (parameter = FALSE) the running of tasks. Changes value of property State from Disabled to Enabled and vice versa. All tasks running when Enable is called with parameter = FALSE are immediately aborted.
This method has id
3.1
.Enable: Input parameter.
-
OcaStatus ControlAllTasks(OcaTaskCommand Command, OcaBlob ApplicationTaskParameter)
Controls all tasks in device. Return value indicates whether tasks were successfully controlled.
This method has id
3.2
.Command: Input parameter.
ApplicationTaskParameter: Input parameter.
-
OcaStatus ControlTaskGroup(OcaID16 GroupID, OcaTaskCommand Command, OcaBlob ApplicationTaskParameter)
Controls all tasks in the given group. Return value indicates whether tasks were successfully controlled.
This method has id
3.3
.GroupID: Input parameter.
Command: Input parameter.
ApplicationTaskParameter: Input parameter.
-
OcaStatus ControlTask(OcaTaskID TaskID, OcaTaskCommand Command, OcaBlob ApplicationTaskParameter)
Controls a specified task. Return value indicates whether tasks were successfully controlled.
This method has id
3.4
.TaskID: Input parameter.
Command: Input parameter.
ApplicationTaskParameter: Input parameter.
-
OcaStatus GetState(OcaTaskManagerState &State)
Gets value of property State. Return value indicates whether value was successfully retrieved.
This method has id
3.5
.State: Output parameter.
-
OcaStatus GetTaskStatuses(OcaTaskStatus &Statuses)
This method has id
3.6
.Statuses: Output parameter.
-
OcaStatus GetTaskStatus(OcaTaskID TaskID, OcaTaskStatus &Status)
This method has id
3.7
.
-
OcaStatus AddTask()
Creates a Task. Parameters of the new Task are given in the Task parameter; device returns the same parameter with the new Task ID filled in. Initial task state is set to Disabled. Return value indicates whether Task was successfully created.
This method has id
3.8
.
-
OcaStatus GetTasks(OcaMap<OcaTaskID, OcaTask> &Tasks)
Gets map of Tasks in the device. Return value indicates whether map was successfully retrieved.
This method has id
3.9
.Tasks: Output parameter.
-
OcaStatus GetTask(OcaTaskID ID, OcaTask &Task)
Retrieves a Task. Return value indicates whether Task was successfully retrieved.
This method has id
3.10
.
-
OcaStatus SetTask(OcaTaskID ID, OcaTask Task)
Updates a Task. Return value indicates whether Task was successfully updated.
This method has id
3.11
.
-
OcaStatus DeleteTask(OcaTaskID ID)
Deletes a task. Return value indicates whether task was successfully deleted. Method fails with status=ProcessingFailed if task is running.
This method has id
3.12
.ID: Input parameter.
Methods inherited from 1.3 OcaManager:
Events:
-
void TaskStateChanged(OcaTaskStatusChangedEventData EventData)
This event has id
3.1
.