OSDN Git Service

Some documentation updates.
[mutilities/MUtilities.git] / docs / dc / dd3 / class_m_utils_1_1_job_object.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <meta name="generator" content="Doxygen 1.8.12"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>MuldeR&#39;s Utilities for Qt: MUtils::JobObject Class Reference</title>
9 <link href="../../tabs.css" rel="stylesheet" type="text/css"/>
10 <script type="text/javascript" src="../../jquery.js"></script>
11 <script type="text/javascript" src="../../dynsections.js"></script>
12 <link href="../../search/search.css" rel="stylesheet" type="text/css"/>
13 <script type="text/javascript" src="../../search/searchdata.js"></script>
14 <script type="text/javascript" src="../../search/search.js"></script>
15 <link href="../../doxygen.css" rel="stylesheet" type="text/css" />
16 </head>
17 <body>
18 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
19 <div id="titlearea">
20 <table cellspacing="0" cellpadding="0">
21  <tbody>
22  <tr style="height: 56px;">
23   <td id="projectalign" style="padding-left: 0.5em;">
24    <div id="projectname">MuldeR&#39;s Utilities for Qt
25    </div>
26    <div id="projectbrief">MUtilities</div>
27   </td>
28  </tr>
29  </tbody>
30 </table>
31 </div>
32 <!-- end header part -->
33 <!-- Generated by Doxygen 1.8.12 -->
34 <script type="text/javascript">
35 var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
36 </script>
37 <script type="text/javascript" src="../../menudata.js"></script>
38 <script type="text/javascript" src="../../menu.js"></script>
39 <script type="text/javascript">
40 $(function() {
41   initMenu('../../',true,false,'search.php','Search');
42   $(document).ready(function() { init_search(); });
43 });
44 </script>
45 <div id="main-nav"></div>
46 <!-- window showing the filter options -->
47 <div id="MSearchSelectWindow"
48      onmouseover="return searchBox.OnSearchSelectShow()"
49      onmouseout="return searchBox.OnSearchSelectHide()"
50      onkeydown="return searchBox.OnSearchSelectKey(event)">
51 </div>
52
53 <!-- iframe showing the search results (closed by default) -->
54 <div id="MSearchResultsWindow">
55 <iframe src="javascript:void(0)" frameborder="0" 
56         name="MSearchResults" id="MSearchResults">
57 </iframe>
58 </div>
59
60 <div id="nav-path" class="navpath">
61   <ul>
62 <li class="navelem"><a class="el" href="../../d3/da6/namespace_m_utils.html">MUtils</a></li><li class="navelem"><a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html">JobObject</a></li>  </ul>
63 </div>
64 </div><!-- top -->
65 <div class="header">
66   <div class="summary">
67 <a href="#pub-methods">Public Member Functions</a> &#124;
68 <a href="../../d1/d08/class_m_utils_1_1_job_object-members.html">List of all members</a>  </div>
69   <div class="headertitle">
70 <div class="title">MUtils::JobObject Class Reference</div>  </div>
71 </div><!--header-->
72 <div class="contents">
73
74 <p>This class represents a job object.  
75  <a href="../../dc/dd3/class_m_utils_1_1_job_object.html#details">More...</a></p>
76
77 <p><code>#include &lt;<a class="el" href="../../d4/d85/_job_object_8h_source.html">JobObject.h</a>&gt;</code></p>
78 <table class="memberdecls">
79 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
80 Public Member Functions</h2></td></tr>
81 <tr class="memitem:a4ec8b0013bca35149def434b738d80fb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#a4ec8b0013bca35149def434b738d80fb">JobObject</a> (void)</td></tr>
82 <tr class="memdesc:a4ec8b0013bca35149def434b738d80fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance.  <a href="#a4ec8b0013bca35149def434b738d80fb">More...</a><br /></td></tr>
83 <tr class="separator:a4ec8b0013bca35149def434b738d80fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
84 <tr class="memitem:a0e2d6461729d16b615548e7b1594c893"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#a0e2d6461729d16b615548e7b1594c893">~JobObject</a> (void)</td></tr>
85 <tr class="memdesc:a0e2d6461729d16b615548e7b1594c893"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys the <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance.  <a href="#a0e2d6461729d16b615548e7b1594c893">More...</a><br /></td></tr>
86 <tr class="separator:a0e2d6461729d16b615548e7b1594c893"><td class="memSeparator" colspan="2">&#160;</td></tr>
87 <tr class="memitem:a1d86b1a284da53bbcf92713d494c2304"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#a1d86b1a284da53bbcf92713d494c2304">isObjectCreated</a> (void)</td></tr>
88 <tr class="memdesc:a1d86b1a284da53bbcf92713d494c2304"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test whether job object was created successfully.  <a href="#a1d86b1a284da53bbcf92713d494c2304">More...</a><br /></td></tr>
89 <tr class="separator:a1d86b1a284da53bbcf92713d494c2304"><td class="memSeparator" colspan="2">&#160;</td></tr>
90 <tr class="memitem:a1ea821a376842494b0d0ef0b17bfaecc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#a1ea821a376842494b0d0ef0b17bfaecc">addProcessToJob</a> (const QProcess *const process)</td></tr>
91 <tr class="memdesc:a1ea821a376842494b0d0ef0b17bfaecc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a process to the job object.  <a href="#a1ea821a376842494b0d0ef0b17bfaecc">More...</a><br /></td></tr>
92 <tr class="separator:a1ea821a376842494b0d0ef0b17bfaecc"><td class="memSeparator" colspan="2">&#160;</td></tr>
93 <tr class="memitem:abe785eacf0468533ca90c6f77d734cda"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#abe785eacf0468533ca90c6f77d734cda">terminateJob</a> (const quint32 &amp;exitCode)</td></tr>
94 <tr class="memdesc:abe785eacf0468533ca90c6f77d734cda"><td class="mdescLeft">&#160;</td><td class="mdescRight">Terminate all sub-processes of the job object.  <a href="#abe785eacf0468533ca90c6f77d734cda">More...</a><br /></td></tr>
95 <tr class="separator:abe785eacf0468533ca90c6f77d734cda"><td class="memSeparator" colspan="2">&#160;</td></tr>
96 </table>
97 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
98 <div class="textblock"><p>This class represents a job object. </p>
99 <p>Call <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#a1ea821a376842494b0d0ef0b17bfaecc" title="Add a process to the job object. ">addProcessToJob()</a> to add another sub-process to this job object. Call <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#abe785eacf0468533ca90c6f77d734cda" title="Terminate all sub-processes of the job object. ">terminateJob()</a> to terminate all sub-processes that belong to this job object. Note that all sub-processes that belong to this job object will also be terminated when <em>this</em> process exits, gracefully or due to a crash.</p>
100 <p>Also, when the <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance is destroyed, all sub-process that belong to its corresponding job object and that are still running will be terminated! </p>
101 </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
102 <a id="a4ec8b0013bca35149def434b738d80fb"></a>
103 <h2 class="memtitle"><span class="permalink"><a href="#a4ec8b0013bca35149def434b738d80fb">&sect;&nbsp;</a></span>JobObject()</h2>
104
105 <div class="memitem">
106 <div class="memproto">
107       <table class="memname">
108         <tr>
109           <td class="memname">MUtils::JobObject::JobObject </td>
110           <td>(</td>
111           <td class="paramtype">void&#160;</td>
112           <td class="paramname"></td><td>)</td>
113           <td></td>
114         </tr>
115       </table>
116 </div><div class="memdoc">
117
118 <p>Create a new <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance. </p>
119 <p>Creating a new <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance automatically creates a new job object on the system-level. Check <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#a1d86b1a284da53bbcf92713d494c2304" title="Test whether job object was created successfully. ">isObjectCreated()</a> to test whether the job object was successfully created or not. </p>
120
121 </div>
122 </div>
123 <a id="a0e2d6461729d16b615548e7b1594c893"></a>
124 <h2 class="memtitle"><span class="permalink"><a href="#a0e2d6461729d16b615548e7b1594c893">&sect;&nbsp;</a></span>~JobObject()</h2>
125
126 <div class="memitem">
127 <div class="memproto">
128       <table class="memname">
129         <tr>
130           <td class="memname">MUtils::JobObject::~JobObject </td>
131           <td>(</td>
132           <td class="paramtype">void&#160;</td>
133           <td class="paramname"></td><td>)</td>
134           <td></td>
135         </tr>
136       </table>
137 </div><div class="memdoc">
138
139 <p>Destroys the <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance. </p>
140 <p>If the job object still has any running sub-processes left when the corresponding <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance is destroyed, these sub-process are terminated! </p>
141
142 </div>
143 </div>
144 <h2 class="groupheader">Member Function Documentation</h2>
145 <a id="a1ea821a376842494b0d0ef0b17bfaecc"></a>
146 <h2 class="memtitle"><span class="permalink"><a href="#a1ea821a376842494b0d0ef0b17bfaecc">&sect;&nbsp;</a></span>addProcessToJob()</h2>
147
148 <div class="memitem">
149 <div class="memproto">
150       <table class="memname">
151         <tr>
152           <td class="memname">bool MUtils::JobObject::addProcessToJob </td>
153           <td>(</td>
154           <td class="paramtype">const QProcess *const&#160;</td>
155           <td class="paramname"><em>process</em></td><td>)</td>
156           <td></td>
157         </tr>
158       </table>
159 </div><div class="memdoc">
160
161 <p>Add a process to the job object. </p>
162 <p>This function adds a another sub-process to the job object that is represented by this <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance. Job object limitations apply to the sub-process a</p>
163 <dl class="params"><dt>Parameters</dt><dd>
164   <table class="params">
165     <tr><td class="paramname">process</td><td>A read-only pointer to the <a href="http://doc.qt.io/qt-4.8/qprocess.html">QProcess</a> object that represents the sub-process to be added to the job object. The sub-process must be in the "running" state; otherwise the function will fail.</td></tr>
166   </table>
167   </dd>
168 </dl>
169 <dl class="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if and only if the process was successfully added to the job object; otherwise it returns <code>false</code>. </dd></dl>
170
171 </div>
172 </div>
173 <a id="a1d86b1a284da53bbcf92713d494c2304"></a>
174 <h2 class="memtitle"><span class="permalink"><a href="#a1d86b1a284da53bbcf92713d494c2304">&sect;&nbsp;</a></span>isObjectCreated()</h2>
175
176 <div class="memitem">
177 <div class="memproto">
178       <table class="memname">
179         <tr>
180           <td class="memname">bool MUtils::JobObject::isObjectCreated </td>
181           <td>(</td>
182           <td class="paramtype">void&#160;</td>
183           <td class="paramname"></td><td>)</td>
184           <td></td>
185         </tr>
186       </table>
187 </div><div class="memdoc">
188
189 <p>Test whether job object was created successfully. </p>
190 <p>The job object will be created automatically when a new <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance is created. However, the constructor has <b>no</b> to tell whether the job object was created successfully on the system-level. Call this function to test whether the job object has been created.</p>
191 <dl class="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if and only if a job object was successfully created; otherwise it returns <code>false</code>. </dd></dl>
192
193 </div>
194 </div>
195 <a id="abe785eacf0468533ca90c6f77d734cda"></a>
196 <h2 class="memtitle"><span class="permalink"><a href="#abe785eacf0468533ca90c6f77d734cda">&sect;&nbsp;</a></span>terminateJob()</h2>
197
198 <div class="memitem">
199 <div class="memproto">
200       <table class="memname">
201         <tr>
202           <td class="memname">bool MUtils::JobObject::terminateJob </td>
203           <td>(</td>
204           <td class="paramtype">const quint32 &amp;&#160;</td>
205           <td class="paramname"><em>exitCode</em></td><td>)</td>
206           <td></td>
207         </tr>
208       </table>
209 </div><div class="memdoc">
210
211 <p>Terminate all sub-processes of the job object. </p>
212 <p>This function immediately terminates <em>all</em> running sub-processes that belong to the job object represented by this <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance at once.</p>
213 <dl class="params"><dt>Parameters</dt><dd>
214   <table class="params">
215     <tr><td class="paramname">exitCode</td><td>The exit code to be set for the sub-process when they are terminated.</td></tr>
216   </table>
217   </dd>
218 </dl>
219 <dl class="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if the sub-processes were destroyed successfully, even if there were no running sub-process left; otherwise it returns <code>false</code>. </dd></dl>
220
221 </div>
222 </div>
223 <hr/>The documentation for this class was generated from the following file:<ul>
224 <li>include/MUtils/<a class="el" href="../../d4/d85/_job_object_8h_source.html">JobObject.h</a></li>
225 </ul>
226 </div><!-- contents -->
227 <!-- start footer part -->
228 <hr class="footer"/><address class="footer"><small>
229 Generated by &#160;<a href="http://www.doxygen.org/index.html">
230 <img class="footer" src="../../doxygen.png" alt="doxygen"/>
231 </a> 1.8.12
232 </small></address>
233 </body>
234 </html>