Skip to content

Commit d977c31

Browse files
updated doxygen
1 parent 68f2506 commit d977c31

108 files changed

Lines changed: 1135 additions & 486 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

doc/QuickStart.dox

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ See a quick <a href="https://cpp-taskflow.github.io/">presentation</a> and visit
2020
@section HowToInstallCppTaskflow How to Install Cpp-Taskflow?
2121

2222
Cpp-Taskflow is *header-only* and there is no need for installation.
23-
Simply download the source and copy the headers under the `taskflow` subdirectory to your project.
23+
Simply download the source and copy the headers under the @c taskflow subdirectory to your project.
2424

2525
@code{.sh}
2626
~$ git clone https://github.com/cpp-taskflow/cpp-taskflow.git
@@ -37,9 +37,9 @@ Here is a rather simple program to get you started.
3737

3838
int main(){
3939

40-
tf::Taskflow tf;
40+
tf::Taskflow taskflow;
4141

42-
auto [A, B, C, D] = tf.silent_emplace(
42+
auto [A, B, C, D] = taskflow.silent_emplace(
4343
[] () { std::cout << "TaskA\n"; }, // task dependency graph
4444
[] () { std::cout << "TaskB\n"; }, //
4545
[] () { std::cout << "TaskC\n"; }, // +---+
@@ -51,7 +51,7 @@ int main(){
5151
B.precede(D); // B runs before D // | +---+ |
5252
C.precede(D); // C runs before D // +---->| C |-----+
5353
// +---+
54-
tf.wait_for_all(); // block until finish
54+
taskflow.wait_for_all(); // block until finish
5555

5656
return 0;
5757
}
@@ -76,7 +76,7 @@ TaskB
7676
TaskD
7777
@endcode
7878

79-
The execution order of B and C might differ as they can run concurrencly.
79+
The execution order of B and C might differ as they can run concurrently.
8080

8181
@section SupportedCompilers Supported Compilers
8282

doc/cookbook/Chapter1.dox

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace tf {
33
/** @page chapter1 C1: Understand the %Task
44

55
In this chapter, we demonstrate the basic construct of
6-
a task dependency graph - tf::Task.
6+
a task dependency graph - Task.
77

88
@section WhatIsATask What is a Task?
99

@@ -17,30 +17,28 @@ Taskflow::silent_emplace, and
1717
Taskflow::emplace to create a task.
1818

1919
@code{.cpp}
20-
1: tf::Taskflow tf;
21-
2: auto A = tf.placeholder();
22-
3: auto B = tf.silent_emplace([] () {});
23-
4: auto [C, FuC] = tf.emplace([] () { return 1; });
20+
1: auto A = taskflow.placeholder();
21+
2: auto B = taskflow.silent_emplace([] () {});
22+
3: auto [C, FuC] = taskflow.emplace([] () { return 1; });
2423
@endcode
2524

2625
Debrief:
27-
@li Line 1 creates a taskflow object
28-
@li Line 2 creates an empty task
29-
@li Line 3 creates a task from a given callable object and returns a task handle
30-
@li Line 4 creates a task from a given callable object and returns, in addition to a task handle, a @std_future object to access the result
26+
@li Line 1 creates an empty task
27+
@li Line 2 creates a task from a given callable object and returns a task handle
28+
@li Line 3 creates a task from a given callable object and returns, in addition to a task handle, a @std_future object to access the result
3129

3230
Each time you create a task, including an empty one,
3331
the taskflow object adds a node to the present graph
34-
and returns a task handle of type tf::Task.
32+
and returns a task handle of type Task.
3533
A task handle is a lightweight object
3634
that wraps up a particular node in a graph
3735
and provides a set of methods for you to assign different attributes to the task
3836
such as adding dependencies, naming, and assigning a new work.
3937

4038
@code{.cpp}
41-
1: tf::Taskflow tf;
42-
2: auto A = tf.silent_emplace([] () { std::cout << "create a task A\n"; });
43-
3: auto B = tf.silent_emplace([] () { std::cout << "create a task B\n"; });
39+
1: tf::Taskflow taskflow;
40+
2: auto A = taskflow.silent_emplace([] () { std::cout << "create a task A\n"; });
41+
3: auto B = taskflow.silent_emplace([] () { std::cout << "create a task B\n"; });
4442
4:
4543
5: A.name("TaskA");
4644
6: A.work([] () { std::cout << "reassign A to a new task\n"; });
@@ -74,9 +72,8 @@ the associated task finishes.
7472
This is particularly useful when you would like to pass data between tasks.
7573

7674
@code{.cpp}
77-
tf::Taskflow tf;
78-
auto [A, FuA] = tf.emplace([](){ return 1; });
79-
tf.wait_for_all();
75+
auto [A, FuA] = taskflow.emplace([](){ return 1; });
76+
taskflow.wait_for_all();
8077
std::cout << FuA.get() << std::endl; // 1
8178
@endcode
8279

@@ -86,10 +83,9 @@ The execution does not start until you dispatch the graph.
8683
For example, the following code will block and never finish:
8784

8885
@code{.cpp}
89-
tf::Taskflow tf;
90-
auto [A, FuA] = tf.emplace([](){ return 1; });
86+
auto [A, FuA] = taskflow.emplace([](){ return 1; });
9187
std::cout << FuA.get() << std::endl; // block
92-
tf.wait_for_all(); // never enter this line
88+
taskflow.wait_for_all(); // never enter this line
9389
@endcode
9490

9591
@section CreateMultipleTasksAtOneTime Create Multiple Tasks at One Time
@@ -100,7 +96,7 @@ Both Taskflow::silent_emplace and Taskflow::emplace can accept arbitrary numbers
10096
and create multiple tasks at one time.
10197

10298
@code{.cpp}
103-
auto [A, B, C] = tf.silent_emplace( // create three tasks in one call
99+
auto [A, B, C] = taskflow.silent_emplace( // create three tasks in one call
104100
[](){ std::cout << "Task A\n"; },
105101
[](){ std::cout << "Task B\n"; },
106102
[](){ std::cout << "Task C\n"; }
@@ -129,36 +125,36 @@ task dependency graphs.
129125
2:
130126
3: int main() {
131127
4:
132-
5: tf::Taskflow tf;
128+
5: tf::Taskflow taskflow;
133129
6:
134130
7: // create a task dependency graph
135131
8: std::array<tf::Task, 4> tasks {
136-
9: tf.silent_emplace([] () { std::cout << "Task A\n"; }),
137-
10: tf.silent_emplace([] () { std::cout << "Task B\n"; }),
138-
11: tf.silent_emplace([] () { std::cout << "Task C\n"; }),
139-
12: tf.silent_emplace([] () { std::cout << "Task D\n"; })
132+
9: taskflow.silent_emplace([] () { std::cout << "Task A\n"; }),
133+
10: taskflow.silent_emplace([] () { std::cout << "Task B\n"; }),
134+
11: taskflow.silent_emplace([] () { std::cout << "Task C\n"; }),
135+
12: taskflow.silent_emplace([] () { std::cout << "Task D\n"; })
140136
13: };
141137
14:
142138
15: tasks[0].precede(tasks[1]);
143139
16: tasks[0].precede(tasks[2]);
144140
17: tasks[1].precede(tasks[3]);
145141
18: tasks[2].precede(tasks[3]);
146142
19:
147-
20: tf.wait_for_all();
143+
20: taskflow.wait_for_all();
148144
21:
149145
22: // create another task dependency graph
150146
23: tasks = {
151-
24: tf.silent_emplace([] () { std::cout << "New Task A\n"; }),
152-
25: tf.silent_emplace([] () { std::cout << "New Task B\n"; }),
153-
26: tf.silent_emplace([] () { std::cout << "New Task C\n"; }),
154-
27: tf.silent_emplace([] () { std::cout << "New Task D\n"; })
147+
24: taskflow.silent_emplace([] () { std::cout << "New Task A\n"; }),
148+
25: taskflow.silent_emplace([] () { std::cout << "New Task B\n"; }),
149+
26: taskflow.silent_emplace([] () { std::cout << "New Task C\n"; }),
150+
27: taskflow.silent_emplace([] () { std::cout << "New Task D\n"; })
155151
28: };
156152
29:
157153
30: tasks[3].precede(tasks[2]);
158154
31: tasks[2].precede(tasks[1]);
159155
32: tasks[1].precede(tasks[0]);
160156
33:
161-
34: tf.wait_for_all();
157+
34: taskflow.wait_for_all();
162158
35:
163159
36: return 0;
164160
37: }
@@ -189,11 +185,11 @@ the task handler.
189185
2:
190186
3: int main() {
191187
4:
192-
5: tf::Taskflow tf;
188+
5: tf::Taskflow taskflow;
193189
6:
194190
7: std::vector<tf::Task> tasks = {
195-
8: tf.placeholder(), // create a task with no work
196-
9: tf.placeholder() // create a task with no work
191+
8: taskflow.placeholder(), // create a task with no work
192+
9: taskflow.placeholder() // create a task with no work
197193
10: };
198194
11:
199195
12: tasks[0].name("This is Task 0");
@@ -206,12 +202,12 @@ the task handler.
206202
19: << "num_successors=" << task.num_successors() << '\n';
207203
20: }
208204
21:
209-
22: tf.dump(std::cout); // dump the taskflow graph
205+
22: taskflow.dump(std::cout); // dump the taskflow graph
210206
23:
211207
24: tasks[0].work([](){ std::cout << "got a new work!\n"; });
212208
25: tasks[1].work([](){ std::cout << "got a new work!\n"; });
213209
26:
214-
27: tf.wait_for_all();
210+
27: taskflow.wait_for_all();
215211
28:
216212
29: return 0;
217213
30: }

0 commit comments

Comments
 (0)