/usr/share/doc/libjuce/apiref/classChildProcessMaster.html is in libjuce-doc 4.3.0~repack-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | <!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>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JUCE: ChildProcessMaster Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">JUCE
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classChildProcessMaster-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">ChildProcessMaster Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>Acts as the master in a master/slave pair of connected processes.
<a href="classChildProcessMaster.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2ac2f078c51af01a6a2b09e39cae0d61"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessMaster.html#a2ac2f078c51af01a6a2b09e39cae0d61">ChildProcessMaster</a> ()</td></tr>
<tr class="memdesc:a2ac2f078c51af01a6a2b09e39cae0d61"><td class="mdescLeft"> </td><td class="mdescRight">Creates an uninitialised master process object. <a href="#a2ac2f078c51af01a6a2b09e39cae0d61">More...</a><br /></td></tr>
<tr class="separator:a2ac2f078c51af01a6a2b09e39cae0d61"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab140f15a3cbabd52a9be0a38a217ff2b"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessMaster.html#ab140f15a3cbabd52a9be0a38a217ff2b">~ChildProcessMaster</a> ()</td></tr>
<tr class="memdesc:ab140f15a3cbabd52a9be0a38a217ff2b"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#ab140f15a3cbabd52a9be0a38a217ff2b">More...</a><br /></td></tr>
<tr class="separator:ab140f15a3cbabd52a9be0a38a217ff2b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1ff992de676f73bba4d9fd77ccbbbf90"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessMaster.html#a1ff992de676f73bba4d9fd77ccbbbf90">launchSlaveProcess</a> (const <a class="el" href="classFile.html">File</a> &executableToLaunch, const <a class="el" href="classString.html">String</a> &commandLineUniqueID, int timeoutMs=0, int streamFlags=<a class="el" href="classChildProcess.html#a9e7be158550b4d2a470e4cceef501892abb52a8d118b221d35bc924efb9f48573">ChildProcess::wantStdOut</a>|<a class="el" href="classChildProcess.html#a9e7be158550b4d2a470e4cceef501892a99e96160b71df9cd65473f410ac7090e">ChildProcess::wantStdErr</a>)</td></tr>
<tr class="memdesc:a1ff992de676f73bba4d9fd77ccbbbf90"><td class="mdescLeft"> </td><td class="mdescRight">Attempts to launch and connect to a slave process. <a href="#a1ff992de676f73bba4d9fd77ccbbbf90">More...</a><br /></td></tr>
<tr class="separator:a1ff992de676f73bba4d9fd77ccbbbf90"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5edab8b373fc85da57a6367c797cc3a7"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessMaster.html#a5edab8b373fc85da57a6367c797cc3a7">handleMessageFromSlave</a> (const <a class="el" href="classMemoryBlock.html">MemoryBlock</a> &)=0</td></tr>
<tr class="memdesc:a5edab8b373fc85da57a6367c797cc3a7"><td class="mdescLeft"> </td><td class="mdescRight">This will be called to deliver a message from the slave process. <a href="#a5edab8b373fc85da57a6367c797cc3a7">More...</a><br /></td></tr>
<tr class="separator:a5edab8b373fc85da57a6367c797cc3a7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2511b4e4427f66fb83a0023b5157bb2d"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessMaster.html#a2511b4e4427f66fb83a0023b5157bb2d">handleConnectionLost</a> ()</td></tr>
<tr class="memdesc:a2511b4e4427f66fb83a0023b5157bb2d"><td class="mdescLeft"> </td><td class="mdescRight">This will be called when the slave process dies or is somehow disconnected. <a href="#a2511b4e4427f66fb83a0023b5157bb2d">More...</a><br /></td></tr>
<tr class="separator:a2511b4e4427f66fb83a0023b5157bb2d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad2b119d572bed6ef2ddee2f46fb1220d"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessMaster.html#ad2b119d572bed6ef2ddee2f46fb1220d">sendMessageToSlave</a> (const <a class="el" href="classMemoryBlock.html">MemoryBlock</a> &)</td></tr>
<tr class="memdesc:ad2b119d572bed6ef2ddee2f46fb1220d"><td class="mdescLeft"> </td><td class="mdescRight">Attempts to send a message to the slave process. <a href="#ad2b119d572bed6ef2ddee2f46fb1220d">More...</a><br /></td></tr>
<tr class="separator:ad2b119d572bed6ef2ddee2f46fb1220d"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Acts as the master in a master/slave pair of connected processes. </p>
<p>The <a class="el" href="classChildProcessSlave.html" title="Acts as the slave end of a master/slave pair of connected processes. ">ChildProcessSlave</a> and <a class="el" href="classChildProcessMaster.html" title="Acts as the master in a master/slave pair of connected processes. ">ChildProcessMaster</a> classes make it easy for an app to spawn a child process, and to manage a 2-way messaging connection to control it.</p>
<p>To use the system, you need to create subclasses of both <a class="el" href="classChildProcessSlave.html" title="Acts as the slave end of a master/slave pair of connected processes. ">ChildProcessSlave</a> and <a class="el" href="classChildProcessMaster.html" title="Acts as the master in a master/slave pair of connected processes. ">ChildProcessMaster</a>. When you want your master process to launch the slave, you just call <a class="el" href="classChildProcessMaster.html#a1ff992de676f73bba4d9fd77ccbbbf90" title="Attempts to launch and connect to a slave process. ">launchSlaveProcess()</a>, and it'll attempt to launch the executable that you specify (which may be the same exe), and assuming it has been set-up to correctly parse the command-line parameters (see <a class="el" href="classChildProcessSlave.html" title="Acts as the slave end of a master/slave pair of connected processes. ">ChildProcessSlave</a>) then a two-way connection will be created.</p>
<p>The juce demo app has a good example of this class in action.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classChildProcessSlave.html" title="Acts as the slave end of a master/slave pair of connected processes. ">ChildProcessSlave</a>, <a class="el" href="classInterprocessConnection.html" title="Manages a simple two-way messaging connection to another process, using either a socket or a named pi...">InterprocessConnection</a>, <a class="el" href="classChildProcess.html" title="Launches and monitors a child process. ">ChildProcess</a> </dd></dl>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="a2ac2f078c51af01a6a2b09e39cae0d61"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ac2f078c51af01a6a2b09e39cae0d61">§ </a></span>ChildProcessMaster()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ChildProcessMaster::ChildProcessMaster </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates an uninitialised master process object. </p>
<p>Use launchSlaveProcess to launch and connect to a child process. </p>
</div>
</div>
<a id="ab140f15a3cbabd52a9be0a38a217ff2b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab140f15a3cbabd52a9be0a38a217ff2b">§ </a></span>~ChildProcessMaster()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual ChildProcessMaster::~ChildProcessMaster </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a1ff992de676f73bba4d9fd77ccbbbf90"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ff992de676f73bba4d9fd77ccbbbf90">§ </a></span>launchSlaveProcess()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool ChildProcessMaster::launchSlaveProcess </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classFile.html">File</a> & </td>
<td class="paramname"><em>executableToLaunch</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>commandLineUniqueID</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>timeoutMs</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>streamFlags</em> = <code><a class="el" href="classChildProcess.html#a9e7be158550b4d2a470e4cceef501892abb52a8d118b221d35bc924efb9f48573">ChildProcess::wantStdOut</a>|<a class="el" href="classChildProcess.html#a9e7be158550b4d2a470e4cceef501892a99e96160b71df9cd65473f410ac7090e">ChildProcess::wantStdErr</a></code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Attempts to launch and connect to a slave process. </p>
<p>This will start the given executable, passing it a special command-line parameter based around the commandLineUniqueID string, which must be a short alphanumeric string (no spaces!) that identifies your app. The exe that gets launched must respond by calling <a class="el" href="classChildProcessSlave.html#a7b61b9bcb42ea88efd2b09b44887ab0a" title="This checks some command-line parameters to see whether they were generated by ChildProcessMaster::la...">ChildProcessSlave::initialiseFromCommandLine()</a> in its startup code, and must use a matching ID to commandLineUniqueID.</p>
<p>The timeoutMs parameter lets you specify how long the child process is allowed to go without sending a ping before it is considered to have died and <a class="el" href="classChildProcessMaster.html#a2511b4e4427f66fb83a0023b5157bb2d" title="This will be called when the slave process dies or is somehow disconnected. ">handleConnectionLost()</a> will be called. Passing <= 0 for this timeout makes it use a default value.</p>
<p>If this all works, the method returns true, and you can begin sending and receiving messages with the slave process. </p>
</div>
</div>
<a id="a5edab8b373fc85da57a6367c797cc3a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5edab8b373fc85da57a6367c797cc3a7">§ </a></span>handleMessageFromSlave()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void ChildProcessMaster::handleMessageFromSlave </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classMemoryBlock.html">MemoryBlock</a> & </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This will be called to deliver a message from the slave process. </p>
<p>The call will probably be made on a background thread, so be careful with your thread-safety! </p>
</div>
</div>
<a id="a2511b4e4427f66fb83a0023b5157bb2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2511b4e4427f66fb83a0023b5157bb2d">§ </a></span>handleConnectionLost()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void ChildProcessMaster::handleConnectionLost </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This will be called when the slave process dies or is somehow disconnected. </p>
<p>The call will probably be made on a background thread, so be careful with your thread-safety! </p>
</div>
</div>
<a id="ad2b119d572bed6ef2ddee2f46fb1220d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad2b119d572bed6ef2ddee2f46fb1220d">§ </a></span>sendMessageToSlave()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool ChildProcessMaster::sendMessageToSlave </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classMemoryBlock.html">MemoryBlock</a> & </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Attempts to send a message to the slave process. </p>
<p>This returns true if the message was dispatched, but doesn't check that it actually gets delivered at the other end. If successful, the data will emerge in a call to your <a class="el" href="classChildProcessSlave.html#ad75b9b600fa0877fc60c3013810b4713" title="This will be called to deliver messages from the master process. ">ChildProcessSlave::handleMessageFromMaster()</a>. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="juce__ConnectedChildProcess_8h.html">juce_ConnectedChildProcess.h</a></li>
</ul>
</div><!-- contents -->
<hr class="footer"/>
<address class="footer"><small>All content © ROLI Ltd.</small></address><br/>
</body>
</html>
|