annotate include/TaskManager/HTask.h @ 293:da8edd0735f2 draft

add wait_for document
author e065746@localhost.localdomain
date Fri, 05 Jun 2009 19:17:16 +0900
parents 028ffc9c0375
children 3fc86ddf5d1c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #ifndef INCLUDED_HTASK
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #define INCLUDED_HTASK
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4 #ifndef INCLUDED_BASE_H_
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5 # include "base.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
6 #endif
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 #ifndef INCLUDED_TYPES
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 # include "types.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 #endif
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 #ifndef INCLUDED_TASK
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 # include "Task.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 #endif
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 #ifndef INCLUDED_TASK_QUEUE_INFO
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 # include "TaskQueueInfo.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18 #endif
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 class TaskManagerImpl;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
22 /*!
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
23 @class
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
24
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
25 @brief
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
26
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
27 Cerium の Task で、spawn() でキューに格納されて順次実行される。
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
28 cpu の指定があれば並列に実行される。
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
29 特定の Task を待ち合わせる事が可能。
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
30 Task の入出力は dma などで copy される。
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
31 */
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
32
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
33 class HTask : public Task {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34 public:
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
35 BASE_NEW_DELETE(HTask);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
36
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
37 TaskQueuePtr wait_me; // List of task waiting for me
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
38 TaskQueuePtr wait_i; // List of task for which I am waiting
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
39 void (*post_func)(void *);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
40 void *post_arg;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
41 CPU_TYPE cpu_type;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42 HTask *next;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
43 TaskManagerImpl *mimpl;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
44
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
45 void spawn(void);
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
46 void wait_for(HTask *);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
47 void set_cpu(CPU_TYPE type);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
48 void set_post(void (*func)(void *), void *arg);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
49 };
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
50
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
51 typedef HTask* HTaskPtr;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
52
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
53 #endif