/usr/share/doc/libjuce/apiref/classChildProcessSlave.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 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | <!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: ChildProcessSlave 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="classChildProcessSlave-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">ChildProcessSlave Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>Acts as the slave end of a master/slave pair of connected processes.
<a href="classChildProcessSlave.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:a0466a587b20190e988b9b92e6f0c67d1"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessSlave.html#a0466a587b20190e988b9b92e6f0c67d1">ChildProcessSlave</a> ()</td></tr>
<tr class="memdesc:a0466a587b20190e988b9b92e6f0c67d1"><td class="mdescLeft"> </td><td class="mdescRight">Creates a non-connected slave process. <a href="#a0466a587b20190e988b9b92e6f0c67d1">More...</a><br /></td></tr>
<tr class="separator:a0466a587b20190e988b9b92e6f0c67d1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af486ef6acd3c06c1ce14d07f9a69da28"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessSlave.html#af486ef6acd3c06c1ce14d07f9a69da28">~ChildProcessSlave</a> ()</td></tr>
<tr class="memdesc:af486ef6acd3c06c1ce14d07f9a69da28"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#af486ef6acd3c06c1ce14d07f9a69da28">More...</a><br /></td></tr>
<tr class="separator:af486ef6acd3c06c1ce14d07f9a69da28"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7b61b9bcb42ea88efd2b09b44887ab0a"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessSlave.html#a7b61b9bcb42ea88efd2b09b44887ab0a">initialiseFromCommandLine</a> (const <a class="el" href="classString.html">String</a> &commandLine, const <a class="el" href="classString.html">String</a> &commandLineUniqueID, int timeoutMs=0)</td></tr>
<tr class="memdesc:a7b61b9bcb42ea88efd2b09b44887ab0a"><td class="mdescLeft"> </td><td class="mdescRight">This checks some command-line parameters to see whether they were generated by <a class="el" href="classChildProcessMaster.html#a1ff992de676f73bba4d9fd77ccbbbf90" title="Attempts to launch and connect to a slave process. ">ChildProcessMaster::launchSlaveProcess()</a>, and if so, connects to that master process. <a href="#a7b61b9bcb42ea88efd2b09b44887ab0a">More...</a><br /></td></tr>
<tr class="separator:a7b61b9bcb42ea88efd2b09b44887ab0a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad75b9b600fa0877fc60c3013810b4713"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessSlave.html#ad75b9b600fa0877fc60c3013810b4713">handleMessageFromMaster</a> (const <a class="el" href="classMemoryBlock.html">MemoryBlock</a> &)=0</td></tr>
<tr class="memdesc:ad75b9b600fa0877fc60c3013810b4713"><td class="mdescLeft"> </td><td class="mdescRight">This will be called to deliver messages from the master process. <a href="#ad75b9b600fa0877fc60c3013810b4713">More...</a><br /></td></tr>
<tr class="separator:ad75b9b600fa0877fc60c3013810b4713"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac01ed2cf340bf508b29c1fe9ec13dcb6"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessSlave.html#ac01ed2cf340bf508b29c1fe9ec13dcb6">handleConnectionMade</a> ()</td></tr>
<tr class="memdesc:ac01ed2cf340bf508b29c1fe9ec13dcb6"><td class="mdescLeft"> </td><td class="mdescRight">This will be called when the master process finishes connecting to this slave. <a href="#ac01ed2cf340bf508b29c1fe9ec13dcb6">More...</a><br /></td></tr>
<tr class="separator:ac01ed2cf340bf508b29c1fe9ec13dcb6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a664405f8c42ecbce6c58b50252359ed1"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessSlave.html#a664405f8c42ecbce6c58b50252359ed1">handleConnectionLost</a> ()</td></tr>
<tr class="memdesc:a664405f8c42ecbce6c58b50252359ed1"><td class="mdescLeft"> </td><td class="mdescRight">This will be called when the connection to the master process is lost. <a href="#a664405f8c42ecbce6c58b50252359ed1">More...</a><br /></td></tr>
<tr class="separator:a664405f8c42ecbce6c58b50252359ed1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab619cb3d7beddef480385b7f8ffaf699"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classChildProcessSlave.html#ab619cb3d7beddef480385b7f8ffaf699">sendMessageToMaster</a> (const <a class="el" href="classMemoryBlock.html">MemoryBlock</a> &)</td></tr>
<tr class="memdesc:ab619cb3d7beddef480385b7f8ffaf699"><td class="mdescLeft"> </td><td class="mdescRight">Tries to send a message to the master process. <a href="#ab619cb3d7beddef480385b7f8ffaf699">More...</a><br /></td></tr>
<tr class="separator:ab619cb3d7beddef480385b7f8ffaf699"><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 slave end of 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>. To instantiate the <a class="el" href="classChildProcessSlave.html" title="Acts as the slave end of a master/slave pair of connected processes. ">ChildProcessSlave</a> object, you must add some code to your main() or <a class="el" href="classJUCEApplicationBase.html#ad584bed05116674a1e68f60a1ac546f5" title="Called when the application starts. ">JUCEApplication::initialise()</a> function that calls the <a class="el" href="classChildProcessSlave.html#a7b61b9bcb42ea88efd2b09b44887ab0a" title="This checks some command-line parameters to see whether they were generated by ChildProcessMaster::la...">initialiseFromCommandLine()</a> method to check the app's command-line parameters to see whether it's being launched as a child process. If this returns true then the slave process can be allowed to run, and its <a class="el" href="classChildProcessSlave.html#ad75b9b600fa0877fc60c3013810b4713" title="This will be called to deliver messages from the master process. ">handleMessageFromMaster()</a> method will be called whenever a message arrives.</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="classChildProcessMaster.html" title="Acts as the master in a master/slave pair of connected processes. ">ChildProcessMaster</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="a0466a587b20190e988b9b92e6f0c67d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0466a587b20190e988b9b92e6f0c67d1">§ </a></span>ChildProcessSlave()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ChildProcessSlave::ChildProcessSlave </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a non-connected slave process. </p>
<p>Use initialiseFromCommandLine to connect to a master process. </p>
</div>
</div>
<a id="af486ef6acd3c06c1ce14d07f9a69da28"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af486ef6acd3c06c1ce14d07f9a69da28">§ </a></span>~ChildProcessSlave()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual ChildProcessSlave::~ChildProcessSlave </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="a7b61b9bcb42ea88efd2b09b44887ab0a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7b61b9bcb42ea88efd2b09b44887ab0a">§ </a></span>initialiseFromCommandLine()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool ChildProcessSlave::initialiseFromCommandLine </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>commandLine</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></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This checks some command-line parameters to see whether they were generated by <a class="el" href="classChildProcessMaster.html#a1ff992de676f73bba4d9fd77ccbbbf90" title="Attempts to launch and connect to a slave process. ">ChildProcessMaster::launchSlaveProcess()</a>, and if so, connects to that master process. </p>
<p>In an exe that can be used as a child process, you should add some code to your main() or <a class="el" href="classJUCEApplicationBase.html#ad584bed05116674a1e68f60a1ac546f5" title="Called when the application starts. ">JUCEApplication::initialise()</a> that calls this method.</p>
<p>The commandLineUniqueID should be a short alphanumeric identifier (no spaces!) that matches the string passed to <a class="el" href="classChildProcessMaster.html#a1ff992de676f73bba4d9fd77ccbbbf90" title="Attempts to launch and connect to a slave process. ">ChildProcessMaster::launchSlaveProcess()</a>.</p>
<p>The timeoutMs parameter lets you specify how long the child process is allowed to run without receiving a ping from the master before the master is considered to have died, and <a class="el" href="classChildProcessSlave.html#a664405f8c42ecbce6c58b50252359ed1" title="This will be called when the connection to the master process is lost. ">handleConnectionLost()</a> will be called. Passing <= 0 for this timeout makes it use a default value.</p>
<p>Returns true if the command-line matches and the connection is made successfully. </p>
</div>
</div>
<a id="ad75b9b600fa0877fc60c3013810b4713"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad75b9b600fa0877fc60c3013810b4713">§ </a></span>handleMessageFromMaster()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void ChildProcessSlave::handleMessageFromMaster </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 messages from the master process. </p>
<p>The call will probably be made on a background thread, so be careful with your thread-safety! You may want to respond by sending back a message with <a class="el" href="classChildProcessSlave.html#ab619cb3d7beddef480385b7f8ffaf699" title="Tries to send a message to the master process. ">sendMessageToMaster()</a> </p>
</div>
</div>
<a id="ac01ed2cf340bf508b29c1fe9ec13dcb6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac01ed2cf340bf508b29c1fe9ec13dcb6">§ </a></span>handleConnectionMade()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void ChildProcessSlave::handleConnectionMade </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 master process finishes connecting to this slave. </p>
<p>The call will probably be made on a background thread, so be careful with your thread-safety! </p>
</div>
</div>
<a id="a664405f8c42ecbce6c58b50252359ed1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a664405f8c42ecbce6c58b50252359ed1">§ </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 ChildProcessSlave::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 connection to the master process is lost. </p>
<p>The call may be made from any thread (including the message thread). Typically, if your process only exists to act as a slave, you should probably exit when this happens. </p>
</div>
</div>
<a id="ab619cb3d7beddef480385b7f8ffaf699"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab619cb3d7beddef480385b7f8ffaf699">§ </a></span>sendMessageToMaster()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool ChildProcessSlave::sendMessageToMaster </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>Tries to send a message to the master process. </p>
<p>This returns true if the message was sent, 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="classChildProcessMaster.html#a5edab8b373fc85da57a6367c797cc3a7" title="This will be called to deliver a message from the slave process. ">ChildProcessMaster::handleMessageFromSlave()</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>
|