File: Poco.TaskManager.html

package info (click to toggle)
poco-doc 1.3.6-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, squeeze, stretch, wheezy
  • size: 10,076 kB
  • ctags: 9,611
  • sloc: makefile: 31
file content (140 lines) | stat: -rw-r--r-- 10,441 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::TaskManager</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.html" class="namespace">Poco</a></h1>
<h1 class="symbol">class TaskManager</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Foundation<br />
<b>Package:</b> Tasks<br />
<b>Header:</b> Poco/TaskManager.h</p>
<h2>Description</h2>
<div class="description">
<p>The <a href="Poco.TaskManager.html" title="class Poco::TaskManager">TaskManager</a> manages a collection of tasks and monitors their lifetime. </p>
<p>A <a href="Poco.TaskManager.html" title="class Poco::TaskManager">TaskManager</a> has a built-in <a href="Poco.NotificationCenter.html" title="class Poco::NotificationCenter">NotificationCenter</a> that is used to send out notifications on task progress and task states. See the <a href="Poco.TaskNotification.html" title="class Poco::TaskNotification">TaskNotification</a> class and its subclasses for the various events that result in a notification. To keep the number of notifications small, a <a href="Poco.TaskProgressNotification.html" title="class Poco::TaskProgressNotification">TaskProgressNotification</a> will only be sent out once in 100 milliseconds. </p>
</div>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.TaskManager.html#10602" title="Poco::TaskManager::addObserver()">addObserver</a>, <a href="Poco.TaskManager.html#10598" title="Poco::TaskManager::cancelAll()">cancelAll</a>, <a href="Poco.TaskManager.html#10601" title="Poco::TaskManager::count()">count</a>, <a href="Poco.TaskManager.html#10599" title="Poco::TaskManager::joinAll()">joinAll</a>, <a href="Poco.TaskManager.html#10607" title="Poco::TaskManager::postNotification()">postNotification</a>, <a href="Poco.TaskManager.html#10604" title="Poco::TaskManager::removeObserver()">removeObserver</a>, <a href="Poco.TaskManager.html#10596" title="Poco::TaskManager::start()">start</a>, <a href="Poco.TaskManager.html#10614" title="Poco::TaskManager::taskCancelled()">taskCancelled</a>, <a href="Poco.TaskManager.html#10618" title="Poco::TaskManager::taskFailed()">taskFailed</a>, <a href="Poco.TaskManager.html#10616" title="Poco::TaskManager::taskFinished()">taskFinished</a>, <a href="Poco.TaskManager.html#10600" title="Poco::TaskManager::taskList()">taskList</a>, <a href="Poco.TaskManager.html#10611" title="Poco::TaskManager::taskProgress()">taskProgress</a>, <a href="Poco.TaskManager.html#10609" title="Poco::TaskManager::taskStarted()">taskStarted</a></p>
<h2>Types</h2>
<h3><a name="10591">TaskList</a></h3>
<p class="decl">typedef std::list &lt; <a href="Poco.TaskManager.html#10590" title="Poco::TaskManager::TaskPtr">TaskPtr</a> &gt; <a href="Poco.TaskManager.html#10591" title="Poco::TaskManager::TaskList">TaskList</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="10590">TaskPtr</a></h3>
<p class="decl">typedef <a href="Poco.AutoPtr.html" title="class Poco::AutoPtr">AutoPtr</a> &lt; <a href="Poco.Task.html" title="class Poco::Task">Task</a> &gt; <a href="Poco.TaskManager.html#10590" title="Poco::TaskManager::TaskPtr">TaskPtr</a>;</p>
<div class="description">
<p></p>
</div>
<h2>Constructors</h2>
<h3><a name="10592">TaskManager</a></h3>
<p class="decl"><a href="Poco.TaskManager.html" title="class Poco::TaskManager">TaskManager</a>();</p>
<div class="description">
<p>Creates the <a href="Poco.TaskManager.html" title="class Poco::TaskManager">TaskManager</a>, using the default <a href="Poco.ThreadPool.html" title="class Poco::ThreadPool">ThreadPool</a>. </p>
</div>
<h3><a name="10593">TaskManager</a></h3>
<p class="decl"><a href="Poco.TaskManager.html" title="class Poco::TaskManager">TaskManager</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.ThreadPool.html" title="class Poco::ThreadPool">ThreadPool</a> &amp; pool<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.TaskManager.html" title="class Poco::TaskManager">TaskManager</a>, using the given <a href="Poco.ThreadPool.html" title="class Poco::ThreadPool">ThreadPool</a>. </p>
</div>
<h2>Destructor</h2>
<h3><a name="10595">~TaskManager</a></h3>
<p class="decl">~<a href="Poco.TaskManager.html" title="class Poco::TaskManager">TaskManager</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.TaskManager.html" title="class Poco::TaskManager">TaskManager</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="10602">addObserver</a></h3>
<p class="decl">void addObserver(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.AbstractObserver.html" title="class Poco::AbstractObserver">AbstractObserver</a> &amp; observer<br />);</p>
<div class="description">
<p>Registers an observer with the <a href="Poco.NotificationCenter.html" title="class Poco::NotificationCenter">NotificationCenter</a>. Usage: </p>
<pre>Observer&lt;MyClass, MyNotification&gt; obs(*this, &amp;MyClass::handleNotification);
notificationCenter.addObserver(obs);
</pre>
</div>
<h3><a name="10598">cancelAll</a></h3>
<p class="decl">void cancelAll();</p>
<div class="description">
<p>Requests cancellation of all tasks. </p>
</div>
<h3><a name="10601">count</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int count() const;</p>
<div class="description">
<p>Returns the number of tasks in the internal task list. </p>
</div>
<h3><a name="10599">joinAll</a></h3>
<p class="decl">void joinAll();</p>
<div class="description">
<p>Waits for the completion of all the threads in the <a href="Poco.TaskManager.html" title="class Poco::TaskManager">TaskManager</a>'s thread pool. </p>
</div>
<h3><a name="10604">removeObserver</a></h3>
<p class="decl">void removeObserver(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.AbstractObserver.html" title="class Poco::AbstractObserver">AbstractObserver</a> &amp; observer<br />);</p>
<div class="description">
<p>Unregisters an observer with the <a href="Poco.NotificationCenter.html" title="class Poco::NotificationCenter">NotificationCenter</a>. </p>
</div>
<h3><a name="10596">start</a></h3>
<p class="decl">void start(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Task.html" title="class Poco::Task">Task</a> * pTask<br />);</p>
<div class="description">
<p>Starts the given task in a thread obtained from the thread pool. </p>
<p>The <a href="Poco.TaskManager.html" title="class Poco::TaskManager">TaskManager</a> takes ownership of the <a href="Poco.Task.html" title="class Poco::Task">Task</a> object and deletes it when it it finished. </p>
</div>
<h3><a name="10600">taskList</a></h3>
<p class="decl"><a href="Poco.TaskManager.html#10591" title="Poco::TaskManager::TaskList">TaskList</a> taskList() const;</p>
<div class="description">
<p>Returns a copy of the internal task list. </p>
</div>
<h3><a name="10607">postNotification</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void postNotification(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Notification.html" title="class Poco::Notification">Notification</a> * pNf<br />);</p>
<div class="description">
<p>Posts a notification to the task manager's  notification center. </p>
</div>
<h3><a name="10614">taskCancelled</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void taskCancelled(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Task.html" title="class Poco::Task">Task</a> * pTask<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="10618">taskFailed</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void taskFailed(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Task.html" title="class Poco::Task">Task</a> * pTask,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Exception.html" title="class Poco::Exception">Exception</a> &amp; exc<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="10616">taskFinished</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void taskFinished(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Task.html" title="class Poco::Task">Task</a> * pTask<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="10611">taskProgress</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void taskProgress(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Task.html" title="class Poco::Task">Task</a> * pTask,<br />&nbsp;&nbsp;&nbsp;&nbsp;float progress<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="10609">taskStarted</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void taskStarted(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Task.html" title="class Poco::Task">Task</a> * pTask<br />);</p>
<div class="description">
<p></p>
</div>
<h2>Variables</h2>
<h3><a name="10606">MIN_PROGRESS_NOTIFICATION_INTERVAL</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const int <a href="Poco.TaskManager.html#10606" title="Poco::TaskManager::MIN_PROGRESS_NOTIFICATION_INTERVAL">MIN_PROGRESS_NOTIFICATION_INTERVAL</a>;</p>
<div class="description">
<p></p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>