WebRadioApp  0.1
_CoreTaskQueue.h
Go to the documentation of this file.
1 /*******************************************************************************
2 *
3 * E M B E D D E D W I Z A R D P R O J E C T
4 *
5 * Copyright (c) TARA Systems GmbH
6 * written by Paul Banach and Manfred Schweyer
7 *
8 ********************************************************************************
9 *
10 * This file was generated automatically by Embedded Wizard Studio.
11 *
12 * Please do not make any modifications of this file! The modifications are lost
13 * when the file is generated again by Embedded Wizard Studio!
14 *
15 * The template of this heading text can be found in the file 'head.ewt' in the
16 * directory 'Platforms' of your Embedded Wizard installation directory. If you
17 * wish to adapt this text, please copy the template file 'head.ewt' into your
18 * project directory and edit the copy only. Please avoid any modifications of
19 * the original template file!
20 *
21 * Version : 10.00
22 * Profile : STM32H747
23 * Platform : STM.STM32.RGB565
24 *
25 *******************************************************************************/
26 
27 #ifndef _CoreTaskQueue_H
28 #define _CoreTaskQueue_H
29 
30 #ifdef __cplusplus
31  extern "C"
32  {
33 #endif
34 
35 #include "ewrte.h"
36 #if EW_RTE_VERSION != 0x000A0000
37  #error Wrong version of Embedded Wizard Runtime Environment.
38 #endif
39 
40 #include "ewgfx.h"
41 #if EW_GFX_VERSION != 0x000A0000
42  #error Wrong version of Embedded Wizard Graphics Engine.
43 #endif
44 
45 /* Forward declaration of the class Core::Task */
46 #ifndef _CoreTask_
47  EW_DECLARE_CLASS( CoreTask )
48 #define _CoreTask_
49 #endif
50 
51 /* Forward declaration of the class Core::TaskQueue */
52 #ifndef _CoreTaskQueue_
53  EW_DECLARE_CLASS( CoreTaskQueue )
54 #define _CoreTaskQueue_
55 #endif
56 
57 
58 /* The class Core::TaskQueue provides a simple task scheduler component. The component
59  implements functionality to register, manage and perform tasks. A task can be
60  e.g. an animated transition between two GUI components. With the task queue,
61  several independent transitions (and another operations) can be executed strictly
62  one after another.
63  Usually the tasks are executed in the order in which they were previously added
64  to the queue (the order in which they are scheduled). The queue takes care that
65  at the same time only one task is executed. This task is called the 'current'
66  task. As soon as the current task is completed, the queue activates the next
67  available task.
68  A single task is represented by an instance of a class derived from Core::Task.
69  To schedule a task, create an instance of the task class and call the method
70  @ScheduleTask() with the task as parameter.
71  With the method @CancelTask() you can remove a previously scheduled task from
72  the queue again or if the task is already running, stop it and let the queue
73  continue with the next task.
74  The method @GetCurrentTask() is useful to determine which task is currently in
75  progress by the affected queue.
76  It is essential to understand, that the entire 'task' functionality has nothing
77  to do with multi-threading or multi-tasking features known from operating systems.
78  Applications developed with Chora are limited to a single-thread environment.
79  There is no real background thread activity. Accordingly your implementation
80  of a task should behave cooperatively. A well designed task should perform its
81  job quickly, use timers or effects to delay execution and when the job is done
82  inform the queue about its completion. */
83 EW_DEFINE_FIELDS( CoreTaskQueue, XObject )
84  EW_VARIABLE( toContinue, CoreTask )
85  EW_VARIABLE( current, CoreTask )
86  EW_VARIABLE( last, CoreTask )
87  EW_VARIABLE( first, CoreTask )
88  EW_PROPERTY( OnDone, XSlot )
89  EW_VARIABLE( isInOnStart, XBool )
90 EW_END_OF_FIELDS( CoreTaskQueue )
91 
92 /* Virtual Method Table (VMT) for the class : 'Core::TaskQueue' */
93 EW_DEFINE_METHODS( CoreTaskQueue, XObject )
94 EW_END_OF_METHODS( CoreTaskQueue )
95 
96 /* 'C' function for method : 'Core::TaskQueue.completeTask()' */
97 void CoreTaskQueue_completeTask( CoreTaskQueue _this );
98 
99 /* 'C' function for method : 'Core::TaskQueue.onDispatchNext()' */
100 void CoreTaskQueue_onDispatchNext( CoreTaskQueue _this, XObject sender );
101 
102 /* 'C' function for method : 'Core::TaskQueue.onPreDispatchNext()' */
103 void CoreTaskQueue_onPreDispatchNext( CoreTaskQueue _this, XObject sender );
104 
105 /* The method CancelTask() allows the application to remove a previously registered
106  task from the task queue. The affected task is determined by the parameter aTask.
107  If the affected task is currently executed, the task is notified to immediately
108  finalize its work. Afterwards the queue starts the next available task. The method
109  will throw an error if you try to cancel a task not belonging to this queue. */
110 void CoreTaskQueue_CancelTask( CoreTaskQueue _this, CoreTask aTask );
111 
112 /* The method ScheduleTask() registers the task passed in the parameter aTask for
113  later execution.
114  The tasks are executed in the order in which they have been previously scheduled.
115  If the parameter aWithPriority is false, the new task will be arranged at the
116  end of the list with waiting tasks. If the parameter is true, the task is enqueued
117  in front of all waiting tasks.
118  The method will throw an error if you try to schedule the same task twice. */
119 void CoreTaskQueue_ScheduleTask( CoreTaskQueue _this, CoreTask aTask, XBool aWithPriority );
120 
121 #ifdef __cplusplus
122  }
123 #endif
124 
125 #endif /* _CoreTaskQueue_H */
126 
127 /* Embedded Wizard */
CoreTaskQueue_onPreDispatchNext
void CoreTaskQueue_onPreDispatchNext(CoreTaskQueue _this, XObject sender)
Definition: Core.c:6678
ewrte.h
CoreTaskQueue_CancelTask
void CoreTaskQueue_CancelTask(CoreTaskQueue _this, CoreTask aTask)
Definition: Core.c:6691
EW_END_OF_FIELDS
#define EW_END_OF_FIELDS(aClass)
Definition: ewrte.h:460
EW_DECLARE_CLASS
#define EW_DECLARE_CLASS(aClass)
Definition: ewrte.h:393
XSlot
Definition: ewrte.h:2114
EW_VARIABLE
#define EW_VARIABLE(aName, aType)
Definition: ewrte.h:464
ewgfx.h
_obj_XObject
Definition: ewrte.h:281
CoreTaskQueue_completeTask
void CoreTaskQueue_completeTask(CoreTaskQueue _this)
Definition: Core.c:6628
CoreTaskQueue_ScheduleTask
void CoreTaskQueue_ScheduleTask(CoreTaskQueue _this, CoreTask aTask, XBool aWithPriority)
Definition: Core.c:6746
XBool
char XBool
Definition: ewrte.h:1592
EW_DEFINE_METHODS
#define EW_DEFINE_METHODS(aClass, aSuperClass)
Definition: ewrte.h:524
sender
XRect CoreOutline aOutline XObject sender
Definition: _ApplicationRadioInterface.h:186
EW_PROPERTY
#define EW_PROPERTY(aName, aType)
Definition: ewrte.h:466
EW_END_OF_METHODS
#define EW_END_OF_METHODS(aClass)
Definition: ewrte.h:539
CoreTaskQueue_onDispatchNext
void CoreTaskQueue_onDispatchNext(CoreTaskQueue _this, XObject sender)
Definition: Core.c:6649
EW_DEFINE_FIELDS
#define EW_DEFINE_FIELDS(aClass, aSuperClass)
Definition: ewrte.h:451