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">
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
'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" />
18 <div id=
"top"><!-- do not remove this div, it is closed by doxygen! -->
20 <table cellspacing=
"0" cellpadding=
"0">
22 <tr style=
"height: 56px;">
23 <td id=
"projectalign" style=
"padding-left: 0.5em;">
24 <div id=
"projectname">MuldeR
's Utilities for Qt
26 <div id=
"projectbrief">MUtilities
</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');
37 <script type=
"text/javascript" src=
"../../menudata.js"></script>
38 <script type=
"text/javascript" src=
"../../menu.js"></script>
39 <script type=
"text/javascript">
41 initMenu('../../',true,false,'search.php','Search');
42 $(document
).ready(function() { init_search(); });
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)">
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">
60 <div id=
"nav-path" class=
"navpath">
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>
67 <a href=
"#pub-methods">Public Member Functions
</a> |
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>
72 <div class=
"contents">
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>
77 <p><code>#include
<<a class=
"el" href=
"../../d4/d85/_job_object_8h_source.html">JobObject.h
</a>></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"> </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"> </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"> </td></tr>
84 <tr class=
"memitem:a0e2d6461729d16b615548e7b1594c893"><td class=
"memItemLeft" align=
"right" valign=
"top"> </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"> </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"> </td></tr>
87 <tr class=
"memitem:a1d86b1a284da53bbcf92713d494c2304"><td class=
"memItemLeft" align=
"right" valign=
"top">bool
 </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"> </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"> </td></tr>
90 <tr class=
"memitem:a1ea821a376842494b0d0ef0b17bfaecc"><td class=
"memItemLeft" align=
"right" valign=
"top">bool
 </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"> </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"> </td></tr>
93 <tr class=
"memitem:abe785eacf0468533ca90c6f77d734cda"><td class=
"memItemLeft" align=
"right" valign=
"top">bool
 </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
&exitCode)
</td></tr>
94 <tr class=
"memdesc:abe785eacf0468533ca90c6f77d734cda"><td class=
"mdescLeft"> </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"> </td></tr>
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
& Destructor Documentation
</h2>
102 <a id=
"a4ec8b0013bca35149def434b738d80fb"></a>
103 <h2 class=
"memtitle"><span class=
"permalink"><a href=
"#a4ec8b0013bca35149def434b738d80fb">§ </a></span>JobObject()
</h2>
105 <div class=
"memitem">
106 <div class=
"memproto">
107 <table class=
"memname">
109 <td class=
"memname">MUtils::JobObject::JobObject
</td>
111 <td class=
"paramtype">void
 </td>
112 <td class=
"paramname"></td><td>)
</td>
116 </div><div class=
"memdoc">
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>
123 <a id=
"a0e2d6461729d16b615548e7b1594c893"></a>
124 <h2 class=
"memtitle"><span class=
"permalink"><a href=
"#a0e2d6461729d16b615548e7b1594c893">§ </a></span>~JobObject()
</h2>
126 <div class=
"memitem">
127 <div class=
"memproto">
128 <table class=
"memname">
130 <td class=
"memname">MUtils::JobObject::~JobObject
</td>
132 <td class=
"paramtype">void
 </td>
133 <td class=
"paramname"></td><td>)
</td>
137 </div><div class=
"memdoc">
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>
144 <h2 class=
"groupheader">Member Function Documentation
</h2>
145 <a id=
"a1ea821a376842494b0d0ef0b17bfaecc"></a>
146 <h2 class=
"memtitle"><span class=
"permalink"><a href=
"#a1ea821a376842494b0d0ef0b17bfaecc">§ </a></span>addProcessToJob()
</h2>
148 <div class=
"memitem">
149 <div class=
"memproto">
150 <table class=
"memname">
152 <td class=
"memname">bool MUtils::JobObject::addProcessToJob
</td>
154 <td class=
"paramtype">const QProcess *const
 </td>
155 <td class=
"paramname"><em>process
</em></td><td>)
</td>
159 </div><div class=
"memdoc">
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>
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>
173 <a id=
"a1d86b1a284da53bbcf92713d494c2304"></a>
174 <h2 class=
"memtitle"><span class=
"permalink"><a href=
"#a1d86b1a284da53bbcf92713d494c2304">§ </a></span>isObjectCreated()
</h2>
176 <div class=
"memitem">
177 <div class=
"memproto">
178 <table class=
"memname">
180 <td class=
"memname">bool MUtils::JobObject::isObjectCreated
</td>
182 <td class=
"paramtype">void
 </td>
183 <td class=
"paramname"></td><td>)
</td>
187 </div><div class=
"memdoc">
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>
195 <a id=
"abe785eacf0468533ca90c6f77d734cda"></a>
196 <h2 class=
"memtitle"><span class=
"permalink"><a href=
"#abe785eacf0468533ca90c6f77d734cda">§ </a></span>terminateJob()
</h2>
198 <div class=
"memitem">
199 <div class=
"memproto">
200 <table class=
"memname">
202 <td class=
"memname">bool MUtils::JobObject::terminateJob
</td>
204 <td class=
"paramtype">const quint32
& </td>
205 <td class=
"paramname"><em>exitCode
</em></td><td>)
</td>
209 </div><div class=
"memdoc">
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>
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>
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>
226 </div><!-- contents -->
227 <!-- start footer part -->
228 <hr class=
"footer"/><address class=
"footer"><small>
229 Generated by
 <a href=
"http://www.doxygen.org/index.html">
230 <img class=
"footer" src=
"../../doxygen.png" alt=
"doxygen"/>