annotate include/TaskManager/HTask.h @ 293:9f4f99d459aa

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