http://git-wip-us.apache.org/repos/asf/mesos-site/blob/72fbb09d/content/api/latest/c++/libprocess_2include_2process_2process_8hpp_source.html
----------------------------------------------------------------------
diff --git 
a/content/api/latest/c++/libprocess_2include_2process_2process_8hpp_source.html 
b/content/api/latest/c++/libprocess_2include_2process_2process_8hpp_source.html
index 660fa88..237e902 100644
--- 
a/content/api/latest/c++/libprocess_2include_2process_2process_8hpp_source.html
+++ 
b/content/api/latest/c++/libprocess_2include_2process_2process_8hpp_source.html
@@ -52,7 +52,7 @@
 <div class="title">process.hpp</div>  </div>
 </div><!--header-->
 <div class="contents">
-<a href="libprocess_2include_2process_2process_8hpp.html">Go to the 
documentation of this file.</a><div class="fragment"><div class="line"><a 
name="l00001"></a><span class="lineno">    1</span>&#160;<span 
class="comment">// Licensed under the Apache License, Version 2.0 (the 
&quot;License&quot;);</span></div><div class="line"><a name="l00002"></a><span 
class="lineno">    2</span>&#160;<span class="comment">// you may not use this 
file except in compliance with the License.</span></div><div class="line"><a 
name="l00003"></a><span class="lineno">    3</span>&#160;<span 
class="comment">// You may obtain a copy of the License at</span></div><div 
class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span 
class="comment">//</span></div><div class="line"><a name="l00005"></a><span 
class="lineno">    5</span>&#160;<span class="comment">//     
http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a 
name="l00006"></a><span class="lineno">    6</span>&#1
 60;<span class="comment">//</span></div><div class="line"><a 
name="l00007"></a><span class="lineno">    7</span>&#160;<span 
class="comment">// Unless required by applicable law or agreed to in writing, 
software</span></div><div class="line"><a name="l00008"></a><span 
class="lineno">    8</span>&#160;<span class="comment">// distributed under the 
License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div 
class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span 
class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 
or implied.</span></div><div class="line"><a name="l00010"></a><span 
class="lineno">   10</span>&#160;<span class="comment">// See the License for 
the specific language governing permissions and</span></div><div 
class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span 
class="comment">// limitations under the License</span></div><div 
class="line"><a name="l00012"></a><span class="lineno">   12</
 span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno">  
 13</span>&#160;<span class="preprocessor">#ifndef 
__PROCESS_PROCESS_HPP__</span></div><div class="line"><a 
name="l00014"></a><span class="lineno">   14</span>&#160;<span 
class="preprocessor">#define __PROCESS_PROCESS_HPP__</span></div><div 
class="line"><a name="l00015"></a><span class="lineno">   
15</span>&#160;</div><div class="line"><a name="l00016"></a><span 
class="lineno">   16</span>&#160;<span class="preprocessor">#include 
&lt;stdint.h&gt;</span></div><div class="line"><a name="l00017"></a><span 
class="lineno">   17</span>&#160;</div><div class="line"><a 
name="l00018"></a><span class="lineno">   18</span>&#160;<span 
class="preprocessor">#include &lt;memory&gt;</span></div><div class="line"><a 
name="l00019"></a><span class="lineno">   19</span>&#160;<span 
class="preprocessor">#include &lt;map&gt;</span></div><div class="line"><a 
name="l00020"></a><span class="lineno">   20</span>&#160;<span class="p
 reprocessor">#include &lt;queue&gt;</span></div><div class="line"><a 
name="l00021"></a><span class="lineno">   21</span>&#160;<span 
class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a 
name="l00022"></a><span class="lineno">   22</span>&#160;</div><div 
class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="address_8hpp.html">process/address.hpp</a>&gt;</span></div><div 
class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="3rdparty_2libprocess_2include_2process_2authenticator_8hpp.html">process/authenticator.hpp</a>&gt;</span></div><div
 class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="clock_8hpp.html">process/clock.hpp</a>&gt;</span></div><div 
class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<
 span class="preprocessor">#include &lt;<a class="code" 
href="event_8hpp.html">process/event.hpp</a>&gt;</span></div><div 
class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="3rdparty_2libprocess_2include_2process_2filter_8hpp.html">process/filter.hpp</a>&gt;</span></div><div
 class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="firewall_8hpp.html">process/firewall.hpp</a>&gt;</span></div><div 
class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="3rdparty_2libprocess_2include_2process_2http_8hpp.html">process/http.hpp</a>&gt;</span></div><div
 class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="3rdparty_2libprocess_2include_2process_2message_8hpp.html">process/mes
 sage.hpp</a>&gt;</span></div><div class="line"><a name="l00031"></a><span 
class="lineno">   31</span>&#160;<span class="preprocessor">#include &lt;<a 
class="code" href="mime_8hpp.html">process/mime.hpp</a>&gt;</span></div><div 
class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="owned_8hpp.html">process/owned.hpp</a>&gt;</span></div><div 
class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="3rdparty_2libprocess_2include_2process_2pid_8hpp.html">process/pid.hpp</a>&gt;</span></div><div
 class="line"><a name="l00034"></a><span class="lineno">   
34</span>&#160;</div><div class="line"><a name="l00035"></a><span 
class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;<a 
class="code" 
href="duration_8hpp.html">stout/duration.hpp</a>&gt;</span></div><div 
class="line"><a name="l00036"></a><span class="lineno">   36<
 /span>&#160;<span class="preprocessor">#include &lt;<a class="code" 
href="hashmap_8hpp.html">stout/hashmap.hpp</a>&gt;</span></div><div 
class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="lambda_8hpp.html">stout/lambda.hpp</a>&gt;</span></div><div 
class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="option_8hpp.html">stout/option.hpp</a>&gt;</span></div><div 
class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="synchronized_8hpp.html">stout/synchronized.hpp</a>&gt;</span></div><div 
class="line"><a name="l00040"></a><span class="lineno">   
40</span>&#160;</div><div class="line"><a name="l00041"></a><span 
class="lineno">   41</span>&#160;<span class="keyword">namespace </span><a 
class="code" href="namespaceprocess.html">process</a> {</div><div
  class="line"><a name="l00042"></a><span class="lineno">   
42</span>&#160;</div><div class="line"><a name="l00043"></a><span 
class="lineno">   43</span>&#160;<span class="comment">// Forward 
declaration.</span></div><div class="line"><a name="l00044"></a><span 
class="lineno">   44</span>&#160;<span class="keyword">class 
</span>EventQueue;</div><div class="line"><a name="l00045"></a><span 
class="lineno">   45</span>&#160;<span class="keyword">class 
</span>Gate;</div><div class="line"><a name="l00046"></a><span class="lineno">  
 46</span>&#160;<span class="keyword">class </span>Logging;</div><div 
class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span 
class="keyword">class </span>Sequence;</div><div class="line"><a 
name="l00048"></a><span class="lineno">   48</span>&#160;</div><div 
class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span 
class="keyword">namespace </span>firewall {</div><div class="line"><a 
name="l00050"></a><span class="lin
 eno">   50</span>&#160;</div><div class="line"><a name="l00068"></a><span 
class="lineno">   68</span>&#160;<span class="keywordtype">void</span> <a 
class="code" 
href="namespaceprocess_1_1firewall.html#a99a70c4d8e775bb1692693ec278d0877">install</a>(std::vector&lt;Owned&lt;FirewallRule&gt;&gt;&amp;&amp;
 rules);</div><div class="line"><a name="l00069"></a><span class="lineno">   
69</span>&#160;</div><div class="line"><a name="l00070"></a><span 
class="lineno">   70</span>&#160;} <span class="comment">// namespace firewall 
{</span></div><div class="line"><a name="l00071"></a><span class="lineno">   
71</span>&#160;</div><div class="line"><a name="l00072"></a><span 
class="lineno"><a class="line" href="classprocess_1_1ProcessBase.html">   
72</a></span>&#160;<span class="keyword">class </span><a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a> : <span 
class="keyword">public</span> <a class="code" 
href="structprocess_1_1EventConsumer.html">EventConsumer</a></div><div class
 ="line"><a name="l00073"></a><span class="lineno">   
73</span>&#160;{</div><div class="line"><a name="l00074"></a><span 
class="lineno">   74</span>&#160;<span class="keyword">public</span>:</div><div 
class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  
<span class="keyword">explicit</span> <a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>(<span 
class="keyword">const</span> std::string&amp; <span 
class="keywordtype">id</span> = <span 
class="stringliteral">&quot;&quot;</span>);</div><div class="line"><a 
name="l00076"></a><span class="lineno">   76</span>&#160;</div><div 
class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  
<span class="keyword">virtual</span> ~<a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>();</div><div 
class="line"><a name="l00078"></a><span class="lineno">   
78</span>&#160;</div><div class="line"><a name="l00079"></a><span 
class="lineno"><a class="line" href="classprocess_1_1Pro
 cessBase.html#a7ff87364baa79991901b8d73dc5c5fca">   79</a></span>&#160;  <span 
class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; <span 
class="keyword">self</span>() <span class="keyword">const</span> { <span 
class="keywordflow">return</span> pid; }</div><div class="line"><a 
name="l00080"></a><span class="lineno">   80</span>&#160;</div><div 
class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span 
class="keyword">protected</span>:</div><div class="line"><a 
name="l00085"></a><span class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a2accda04cb99a8337c501958ff85ce01">   
85</a></span>&#160;  <span class="keyword">virtual</span> <span 
class="keywordtype">void</span> <a class="code" 
href="classprocess_1_1ProcessBase.html#a2accda04cb99a8337c501958ff85ce01">serve</a>(<a
 class="code" href="structprocess_1_1Event.html">Event</a>&amp;&amp; 
event)</div><div class="line"><a name="l00086"></a><span class="lineno"> 
   86</span>&#160;  {</div><div class="line"><a name="l00087"></a><span 
class="lineno">   87</span>&#160;    std::move(event).consume(<span 
class="keyword">this</span>);</div><div class="line"><a name="l00088"></a><span 
class="lineno">   88</span>&#160;  }</div><div class="line"><a 
name="l00089"></a><span class="lineno">   89</span>&#160;</div><div 
class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  
<span class="comment">// Callbacks used to consume (i.e., handle) a specific 
event.</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 
  91</span>&#160;  <span class="keywordtype">void</span> consume(<a 
class="code" 
href="structprocess_1_1MessageEvent.html">MessageEvent</a>&amp;&amp; event) 
<span class="keyword">override</span>;</div><div class="line"><a 
name="l00092"></a><span class="lineno">   92</span>&#160;  <span 
class="keywordtype">void</span> consume(<a class="code" 
href="structprocess_1_1DispatchEvent.html">DispatchEvent</a>&amp;&amp; e
 vent) <span class="keyword">override</span>;</div><div class="line"><a 
name="l00093"></a><span class="lineno">   93</span>&#160;  <span 
class="keywordtype">void</span> consume(<a class="code" 
href="structprocess_1_1HttpEvent.html">HttpEvent</a>&amp;&amp; event) <span 
class="keyword">override</span>;</div><div class="line"><a 
name="l00094"></a><span class="lineno">   94</span>&#160;  <span 
class="keywordtype">void</span> consume(<a class="code" 
href="structprocess_1_1ExitedEvent.html">ExitedEvent</a>&amp;&amp; event) <span 
class="keyword">override</span>;</div><div class="line"><a 
name="l00095"></a><span class="lineno">   95</span>&#160;  <span 
class="keywordtype">void</span> consume(<a class="code" 
href="structprocess_1_1TerminateEvent.html">TerminateEvent</a>&amp;&amp; event) 
<span class="keyword">override</span>;</div><div class="line"><a 
name="l00096"></a><span class="lineno">   96</span>&#160;</div><div 
class="line"><a name="l00100"></a><span class="lineno"><a class="line" href=
 "classprocess_1_1ProcessBase.html#a6baf49d6234eb638d068a98514e4ae3f">  
100</a></span>&#160;  <span class="keyword">virtual</span> <span 
class="keywordtype">void</span> <a class="code" 
href="classprocess_1_1ProcessBase.html#a6baf49d6234eb638d068a98514e4ae3f">initialize</a>()
 {}</div><div class="line"><a name="l00101"></a><span class="lineno">  
101</span>&#160;</div><div class="line"><a name="l00108"></a><span 
class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a07ac3fd4eededbb6015c305e12411b98">  
108</a></span>&#160;  <span class="keyword">virtual</span> <span 
class="keywordtype">void</span> <a class="code" 
href="classprocess_1_1ProcessBase.html#a07ac3fd4eededbb6015c305e12411b98">finalize</a>()
 {}</div><div class="line"><a name="l00109"></a><span class="lineno">  
109</span>&#160;</div><div class="line"><a name="l00124"></a><span 
class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a0a0053b515e25f366a29a6897467bebc">  
124</a></span>&#160;  <span clas
 s="keyword">virtual</span> <span class="keywordtype">void</span> <a 
class="code" 
href="classprocess_1_1ProcessBase.html#a0a0053b515e25f366a29a6897467bebc">exited</a>(<span
 class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp;) {}</div><div class="line"><a 
name="l00125"></a><span class="lineno">  125</span>&#160;</div><div 
class="line"><a name="l00133"></a><span class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a38a4b602aa7e2656a647323da1bacf50">  
133</a></span>&#160;  <span class="keyword">virtual</span> <span 
class="keywordtype">void</span> <a class="code" 
href="classprocess_1_1ProcessBase.html#a38a4b602aa7e2656a647323da1bacf50">lost</a>(<span
 class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp;) {}</div><div class="line"><a 
name="l00134"></a><span class="lineno">  134</span>&#160;</div><div 
class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;  
<span class="keywor
 dtype">void</span> <a class="code" 
href="namespacenet.html#a69f77aa4677f1dd1c69169589b30a31b">send</a>(</div><div 
class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;      
<span class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; to,</div><div class="line"><a 
name="l00143"></a><span class="lineno">  143</span>&#160;      <span 
class="keyword">const</span> std::string&amp; <a class="code" 
href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">name</a>,</div><div
 class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;      
<span class="keyword">const</span> <span class="keywordtype">char</span>* data 
= <span class="keyword">nullptr</span>,</div><div class="line"><a 
name="l00145"></a><span class="lineno">  145</span>&#160;      <span 
class="keywordtype">size_t</span> length = 0);</div><div class="line"><a 
name="l00146"></a><span class="lineno">  146</span>&#160;</div><div 
class="line"><a name="l
 00147"></a><span class="lineno">  147</span>&#160;  <span 
class="keywordtype">void</span> <a class="code" 
href="namespacenet.html#a69f77aa4677f1dd1c69169589b30a31b">send</a>(</div><div 
class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;      
<span class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; to,</div><div class="line"><a 
name="l00149"></a><span class="lineno">  149</span>&#160;      
std::string&amp;&amp; name);</div><div class="line"><a name="l00150"></a><span 
class="lineno">  150</span>&#160;</div><div class="line"><a 
name="l00151"></a><span class="lineno">  151</span>&#160;  <span 
class="keywordtype">void</span> <a class="code" 
href="namespacenet.html#a69f77aa4677f1dd1c69169589b30a31b">send</a>(</div><div 
class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;      
<span class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; to,</div><div class="line"><a na
 me="l00153"></a><span class="lineno">  153</span>&#160;      
std::string&amp;&amp; name,</div><div class="line"><a name="l00154"></a><span 
class="lineno">  154</span>&#160;      std::string&amp;&amp; data);</div><div 
class="line"><a name="l00155"></a><span class="lineno">  
155</span>&#160;</div><div class="line"><a name="l00161"></a><span 
class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a39f8e327dc132dd4a3a95fee650458f8">  
161</a></span>&#160;  <span class="keyword">enum class</span> <a class="code" 
href="classprocess_1_1ProcessBase.html#a39f8e327dc132dd4a3a95fee650458f8">RemoteConnection</a></div><div
 class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;  
{</div><div class="line"><a name="l00170"></a><span class="lineno">  
170</span>&#160;    REUSE,</div><div class="line"><a name="l00171"></a><span 
class="lineno">  171</span>&#160;</div><div class="line"><a 
name="l00180"></a><span class="lineno">  180</span>&#160;    
RECONNECT,</div><div cla
 ss="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;  
};</div><div class="line"><a name="l00182"></a><span class="lineno">  
182</span>&#160;</div><div class="line"><a name="l00195"></a><span 
class="lineno">  195</span>&#160;  <a class="code" 
href="structprocess_1_1UPID.html">UPID</a> link(</div><div class="line"><a 
name="l00196"></a><span class="lineno">  196</span>&#160;      <span 
class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; pid,</div><div class="line"><a 
name="l00197"></a><span class="lineno">  197</span>&#160;      <span 
class="keyword">const</span> <a class="code" 
href="classprocess_1_1ProcessBase.html#a39f8e327dc132dd4a3a95fee650458f8">RemoteConnection</a>
 remote = RemoteConnection::REUSE);</div><div class="line"><a 
name="l00198"></a><span class="lineno">  198</span>&#160;</div><div 
class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;  
<span class="keyword">typedef</span> lambda::function&lt
 ;void(const UPID&amp;, const std::string&amp;)&gt;</div><div class="line"><a 
name="l00211"></a><span class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#ab7ca53e513d7ead18e05466c60e51891">  
211</a></span>&#160;  <a class="code" 
href="classprocess_1_1ProcessBase.html#ab7ca53e513d7ead18e05466c60e51891">MessageHandler</a>;</div><div
 class="line"><a name="l00212"></a><span class="lineno">  
212</span>&#160;</div><div class="line"><a name="l00216"></a><span 
class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a591501723f8320f0b29e2a7c64a501eb">  
216</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" 
href="classprocess_1_1ProcessBase.html#a591501723f8320f0b29e2a7c64a501eb">install</a>(</div><div
 class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;      
<span class="keyword">const</span> std::string&amp; name,</div><div 
class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;      
<span class="keyw
 ord">const</span> <a class="code" 
href="classprocess_1_1ProcessBase.html#ab7ca53e513d7ead18e05466c60e51891">MessageHandler</a>&amp;
 handler)</div><div class="line"><a name="l00219"></a><span class="lineno">  
219</span>&#160;  {</div><div class="line"><a name="l00220"></a><span 
class="lineno">  220</span>&#160;    handlers.message[<a class="code" 
href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">name</a>] = 
handler;</div><div class="line"><a name="l00221"></a><span class="lineno">  
221</span>&#160;  }</div><div class="line"><a name="l00222"></a><span 
class="lineno">  222</span>&#160;</div><div class="line"><a 
name="l00226"></a><span class="lineno">  226</span>&#160;  <span 
class="keyword">template</span> &lt;<span class="keyword">typename</span> 
T&gt;</div><div class="line"><a name="l00227"></a><span class="lineno"><a 
class="line" 
href="classprocess_1_1ProcessBase.html#a8dfef5689de05716f582fa737f165133">  
227</a></span>&#160;  <span class="keywordtype">void</span> <a
  class="code" 
href="classprocess_1_1ProcessBase.html#a8dfef5689de05716f582fa737f165133">install</a>(</div><div
 class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;      
<span class="keyword">const</span> std::string&amp; name,</div><div 
class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;      
<span class="keywordtype">void</span> (T::*method)(<span 
class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp;, <span 
class="keyword">const</span> std::string&amp;))</div><div class="line"><a 
name="l00230"></a><span class="lineno">  230</span>&#160;  {</div><div 
class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    
<span class="comment">// Note that we use dynamic_cast here so a process can 
use</span></div><div class="line"><a name="l00232"></a><span class="lineno">  
232</span>&#160;    <span class="comment">// multiple inheritance if it sees so 
fit (e.g., to implement</span></div><div class
 ="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    <span 
class="comment">// multiple callback interfaces).</span></div><div 
class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    <a 
class="code" 
href="classprocess_1_1ProcessBase.html#ab7ca53e513d7ead18e05466c60e51891">MessageHandler</a>
 handler =</div><div class="line"><a name="l00235"></a><span class="lineno">  
235</span>&#160;      <a class="code" 
href="namespaceprocess_1_1network.html#ad067110a4b38cc83785a43f49bf6c8e2">lambda::bind</a>(method,
 dynamic_cast&lt;T*&gt;(<span class="keyword">this</span>), lambda::_1, 
lambda::_2);</div><div class="line"><a name="l00236"></a><span class="lineno">  
236</span>&#160;    <a class="code" 
href="namespaceprocess_1_1firewall.html#a99a70c4d8e775bb1692693ec278d0877">install</a>(name,
 handler);</div><div class="line"><a name="l00237"></a><span class="lineno">  
237</span>&#160;  }</div><div class="line"><a name="l00238"></a><span 
class="lineno">  238</spa
 n>&#160;</div><div class="line"><a name="l00242"></a><span class="lineno"><a 
class="line" 
href="classprocess_1_1ProcessBase.html#a685d23d0dc0f42a0038dda0724e5d783">  
242</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" 
href="classprocess_1_1ProcessBase.html#a685d23d0dc0f42a0038dda0724e5d783">delegate</a>(<span
 class="keyword">const</span> std::string&amp; name, <span 
class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; pid)</div><div class="line"><a 
name="l00243"></a><span class="lineno">  243</span>&#160;  {</div><div 
class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    
delegates[<a class="code" 
href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">name</a>] = 
pid;</div><div class="line"><a name="l00245"></a><span class="lineno">  
245</span>&#160;  }</div><div class="line"><a name="l00246"></a><span 
class="lineno">  246</span>&#160;</div><div class="line"><a 
name="l00256"></a><span c
 lass="lineno">  256</span>&#160;  <span class="keyword">typedef</span> 
lambda::function&lt;Future&lt;http::Response&gt;(<span 
class="keyword">const</span> <a class="code" 
href="structprocess_1_1http_1_1Request.html">http::Request</a>&amp;)&gt;</div><div
 class="line"><a name="l00257"></a><span class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a083d8346a62ad423899f6f9e9ee08806">  
257</a></span>&#160;  <a class="code" 
href="classprocess_1_1ProcessBase.html#a083d8346a62ad423899f6f9e9ee08806">HttpRequestHandler</a>;</div><div
 class="line"><a name="l00258"></a><span class="lineno">  
258</span>&#160;</div><div class="line"><a name="l00259"></a><span 
class="lineno">  259</span>&#160;  <span class="comment">// Options to control 
the behavior of a route.</span></div><div class="line"><a 
name="l00260"></a><span class="lineno"><a class="line" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html">  260</a></span>&#160; 
 <span class="keyword">struct </span><a class="code" h
 
ref="structprocess_1_1ProcessBase_1_1RouteOptions.html">RouteOptions</a></div><div
 class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;  
{</div><div class="line"><a name="l00262"></a><span class="lineno"><a 
class="line" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html#a9c202f7f06a7cb90499e3365ce338475">
  262</a></span>&#160;    <a class="code" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html#a9c202f7f06a7cb90499e3365ce338475">RouteOptions</a>()</div><div
 class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;      
: requestStreaming(false) {}</div><div class="line"><a name="l00264"></a><span 
class="lineno">  264</span>&#160;</div><div class="line"><a 
name="l00265"></a><span class="lineno">  265</span>&#160;    <span 
class="comment">// Set to true if the endpoint supports request 
streaming.</span></div><div class="line"><a name="l00266"></a><span 
class="lineno">  266</span>&#160;    <span class="comment">// Default: 
false.</span></
 div><div class="line"><a name="l00267"></a><span class="lineno"><a 
class="line" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html#ad4c6afac4c87de57deae76b67dc09610">
  267</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html#ad4c6afac4c87de57deae76b67dc09610">requestStreaming</a>;</div><div
 class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;  
};</div><div class="line"><a name="l00269"></a><span class="lineno">  
269</span>&#160;</div><div class="line"><a name="l00276"></a><span 
class="lineno">  276</span>&#160;  <span class="keywordtype">void</span> 
route(</div><div class="line"><a name="l00277"></a><span class="lineno">  
277</span>&#160;      <span class="keyword">const</span> std::string&amp; 
name,</div><div class="line"><a name="l00278"></a><span class="lineno">  
278</span>&#160;      <span class="keyword">const</span> <a class="code" 
href="classOption.html">Option&lt;std::strin
 g&gt;</a>&amp; help,</div><div class="line"><a name="l00279"></a><span 
class="lineno">  279</span>&#160;      <span class="keyword">const</span> <a 
class="code" 
href="classprocess_1_1ProcessBase.html#a083d8346a62ad423899f6f9e9ee08806">HttpRequestHandler</a>&amp;
 handler,</div><div class="line"><a name="l00280"></a><span class="lineno">  
280</span>&#160;      <span class="keyword">const</span> <a class="code" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html">RouteOptions</a>&amp; 
options = <a class="code" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html">RouteOptions</a>());</div><div
 class="line"><a name="l00281"></a><span class="lineno">  
281</span>&#160;</div><div class="line"><a name="l00285"></a><span 
class="lineno">  285</span>&#160;  <span class="keyword">template</span> 
&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a 
name="l00286"></a><span class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a70ff038897726b5ff2713e5d56
 02efa6">  286</a></span>&#160;  <span class="keywordtype">void</span> <a 
class="code" 
href="classprocess_1_1ProcessBase.html#a70ff038897726b5ff2713e5d5602efa6">route</a>(</div><div
 class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;      
<span class="keyword">const</span> std::string&amp; name,</div><div 
class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;      
<span class="keyword">const</span> <a class="code" 
href="classOption.html">Option&lt;std::string&gt;</a>&amp; help,</div><div 
class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;      
<a class="code" 
href="classprocess_1_1Future.html">Future&lt;http::Response&gt;</a> 
(T::*method)(<span class="keyword">const</span> <a class="code" 
href="structprocess_1_1http_1_1Request.html">http::Request</a>&amp;),</div><div 
class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;      
<span class="keyword">const</span> <a class="code" href="structprocess_1_1Proc
 essBase_1_1RouteOptions.html">RouteOptions</a>&amp; options = <a class="code" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html">RouteOptions</a>())</div><div
 class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;  
{</div><div class="line"><a name="l00292"></a><span class="lineno">  
292</span>&#160;    <span class="comment">// Note that we use dynamic_cast here 
so a process can use</span></div><div class="line"><a name="l00293"></a><span 
class="lineno">  293</span>&#160;    <span class="comment">// multiple 
inheritance if it sees so fit (e.g., to implement</span></div><div 
class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    
<span class="comment">// multiple callback interfaces).</span></div><div 
class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    <a 
class="code" 
href="classprocess_1_1ProcessBase.html#a083d8346a62ad423899f6f9e9ee08806">HttpRequestHandler</a>
 handler =</div><div class="line"><a name="l00296"></
 a><span class="lineno">  296</span>&#160;      <a class="code" 
href="namespaceprocess_1_1network.html#ad067110a4b38cc83785a43f49bf6c8e2">lambda::bind</a>(method,
 dynamic_cast&lt;T*&gt;(<span class="keyword">this</span>), 
lambda::_1);</div><div class="line"><a name="l00297"></a><span class="lineno">  
297</span>&#160;    route(name, help, handler, options);</div><div 
class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;  
}</div><div class="line"><a name="l00299"></a><span class="lineno">  
299</span>&#160;</div><div class="line"><a name="l00320"></a><span 
class="lineno">  320</span>&#160;  <span class="keyword">typedef</span> 
lambda::function&lt;Future&lt;http::Response&gt;(</div><div class="line"><a 
name="l00321"></a><span class="lineno">  321</span>&#160;      <span 
class="keyword">const</span> <a class="code" 
href="structprocess_1_1http_1_1Request.html">http::Request</a>&amp;,</div><div 
class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;    
   <span class="keyword">const</span> <a class="code" 
href="classOption.html">Option&lt;http::authentication::Principal&gt;</a>&amp;)&gt;</div><div
 class="line"><a name="l00323"></a><span class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a0834b08377ce20a01893a033c46898f6">  
323</a></span>&#160;          <a class="code" 
href="classprocess_1_1ProcessBase.html#a0834b08377ce20a01893a033c46898f6">AuthenticatedHttpRequestHandler</a>;</div><div
 class="line"><a name="l00324"></a><span class="lineno">  
324</span>&#160;</div><div class="line"><a name="l00325"></a><span 
class="lineno">  325</span>&#160;  <span class="comment">// TODO(arojas): 
Consider introducing an `authentication::Realm` type.</span></div><div 
class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;  
<span class="keywordtype">void</span> route(</div><div class="line"><a 
name="l00327"></a><span class="lineno">  327</span>&#160;      <span 
class="keyword">const</span> std::string&amp; name,<
 /div><div class="line"><a name="l00328"></a><span class="lineno">  
328</span>&#160;      <span class="keyword">const</span> std::string&amp; 
realm,</div><div class="line"><a name="l00329"></a><span class="lineno">  
329</span>&#160;      <span class="keyword">const</span> <a class="code" 
href="classOption.html">Option&lt;std::string&gt;</a>&amp; help,</div><div 
class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;      
<span class="keyword">const</span> <a class="code" 
href="classprocess_1_1ProcessBase.html#a0834b08377ce20a01893a033c46898f6">AuthenticatedHttpRequestHandler</a>&amp;
 handler,</div><div class="line"><a name="l00331"></a><span class="lineno">  
331</span>&#160;      <span class="keyword">const</span> <a class="code" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html">RouteOptions</a>&amp; 
options = <a class="code" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html">RouteOptions</a>());</div><div
 class="line"><a name="l00332"></a><span class="
 lineno">  332</span>&#160;</div><div class="line"><a name="l00336"></a><span 
class="lineno">  336</span>&#160;  <span class="keyword">template</span> 
&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a 
name="l00337"></a><span class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a897bf0b650b9fc56fc87fd005827c8ce">  
337</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" 
href="classprocess_1_1ProcessBase.html#a897bf0b650b9fc56fc87fd005827c8ce">route</a>(</div><div
 class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;      
<span class="keyword">const</span> std::string&amp; name,</div><div 
class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;      
<span class="keyword">const</span> std::string&amp; realm,</div><div 
class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;      
<span class="keyword">const</span> <a class="code" 
href="classOption.html">Option&lt;std::string&
 gt;</a>&amp; help,</div><div class="line"><a name="l00341"></a><span 
class="lineno">  341</span>&#160;      <a class="code" 
href="classprocess_1_1Future.html">Future&lt;http::Response&gt;</a> 
(T::*method)(</div><div class="line"><a name="l00342"></a><span class="lineno"> 
 342</span>&#160;          <span class="keyword">const</span> 
http::Request&amp;,</div><div class="line"><a name="l00343"></a><span 
class="lineno">  343</span>&#160;          <span class="keyword">const</span> 
<a class="code" 
href="classOption.html">Option&lt;http::authentication::Principal&gt;</a>&amp;),</div><div
 class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;      
<span class="keyword">const</span> <a class="code" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html">RouteOptions</a>&amp; 
options = <a class="code" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html">RouteOptions</a>())</div><div
 class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;  
{</div><div
  class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;    
<span class="comment">// Note that we use dynamic_cast here so a process can 
use</span></div><div class="line"><a name="l00347"></a><span class="lineno">  
347</span>&#160;    <span class="comment">// multiple inheritance if it sees so 
fit (e.g., to implement</span></div><div class="line"><a 
name="l00348"></a><span class="lineno">  348</span>&#160;    <span 
class="comment">// multiple callback interfaces).</span></div><div 
class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;    <a 
class="code" 
href="classprocess_1_1ProcessBase.html#a0834b08377ce20a01893a033c46898f6">AuthenticatedHttpRequestHandler</a>
 handler =</div><div class="line"><a name="l00350"></a><span class="lineno">  
350</span>&#160;      <a class="code" 
href="namespaceprocess_1_1network.html#ad067110a4b38cc83785a43f49bf6c8e2">lambda::bind</a>(method,
 dynamic_cast&lt;T*&gt;(<span class="keyword">this</span>), lambda::_1, lambd
 a::_2);</div><div class="line"><a name="l00351"></a><span class="lineno">  
351</span>&#160;    route(name, realm, help, handler, options);</div><div 
class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;  
}</div><div class="line"><a name="l00353"></a><span class="lineno">  
353</span>&#160;</div><div class="line"><a name="l00368"></a><span 
class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a6b32f94df3a92225825a1cc426b060c8">  
368</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" 
href="classprocess_1_1ProcessBase.html#a6b32f94df3a92225825a1cc426b060c8">provide</a>(</div><div
 class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;      
<span class="keyword">const</span> std::string&amp; name,</div><div 
class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;      
<span class="keyword">const</span> std::string&amp; <a class="code" 
href="namespacepath.html">path</a>,</div><div class="line"><a n
 ame="l00371"></a><span class="lineno">  371</span>&#160;      <span 
class="keyword">const</span> std::map&lt;std::string, std::string&gt;&amp; <a 
class="code" 
href="namespaceprocess_1_1mime.html#aa12bd84b9c99ba313fbbf8c56bc411cb">types</a>
 = <a class="code" 
href="namespaceprocess_1_1mime.html#aa12bd84b9c99ba313fbbf8c56bc411cb">mime::types</a>)</div><div
 class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;  
{</div><div class="line"><a name="l00373"></a><span class="lineno">  
373</span>&#160;    <span class="comment">// TODO(benh): Check that name is 
only alphanumeric (i.e., has no</span></div><div class="line"><a 
name="l00374"></a><span class="lineno">  374</span>&#160;    <span 
class="comment">// &#39;/&#39;) and that path is absolute.</span></div><div 
class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;    
Asset asset;</div><div class="line"><a name="l00376"></a><span class="lineno">  
376</span>&#160;    asset.path = path;</div><div class="
 line"><a name="l00377"></a><span class="lineno">  377</span>&#160;    
asset.types = <a class="code" 
href="namespaceprocess_1_1mime.html#aa12bd84b9c99ba313fbbf8c56bc411cb">types</a>;</div><div
 class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;    
assets[<a class="code" 
href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">name</a>] = 
asset;</div><div class="line"><a name="l00379"></a><span class="lineno">  
379</span>&#160;  }</div><div class="line"><a name="l00380"></a><span 
class="lineno">  380</span>&#160;</div><div class="line"><a 
name="l00386"></a><span class="lineno">  386</span>&#160;  <span 
class="keyword">template</span> &lt;<span class="keyword">typename</span> 
T&gt;</div><div class="line"><a name="l00387"></a><span class="lineno">  
387</span>&#160;  <span class="keywordtype">size_t</span> 
eventCount();</div><div class="line"><a name="l00388"></a><span class="lineno"> 
 388</span>&#160;</div><div class="line"><a name="l00389"></a><span clas
 s="lineno">  389</span>&#160;<span class="keyword">private</span>:</div><div 
class="line"><a name="l00390"></a><span class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a43e117b196c850619d5255046edb3e79">  
390</a></span>&#160;  <span class="keyword">friend</span> <span 
class="keyword">class </span><a class="code" 
href="classprocess_1_1SocketManager.html">SocketManager</a>;</div><div 
class="line"><a name="l00391"></a><span class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#ae1701c7594fe2cf1c96b951a52eb0396">  
391</a></span>&#160;  <span class="keyword">friend</span> <span 
class="keyword">class </span>ProcessManager;</div><div class="line"><a 
name="l00392"></a><span class="lineno">  392</span>&#160;  <span 
class="keyword">friend</span> <span class="keywordtype">void</span>* <a 
class="code" 
href="namespacemesos_1_1internal_1_1master_1_1maintenance_1_1validation.html#a2305ebada64e853abc6548e118ad08ee">schedule</a>(<span
 class="keywordtype">void</span
 >*);</div><div class="line"><a name="l00393"></a><span class="lineno">  
 >393</span>&#160;</div><div class="line"><a name="l00394"></a><span 
 >class="lineno">  394</span>&#160;  <span class="comment">// Process 
 >states.</span></div><div class="line"><a name="l00395"></a><span 
 >class="lineno">  395</span>&#160;  <span class="comment">//</span></div><div 
 >class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;  
 ><span class="comment">// Transitioning from BLOCKED to READY also requires 
 >enqueueing the</span></div><div class="line"><a name="l00397"></a><span 
 >class="lineno">  397</span>&#160;  <span class="comment">// process in the 
 >run queue otherwise the events will never be</span></div><div class="line"><a 
 >name="l00398"></a><span class="lineno">  398</span>&#160;  <span 
 >class="comment">// processed!</span></div><div class="line"><a 
 >name="l00399"></a><span class="lineno">  399</span>&#160;  <span 
 >class="keyword">enum class</span> State</div><div class="line"><a 
 >name="l00400">
 </a><span class="lineno">  400</span>&#160;  {</div><div class="line"><a 
name="l00401"></a><span class="lineno">  401</span>&#160;    BOTTOM, <span 
class="comment">// Uninitialized but events may be enqueued.</span></div><div 
class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;    
BLOCKED, <span class="comment">// Initialized, no events 
enqueued.</span></div><div class="line"><a name="l00403"></a><span 
class="lineno">  403</span>&#160;    READY, <span class="comment">// 
Initialized, events enqueued.</span></div><div class="line"><a 
name="l00404"></a><span class="lineno">  404</span>&#160;    TERMINATING <span 
class="comment">// Initialized, no more events will be 
enqueued.</span></div><div class="line"><a name="l00405"></a><span 
class="lineno">  405</span>&#160;  };</div><div class="line"><a 
name="l00406"></a><span class="lineno">  406</span>&#160;</div><div 
class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;  
std::atomic&lt;State&gt; state
  = ATOMIC_VAR_INIT(State::BOTTOM);</div><div class="line"><a 
name="l00408"></a><span class="lineno">  408</span>&#160;</div><div 
class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;  
<span class="comment">// Flag for indicating that a terminate event has been 
injected.</span></div><div class="line"><a name="l00410"></a><span 
class="lineno">  410</span>&#160;  std::atomic&lt;bool&gt; termination = 
ATOMIC_VAR_INIT(<span class="keyword">false</span>);</div><div class="line"><a 
name="l00411"></a><span class="lineno">  411</span>&#160;</div><div 
class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;  
<span class="comment">// Enqueue the specified message, request, or function 
call.</span></div><div class="line"><a name="l00413"></a><span class="lineno">  
413</span>&#160;  <span class="keywordtype">void</span> enqueue(<a class="code" 
href="structprocess_1_1Event.html">Event</a>* event);</div><div class="line"><a 
name="l00414"></a><span class="lineno
 ">  414</span>&#160;</div><div class="line"><a name="l00415"></a><span 
class="lineno">  415</span>&#160;  <span class="comment">// Delegates for 
messages.</span></div><div class="line"><a name="l00416"></a><span 
class="lineno">  416</span>&#160;  std::map&lt;std::string, UPID&gt; 
delegates;</div><div class="line"><a name="l00417"></a><span class="lineno">  
417</span>&#160;</div><div class="line"><a name="l00418"></a><span 
class="lineno">  418</span>&#160;  <span class="comment">// Definition of an 
HTTP endpoint. The endpoint can be</span></div><div class="line"><a 
name="l00419"></a><span class="lineno">  419</span>&#160;  <span 
class="comment">// associated with an authentication realm, in which 
case:</span></div><div class="line"><a name="l00420"></a><span class="lineno">  
420</span>&#160;  <span class="comment">//</span></div><div class="line"><a 
name="l00421"></a><span class="lineno">  421</span>&#160;  <span 
class="comment">//  (1) `realm` and `authenticatedHandler` will be set.
 </span></div><div class="line"><a name="l00422"></a><span class="lineno">  
422</span>&#160;  <span class="comment">//      Libprocess will perform HTTP 
authentication for</span></div><div class="line"><a name="l00423"></a><span 
class="lineno">  423</span>&#160;  <span class="comment">//      all requests 
to this endpoint (by default during</span></div><div class="line"><a 
name="l00424"></a><span class="lineno">  424</span>&#160;  <span 
class="comment">//      HttpEvent consumption). The authentication 
principal</span></div><div class="line"><a name="l00425"></a><span 
class="lineno">  425</span>&#160;  <span class="comment">//      will be passed 
to the `authenticatedHandler`.</span></div><div class="line"><a 
name="l00426"></a><span class="lineno">  426</span>&#160;  <span 
class="comment">//</span></div><div class="line"><a name="l00427"></a><span 
class="lineno">  427</span>&#160;  <span class="comment">//  Otherwise, if the 
endpoint is not associated with an</span></div><div class="
 line"><a name="l00428"></a><span class="lineno">  428</span>&#160;  <span 
class="comment">//  authentication realm:</span></div><div class="line"><a 
name="l00429"></a><span class="lineno">  429</span>&#160;  <span 
class="comment">//</span></div><div class="line"><a name="l00430"></a><span 
class="lineno">  430</span>&#160;  <span class="comment">//  (2) Only `handler` 
will be set, and no authentication</span></div><div class="line"><a 
name="l00431"></a><span class="lineno">  431</span>&#160;  <span 
class="comment">//      takes place.</span></div><div class="line"><a 
name="l00432"></a><span class="lineno">  432</span>&#160;  <span 
class="keyword">struct </span>HttpEndpoint</div><div class="line"><a 
name="l00433"></a><span class="lineno">  433</span>&#160;  {</div><div 
class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;    <a 
class="code" href="classOption.html">Option&lt;HttpRequestHandler&gt;</a> 
handler;</div><div class="line"><a name="l00435"></a><span class=
 "lineno">  435</span>&#160;</div><div class="line"><a name="l00436"></a><span 
class="lineno">  436</span>&#160;    <a class="code" 
href="classOption.html">Option&lt;std::string&gt;</a> realm;</div><div 
class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;    <a 
class="code" 
href="classOption.html">Option&lt;AuthenticatedHttpRequestHandler&gt;</a> 
authenticatedHandler;</div><div class="line"><a name="l00438"></a><span 
class="lineno">  438</span>&#160;    <a class="code" 
href="structprocess_1_1ProcessBase_1_1RouteOptions.html">RouteOptions</a> 
options;</div><div class="line"><a name="l00439"></a><span class="lineno">  
439</span>&#160;  };</div><div class="line"><a name="l00440"></a><span 
class="lineno">  440</span>&#160;</div><div class="line"><a 
name="l00441"></a><span class="lineno">  441</span>&#160;  <span 
class="comment">// Handlers for messages and HTTP requests.</span></div><div 
class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;  <span
  class="keyword">struct </span>{</div><div class="line"><a 
name="l00443"></a><span class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#afb219ae4b5e8dab3f724e78032e03d0c">  
443</a></span>&#160;    <a class="code" 
href="classhashmap.html">hashmap&lt;std::string, MessageHandler&gt;</a> <a 
class="code" 
href="classprocess_1_1ProcessBase.html#afb219ae4b5e8dab3f724e78032e03d0c">message</a>;</div><div
 class="line"><a name="l00444"></a><span class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a2f0e2769d84e1491c180d0da6458624b">  
444</a></span>&#160;    <a class="code" 
href="classhashmap.html">hashmap&lt;std::string, HttpEndpoint&gt;</a> <a 
class="code" 
href="classprocess_1_1ProcessBase.html#a2f0e2769d84e1491c180d0da6458624b">http</a>;</div><div
 class="line"><a name="l00445"></a><span class="lineno">  
445</span>&#160;</div><div class="line"><a name="l00446"></a><span 
class="lineno">  446</span>&#160;    <span class="comment">// Used for 
delivering HTTP requ
 ests in the correct order.</span></div><div class="line"><a 
name="l00447"></a><span class="lineno">  447</span>&#160;    <span 
class="comment">// Initialized lazily to avoid ProcessBase 
requiring</span></div><div class="line"><a name="l00448"></a><span 
class="lineno">  448</span>&#160;    <span class="comment">// another 
Process!</span></div><div class="line"><a name="l00449"></a><span 
class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a55a5326c3f9b66bc56cc13c7bf4c350d">  
449</a></span>&#160;    <a class="code" 
href="classprocess_1_1Owned.html">Owned&lt;Sequence&gt;</a> <a class="code" 
href="classprocess_1_1ProcessBase.html#a55a5326c3f9b66bc56cc13c7bf4c350d">httpSequence</a>;</div><div
 class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;  } 
handlers;</div><div class="line"><a name="l00451"></a><span class="lineno">  
451</span>&#160;</div><div class="line"><a name="l00452"></a><span 
class="lineno">  452</span>&#160;  <span class="comment">// De
 finition of a static asset.</span></div><div class="line"><a 
name="l00453"></a><span class="lineno">  453</span>&#160;  <span 
class="keyword">struct </span>Asset</div><div class="line"><a 
name="l00454"></a><span class="lineno">  454</span>&#160;  {</div><div 
class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;    
std::string <a class="code" href="namespacepath.html">path</a>;</div><div 
class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;    
std::map&lt;std::string, std::string&gt; <a class="code" 
href="namespaceprocess_1_1mime.html#aa12bd84b9c99ba313fbbf8c56bc411cb">types</a>;</div><div
 class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;  
};</div><div class="line"><a name="l00458"></a><span class="lineno">  
458</span>&#160;</div><div class="line"><a name="l00459"></a><span 
class="lineno">  459</span>&#160;  <span class="comment">// Continuation for 
`consume(HttpEvent&amp;&amp;)`.</span></div><div class="line"><a name="l
 00460"></a><span class="lineno">  460</span>&#160;  <a class="code" 
href="classprocess_1_1Future.html">Future&lt;http::Response&gt;</a> 
_consume(</div><div class="line"><a name="l00461"></a><span class="lineno">  
461</span>&#160;      <span class="keyword">const</span> HttpEndpoint&amp; 
endpoint,</div><div class="line"><a name="l00462"></a><span class="lineno">  
462</span>&#160;      <span class="keyword">const</span> std::string&amp; 
name,</div><div class="line"><a name="l00463"></a><span class="lineno">  
463</span>&#160;      <span class="keyword">const</span> <a class="code" 
href="classprocess_1_1Owned.html">Owned&lt;http::Request&gt;</a>&amp; <a 
class="code" 
href="namespaceprocess_1_1http.html#ad8f400b5e54038df7e5662ec35da05fa">request</a>);</div><div
 class="line"><a name="l00464"></a><span class="lineno">  
464</span>&#160;</div><div class="line"><a name="l00465"></a><span 
class="lineno">  465</span>&#160;  <span class="comment">// JSON representation 
of process. MUST be invoked
  from within the</span></div><div class="line"><a name="l00466"></a><span 
class="lineno">  466</span>&#160;  <span class="comment">// process itself in 
order to safely examine events.</span></div><div class="line"><a 
name="l00467"></a><span class="lineno">  467</span>&#160;  <span 
class="keyword">operator</span> <a class="code" 
href="structJSON_1_1Object.html">JSON::Object</a>();</div><div class="line"><a 
name="l00468"></a><span class="lineno">  468</span>&#160;</div><div 
class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;  
<span class="comment">// Static assets(s) to provide.</span></div><div 
class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;  
std::map&lt;std::string, Asset&gt; assets;</div><div class="line"><a 
name="l00471"></a><span class="lineno">  471</span>&#160;</div><div 
class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;  
<span class="comment">// Queue of received events. We employ the PIMPL idiom 
here and u
 se</span></div><div class="line"><a name="l00473"></a><span class="lineno">  
473</span>&#160;  <span class="comment">// a pointer so we can hide the 
implementation of `EventQueue`.</span></div><div class="line"><a 
name="l00474"></a><span class="lineno">  474</span>&#160;  
std::unique_ptr&lt;EventQueue&gt; events;</div><div class="line"><a 
name="l00475"></a><span class="lineno">  475</span>&#160;</div><div 
class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;  
<span class="comment">// NOTE: this is a shared pointer to a _pointer_, hence 
this is not</span></div><div class="line"><a name="l00477"></a><span 
class="lineno">  477</span>&#160;  <span class="comment">// responsible for the 
ProcessBase itself.</span></div><div class="line"><a name="l00478"></a><span 
class="lineno">  478</span>&#160;  std::shared_ptr&lt;ProcessBase*&gt; 
reference;</div><div class="line"><a name="l00479"></a><span class="lineno">  
479</span>&#160;</div><div class="line"><a name="l00480"></a
 ><span class="lineno">  480</span>&#160;  std::shared_ptr&lt;Gate&gt; 
 >gate;</div><div class="line"><a name="l00481"></a><span class="lineno">  
 >481</span>&#160;</div><div class="line"><a name="l00482"></a><span 
 >class="lineno">  482</span>&#160;  <span class="comment">// Whether or not 
 >the runtime should delete this process after it</span></div><div 
 >class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;  
 ><span class="comment">// has terminated. Note that failure to spawn the 
 >process will leave</span></div><div class="line"><a name="l00484"></a><span 
 >class="lineno">  484</span>&#160;  <span class="comment">// the process 
 >unmanaged and thus it may leak!</span></div><div class="line"><a 
 >name="l00485"></a><span class="lineno">  485</span>&#160;  <span 
 >class="keywordtype">bool</span> manage = <span 
 >class="keyword">false</span>;</div><div class="line"><a 
 >name="l00486"></a><span class="lineno">  486</span>&#160;</div><div 
 >class="line"><a name="l00487"></a><span class="line
 no">  487</span>&#160;  <span class="comment">// Process PID.</span></div><div 
class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;  <a 
class="code" href="structprocess_1_1UPID.html">UPID</a> pid;</div><div 
class="line"><a name="l00489"></a><span class="lineno">  
489</span>&#160;};</div><div class="line"><a name="l00490"></a><span 
class="lineno">  490</span>&#160;</div><div class="line"><a 
name="l00491"></a><span class="lineno">  491</span>&#160;</div><div 
class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;<span 
class="keyword">template</span> &lt;<span class="keyword">typename</span> 
T&gt;</div><div class="line"><a name="l00493"></a><span class="lineno"><a 
class="line" href="classprocess_1_1Process.html">  493</a></span>&#160;<span 
class="keyword">class </span><a class="code" 
href="classprocess_1_1Process.html">Process</a> : <span 
class="keyword">public</span> <span class="keyword">virtual</span> <a 
class="code" href="classprocess_1_1Proce
 ssBase.html">ProcessBase</a> {</div><div class="line"><a 
name="l00494"></a><span class="lineno">  494</span>&#160;<span 
class="keyword">public</span>:</div><div class="line"><a 
name="l00495"></a><span class="lineno"><a class="line" 
href="classprocess_1_1Process.html#a919f2834843f8620784c58aee7db2371">  
495</a></span>&#160;  <span class="keyword">virtual</span> <a class="code" 
href="classprocess_1_1Process.html#a919f2834843f8620784c58aee7db2371">~Process</a>()
 {}</div><div class="line"><a name="l00496"></a><span class="lineno">  
496</span>&#160;</div><div class="line"><a name="l00502"></a><span 
class="lineno"><a class="line" 
href="classprocess_1_1Process.html#abef2d54388c5262af19b057b1a6eee8e">  
502</a></span>&#160;  <a class="code" 
href="structprocess_1_1PID.html">PID&lt;T&gt;</a> <span 
class="keyword">self</span>() <span class="keyword">const</span> { <span 
class="keywordflow">return</span> <a class="code" 
href="structprocess_1_1PID.html">PID&lt;T&gt;</a>(<span class="keyword">stat
 ic_cast&lt;</span><span class="keyword">const </span>T*<span 
class="keyword">&gt;</span>(<span class="keyword">this</span>)); }</div><div 
class="line"><a name="l00503"></a><span class="lineno">  
503</span>&#160;</div><div class="line"><a name="l00504"></a><span 
class="lineno">  504</span>&#160;<span 
class="keyword">protected</span>:</div><div class="line"><a 
name="l00505"></a><span class="lineno">  505</span>&#160;  <span 
class="comment">// Useful typedefs for dispatch/delay/defer to 
self()/this.</span></div><div class="line"><a name="l00506"></a><span 
class="lineno"><a class="line" 
href="classprocess_1_1Process.html#a0ff94db0ab3ccea7ba6fd8cba68b6b9e">  
506</a></span>&#160;  <span class="keyword">typedef</span> T <a class="code" 
href="classprocess_1_1Process.html#a0ff94db0ab3ccea7ba6fd8cba68b6b9e">Self</a>;</div><div
 class="line"><a name="l00507"></a><span class="lineno"><a class="line" 
href="classprocess_1_1Process.html#a1e9980d5d873c695d4a1749971e18cd9">  
507</a></span>&#160;  <sp
 an class="keyword">typedef</span> T <a class="code" 
href="classprocess_1_1Process.html#a1e9980d5d873c695d4a1749971e18cd9">This</a>;</div><div
 class="line"><a name="l00508"></a><span class="lineno">  
508</span>&#160;};</div><div class="line"><a name="l00509"></a><span 
class="lineno">  509</span>&#160;</div><div class="line"><a 
name="l00510"></a><span class="lineno">  510</span>&#160;</div><div 
class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;<span 
class="keywordtype">bool</span> <a class="code" 
href="namespaceprocess.html#a6c9cd01950a98038b2a6df3e5066418f">initialize</a>(</div><div
 class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;    
<span class="keyword">const</span> <a class="code" 
href="classOption.html">Option&lt;std::string&gt;</a>&amp; delegate = <a 
class="code" href="structNone.html">None</a>(),</div><div class="line"><a 
name="l00533"></a><span class="lineno">  533</span>&#160;    <span 
class="keyword">const</span> <a class="code
 " href="classOption.html">Option&lt;std::string&gt;</a>&amp; 
readwriteAuthenticationRealm = <a class="code" 
href="structNone.html">None</a>(),</div><div class="line"><a 
name="l00534"></a><span class="lineno">  534</span>&#160;    <span 
class="keyword">const</span> <a class="code" 
href="classOption.html">Option&lt;std::string&gt;</a>&amp; 
readonlyAuthenticationRealm = <a class="code" 
href="structNone.html">None</a>());</div><div class="line"><a 
name="l00535"></a><span class="lineno">  535</span>&#160;</div><div 
class="line"><a name="l00536"></a><span class="lineno">  
536</span>&#160;</div><div class="line"><a name="l00543"></a><span 
class="lineno">  543</span>&#160;<span class="keywordtype">void</span> <a 
class="code" 
href="namespaceprocess.html#a238371634a6637198c58ea740b0890ca">finalize</a>(<span
 class="keywordtype">bool</span> finalize_wsa = <span 
class="keyword">false</span>);</div><div class="line"><a 
name="l00544"></a><span class="lineno">  544</span>&#160;</div><div class="lin
 e"><a name="l00545"></a><span class="lineno">  545</span>&#160;</div><div 
class="line"><a name="l00549"></a><span class="lineno">  
549</span>&#160;std::string <a class="code" 
href="namespaceprocess.html#a112cf0f14ff608d490b910aab93d8e0d">absolutePath</a>(<span
 class="keyword">const</span> std::string&amp; <a class="code" 
href="namespacepath.html">path</a>);</div><div class="line"><a 
name="l00550"></a><span class="lineno">  550</span>&#160;</div><div 
class="line"><a name="l00551"></a><span class="lineno">  
551</span>&#160;</div><div class="line"><a name="l00555"></a><span 
class="lineno">  555</span>&#160;<a class="code" 
href="classprocess_1_1network_1_1inet_1_1Address.html">network::inet::Address</a>
 <a class="code" 
href="namespaceprocess.html#afdecc57ab065ab5d354e728d0ef0ff34">address</a>();</div><div
 class="line"><a name="l00556"></a><span class="lineno">  
556</span>&#160;</div><div class="line"><a name="l00557"></a><span 
class="lineno">  557</span>&#160;</div><div class="line"><a 
 name="l00561"></a><span class="lineno">  561</span>&#160;<a class="code" 
href="structprocess_1_1PID.html">PID&lt;Logging&gt;</a> <a class="code" 
href="namespaceprocess.html#a283af87525d9611f5d27b9a7dd6b967e">logging</a>();</div><div
 class="line"><a name="l00562"></a><span class="lineno">  
562</span>&#160;</div><div class="line"><a name="l00563"></a><span 
class="lineno">  563</span>&#160;</div><div class="line"><a 
name="l00569"></a><span class="lineno">  569</span>&#160;<span 
class="keywordtype">long</span> <a class="code" 
href="namespaceprocess.html#a18419acc52ca1e339e684f8d9208207e">workers</a>();</div><div
 class="line"><a name="l00570"></a><span class="lineno">  
570</span>&#160;</div><div class="line"><a name="l00571"></a><span 
class="lineno">  571</span>&#160;</div><div class="line"><a 
name="l00579"></a><span class="lineno">  579</span>&#160;<a class="code" 
href="structprocess_1_1UPID.html">UPID</a> <a class="code" 
href="namespaceprocess.html#aff22904a83567125d3b4d0d88e5a2270">sp
 awn</a>(<a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>* <a class="code" 
href="namespaceprocess.html">process</a>, <span class="keywordtype">bool</span> 
manage = <span class="keyword">false</span>);</div><div class="line"><a 
name="l00580"></a><span class="lineno">  580</span>&#160;</div><div 
class="line"><a name="l00581"></a><span class="lineno"><a class="line" 
href="namespaceprocess.html#aa3e3f539080a94857e07401dd26b2f8f">  
581</a></span>&#160;<span class="keyword">inline</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a> <a class="code" 
href="namespaceprocess.html#aff22904a83567125d3b4d0d88e5a2270">spawn</a>(<a 
class="code" href="classprocess_1_1ProcessBase.html">ProcessBase</a>&amp; <a 
class="code" href="namespaceprocess.html">process</a>, <span 
class="keywordtype">bool</span> manage = <span 
class="keyword">false</span>)</div><div class="line"><a name="l00582"></a><span 
class="lineno">  582</span>&#160;{</div><div class="line"><a name="l0058
 3"></a><span class="lineno">  583</span>&#160;  <span 
class="keywordflow">return</span> <a class="code" 
href="namespaceprocess.html#aff22904a83567125d3b4d0d88e5a2270">spawn</a>(&amp;process,
 manage);</div><div class="line"><a name="l00584"></a><span class="lineno">  
584</span>&#160;}</div><div class="line"><a name="l00585"></a><span 
class="lineno">  585</span>&#160;</div><div class="line"><a 
name="l00586"></a><span class="lineno">  586</span>&#160;<span 
class="keyword">template</span> &lt;<span class="keyword">typename</span> 
T&gt;</div><div class="line"><a name="l00587"></a><span class="lineno"><a 
class="line" href="namespaceprocess.html#a271f92d7aab3c157b237ac5c48a0f6be">  
587</a></span>&#160;<a class="code" 
href="structprocess_1_1PID.html">PID&lt;T&gt;</a> <a class="code" 
href="namespaceprocess.html#aff22904a83567125d3b4d0d88e5a2270">spawn</a>(T* t, 
<span class="keywordtype">bool</span> manage = <span 
class="keyword">false</span>)</div><div class="line"><a name="l00588"></a><span
  class="lineno">  588</span>&#160;{</div><div class="line"><a 
name="l00589"></a><span class="lineno">  589</span>&#160;  <span 
class="comment">// We save the pid before spawn is called because it&#39;s 
possible that</span></div><div class="line"><a name="l00590"></a><span 
class="lineno">  590</span>&#160;  <span class="comment">// the process has 
already been deleted after spawn returns (e.g.,</span></div><div 
class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;  
<span class="comment">// if &#39;manage&#39; is true).</span></div><div 
class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;  <a 
class="code" href="structprocess_1_1PID.html">PID&lt;T&gt;</a> 
pid(t);</div><div class="line"><a name="l00593"></a><span class="lineno">  
593</span>&#160;</div><div class="line"><a name="l00594"></a><span 
class="lineno">  594</span>&#160;  <span class="keywordflow">if</span> (!<a 
class="code" href="namespaceprocess.html#aff22904a83567125d3b4d0d88e5a2270">s
 pawn</a>(static_cast&lt;ProcessBase*&gt;(t), manage)) {</div><div 
class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;    
<span class="keywordflow">return</span> <a class="code" 
href="structprocess_1_1PID.html">PID&lt;T&gt;</a>();</div><div class="line"><a 
name="l00596"></a><span class="lineno">  596</span>&#160;  }</div><div 
class="line"><a name="l00597"></a><span class="lineno">  
597</span>&#160;</div><div class="line"><a name="l00598"></a><span 
class="lineno">  598</span>&#160;  <span class="keywordflow">return</span> 
pid;</div><div class="line"><a name="l00599"></a><span class="lineno">  
599</span>&#160;}</div><div class="line"><a name="l00600"></a><span 
class="lineno">  600</span>&#160;</div><div class="line"><a 
name="l00601"></a><span class="lineno">  601</span>&#160;<span 
class="keyword">template</span> &lt;<span class="keyword">typename</span> 
T&gt;</div><div class="line"><a name="l00602"></a><span class="lineno"><a 
class="line" href="namespaceprocess.ht
 ml#a0458ac577eb50d91c829967c1d7ca3dd">  602</a></span>&#160;<a class="code" 
href="structprocess_1_1PID.html">PID&lt;T&gt;</a> <a class="code" 
href="namespaceprocess.html#aff22904a83567125d3b4d0d88e5a2270">spawn</a>(T&amp; 
t, <span class="keywordtype">bool</span> manage = <span 
class="keyword">false</span>)</div><div class="line"><a name="l00603"></a><span 
class="lineno">  603</span>&#160;{</div><div class="line"><a 
name="l00604"></a><span class="lineno">  604</span>&#160;  <span 
class="keywordflow">return</span> <a class="code" 
href="namespaceprocess.html#aff22904a83567125d3b4d0d88e5a2270">spawn</a>(&amp;t,
 manage);</div><div class="line"><a name="l00605"></a><span class="lineno">  
605</span>&#160;}</div><div class="line"><a name="l00606"></a><span 
class="lineno">  606</span>&#160;</div><div class="line"><a 
name="l00607"></a><span class="lineno">  607</span>&#160;</div><div 
class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;<span 
class="keywordtype">void</span>
  <a class="code" 
href="namespaceprocess.html#a20443908afa3212215166e26065349e5">terminate</a>(<span
 class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; pid, <span 
class="keywordtype">bool</span> inject = <span 
class="keyword">true</span>);</div><div class="line"><a name="l00622"></a><span 
class="lineno">  622</span>&#160;<span class="keywordtype">void</span> <a 
class="code" 
href="namespaceprocess.html#a20443908afa3212215166e26065349e5">terminate</a>(<span
 class="keyword">const</span> <a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>&amp; <a class="code" 
href="namespaceprocess.html">process</a>, <span class="keywordtype">bool</span> 
inject = <span class="keyword">true</span>);</div><div class="line"><a 
name="l00623"></a><span class="lineno">  623</span>&#160;<span 
class="keywordtype">void</span> <a class="code" 
href="namespaceprocess.html#a20443908afa3212215166e26065349e5">terminate</a>(<span
 class="keyword">const</span> 
 <a class="code" href="classprocess_1_1ProcessBase.html">ProcessBase</a>* 
process, <span class="keywordtype">bool</span> inject = <span 
class="keyword">true</span>);</div><div class="line"><a name="l00624"></a><span 
class="lineno">  624</span>&#160;</div><div class="line"><a 
name="l00625"></a><span class="lineno">  625</span>&#160;</div><div 
class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;<span 
class="keywordtype">bool</span> <a class="code" 
href="namespaceprocess.html#a07833fb41a8b0c1f18fa5485ca8c18d4">wait</a>(<span 
class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; pid, <span 
class="keyword">const</span> <a class="code" 
href="classDuration.html">Duration</a>&amp; duration = <a class="code" 
href="classSeconds.html">Seconds</a>(-1));</div><div class="line"><a 
name="l00635"></a><span class="lineno">  635</span>&#160;<span 
class="keywordtype">bool</span> <a class="code" 
href="namespaceprocess.html#a07833fb41a8b0c1f18fa
 5485ca8c18d4">wait</a>(<span class="keyword">const</span> <a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>&amp; process, <span 
class="keyword">const</span> <a class="code" 
href="classDuration.html">Duration</a>&amp; duration = <a class="code" 
href="classSeconds.html">Seconds</a>(-1));</div><div class="line"><a 
name="l00636"></a><span class="lineno">  636</span>&#160;<span 
class="keywordtype">bool</span> <a class="code" 
href="namespaceprocess.html#a07833fb41a8b0c1f18fa5485ca8c18d4">wait</a>(<span 
class="keyword">const</span> <a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>* process, <span 
class="keyword">const</span> <a class="code" 
href="classDuration.html">Duration</a>&amp; duration = <a class="code" 
href="classSeconds.html">Seconds</a>(-1));</div><div class="line"><a 
name="l00637"></a><span class="lineno">  637</span>&#160;</div><div 
class="line"><a name="l00638"></a><span class="lineno">  
638</span>&#160;</div><div class="line"><a nam
 e="l00647"></a><span class="lineno">  647</span>&#160;<span 
class="keywordtype">void</span> <a class="code" 
href="namespaceprocess.html#a2b0f5478fa6a52497167aa994ff600d9">post</a>(<span 
class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; to,</div><div class="line"><a 
name="l00648"></a><span class="lineno">  648</span>&#160;          <span 
class="keyword">const</span> std::string&amp; name,</div><div class="line"><a 
name="l00649"></a><span class="lineno">  649</span>&#160;          <span 
class="keyword">const</span> <span class="keywordtype">char</span>* data = 
<span class="keyword">nullptr</span>,</div><div class="line"><a 
name="l00650"></a><span class="lineno">  650</span>&#160;          <span 
class="keywordtype">size_t</span> length = 0);</div><div class="line"><a 
name="l00651"></a><span class="lineno">  651</span>&#160;</div><div 
class="line"><a name="l00652"></a><span class="lineno">  
652</span>&#160;</div><div class="line"><a name="l0065
 3"></a><span class="lineno">  653</span>&#160;<span 
class="keywordtype">void</span> <a class="code" 
href="namespaceprocess.html#a2b0f5478fa6a52497167aa994ff600d9">post</a>(<span 
class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; from,</div><div class="line"><a 
name="l00654"></a><span class="lineno">  654</span>&#160;          <span 
class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; to,</div><div class="line"><a 
name="l00655"></a><span class="lineno">  655</span>&#160;          <span 
class="keyword">const</span> std::string&amp; name,</div><div class="line"><a 
name="l00656"></a><span class="lineno">  656</span>&#160;          <span 
class="keyword">const</span> <span class="keywordtype">char</span>* data = 
<span class="keyword">nullptr</span>,</div><div class="line"><a 
name="l00657"></a><span class="lineno">  657</span>&#160;          <span 
class="keywordtype">size_t</span> length = 0);</div><div class
 ="line"><a name="l00658"></a><span class="lineno">  658</span>&#160;</div><div 
class="line"><a name="l00659"></a><span class="lineno">  
659</span>&#160;</div><div class="line"><a name="l00663"></a><span 
class="lineno"><a class="line" 
href="namespaceprocess.html#ab170f191c9401ac8aebe6c998f037e05">  
663</a></span>&#160;<span class="keyword">inline</span> <span 
class="keywordtype">void</span> <a class="code" 
href="namespaceprocess.html#a20443908afa3212215166e26065349e5">terminate</a>(<span
 class="keyword">const</span> <a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>&amp; process, <span 
class="keywordtype">bool</span> inject)</div><div class="line"><a 
name="l00664"></a><span class="lineno">  664</span>&#160;{</div><div 
class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;  <a 
class="code" 
href="namespaceprocess.html#a20443908afa3212215166e26065349e5">terminate</a>(process.<a
 class="code" href="classprocess_1_1ProcessBase.html#a7ff87364baa799919
 01b8d73dc5c5fca">self</a>(), inject);</div><div class="line"><a 
name="l00666"></a><span class="lineno">  666</span>&#160;}</div><div 
class="line"><a name="l00667"></a><span class="lineno">  
667</span>&#160;</div><div class="line"><a name="l00668"></a><span 
class="lineno">  668</span>&#160;</div><div class="line"><a 
name="l00672"></a><span class="lineno"><a class="line" 
href="namespaceprocess.html#ad221ec78e643363af8ef18d303a2bd62">  
672</a></span>&#160;<span class="keyword">inline</span> <span 
class="keywordtype">void</span> <a class="code" 
href="namespaceprocess.html#a20443908afa3212215166e26065349e5">terminate</a>(<span
 class="keyword">const</span> <a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>* process, <span 
class="keywordtype">bool</span> inject)</div><div class="line"><a 
name="l00673"></a><span class="lineno">  673</span>&#160;{</div><div 
class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;  <a 
class="code" href="namespaceprocess.h
 tml#a20443908afa3212215166e26065349e5">terminate</a>(process-&gt;<a 
class="code" 
href="classprocess_1_1ProcessBase.html#a7ff87364baa79991901b8d73dc5c5fca">self</a>(),
 inject);</div><div class="line"><a name="l00675"></a><span class="lineno">  
675</span>&#160;}</div><div class="line"><a name="l00676"></a><span 
class="lineno">  676</span>&#160;</div><div class="line"><a 
name="l00677"></a><span class="lineno">  677</span>&#160;</div><div 
class="line"><a name="l00681"></a><span class="lineno"><a class="line" 
href="namespaceprocess.html#ae8b73cb98b07f3db5ebda5086a16ca37">  
681</a></span>&#160;<span class="keyword">inline</span> <span 
class="keywordtype">bool</span> <a class="code" 
href="namespaceprocess.html#a07833fb41a8b0c1f18fa5485ca8c18d4">wait</a>(<span 
class="keyword">const</span> <a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>&amp; process, <span 
class="keyword">const</span> <a class="code" 
href="classDuration.html">Duration</a>&amp; duration)</div><div clas
 s="line"><a name="l00682"></a><span class="lineno">  
682</span>&#160;{</div><div class="line"><a name="l00683"></a><span 
class="lineno">  683</span>&#160;  <span class="keywordflow">return</span> <a 
class="code" 
href="namespaceprocess.html#a07833fb41a8b0c1f18fa5485ca8c18d4">process::wait</a>(process.<a
 class="code" 
href="classprocess_1_1ProcessBase.html#a7ff87364baa79991901b8d73dc5c5fca">self</a>(),
 duration); <span class="comment">// Explicit to disambiguate.</span></div><div 
class="line"><a name="l00684"></a><span class="lineno">  
684</span>&#160;}</div><div class="line"><a name="l00685"></a><span 
class="lineno">  685</span>&#160;</div><div class="line"><a 
name="l00686"></a><span class="lineno">  686</span>&#160;</div><div 
class="line"><a name="l00690"></a><span class="lineno"><a class="line" 
href="namespaceprocess.html#a40ab1ce6cd5b7a2d4aebbeae60987bb1">  
690</a></span>&#160;<span class="keyword">inline</span> <span 
class="keywordtype">bool</span> <a class="code" href="namespacep
 rocess.html#a07833fb41a8b0c1f18fa5485ca8c18d4">wait</a>(<span 
class="keyword">const</span> <a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>* process, <span 
class="keyword">const</span> <a class="code" 
href="classDuration.html">Duration</a>&amp; duration)</div><div class="line"><a 
name="l00691"></a><span class="lineno">  691</span>&#160;{</div><div 
class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160;  
<span class="keywordflow">return</span> <a class="code" 
href="namespaceprocess.html#a07833fb41a8b0c1f18fa5485ca8c18d4">process::wait</a>(process-&gt;<a
 class="code" 
href="classprocess_1_1ProcessBase.html#a7ff87364baa79991901b8d73dc5c5fca">self</a>(),
 duration); <span class="comment">// Explicit to disambiguate.</span></div><div 
class="line"><a name="l00693"></a><span class="lineno">  
693</span>&#160;}</div><div class="line"><a name="l00694"></a><span 
class="lineno">  694</span>&#160;</div><div class="line"><a 
name="l00695"></a><span class="lin
 eno">  695</span>&#160;</div><div class="line"><a name="l00696"></a><span 
class="lineno">  696</span>&#160;<span class="comment">// Per thread process 
pointer.</span></div><div class="line"><a name="l00697"></a><span 
class="lineno">  697</span>&#160;<span class="keyword">extern</span> 
thread_local <a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>* <a class="code" 
href="namespaceprocess.html#a38fe32525523cce698493f5825a72a32">__process__</a>;</div><div
 class="line"><a name="l00698"></a><span class="lineno">  
698</span>&#160;</div><div class="line"><a name="l00699"></a><span 
class="lineno">  699</span>&#160;<span class="comment">// NOTE: Methods in this 
namespace should only be used in tests to</span></div><div class="line"><a 
name="l00700"></a><span class="lineno">  700</span>&#160;<span 
class="comment">// inject arbitrary events.</span></div><div class="line"><a 
name="l00701"></a><span class="lineno"><a class="line" 
href="namespaceprocess_1_1inject.html">  701<
 /a></span>&#160;<span class="keyword">namespace </span>inject {</div><div 
class="line"><a name="l00702"></a><span class="lineno">  
702</span>&#160;</div><div class="line"><a name="l00709"></a><span 
class="lineno">  709</span>&#160;<span class="keywordtype">bool</span> <a 
class="code" 
href="namespaceprocess_1_1inject.html#a17e94a83c103ebde55dfd48d9a6e4988">exited</a>(<span
 class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; from, <span 
class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; to);</div><div class="line"><a 
name="l00710"></a><span class="lineno">  710</span>&#160;</div><div 
class="line"><a name="l00711"></a><span class="lineno">  711</span>&#160;} 
<span class="comment">// namespace inject {</span></div><div class="line"><a 
name="l00712"></a><span class="lineno">  712</span>&#160;</div><div 
class="line"><a name="l00713"></a><span class="lineno">  713</span>&#160;} 
<span class="comment">// names
 pace process {</span></div><div class="line"><a name="l00714"></a><span 
class="lineno">  714</span>&#160;</div><div class="line"><a 
name="l00715"></a><span class="lineno">  715</span>&#160;<span 
class="preprocessor">#endif // __PROCESS_PROCESS_HPP__</span></div><div 
class="ttc" id="synchronized_8hpp_html"><div class="ttname"><a 
href="synchronized_8hpp.html">synchronized.hpp</a></div></div>
+<a href="libprocess_2include_2process_2process_8hpp.html">Go to the 
documentation of this file.</a><div class="fragment"><div class="line"><a 
name="l00001"></a><span class="lineno">    1</span>&#160;<span 
class="comment">// Licensed under the Apache License, Version 2.0 (the 
&quot;License&quot;);</span></div><div class="line"><a name="l00002"></a><span 
class="lineno">    2</span>&#160;<span class="comment">// you may not use this 
file except in compliance with the License.</span></div><div class="line"><a 
name="l00003"></a><span class="lineno">    3</span>&#160;<span 
class="comment">// You may obtain a copy of the License at</span></div><div 
class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span 
class="comment">//</span></div><div class="line"><a name="l00005"></a><span 
class="lineno">    5</span>&#160;<span class="comment">//     
http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a 
name="l00006"></a><span class="lineno">    6</span>&#1
 60;<span class="comment">//</span></div><div class="line"><a 
name="l00007"></a><span class="lineno">    7</span>&#160;<span 
class="comment">// Unless required by applicable law or agreed to in writing, 
software</span></div><div class="line"><a name="l00008"></a><span 
class="lineno">    8</span>&#160;<span class="comment">// distributed under the 
License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div 
class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span 
class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 
or implied.</span></div><div class="line"><a name="l00010"></a><span 
class="lineno">   10</span>&#160;<span class="comment">// See the License for 
the specific language governing permissions and</span></div><div 
class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span 
class="comment">// limitations under the License</span></div><div 
class="line"><a name="l00012"></a><span class="lineno">   12</
 span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno">  
 13</span>&#160;<span class="preprocessor">#ifndef 
__PROCESS_PROCESS_HPP__</span></div><div class="line"><a 
name="l00014"></a><span class="lineno">   14</span>&#160;<span 
class="preprocessor">#define __PROCESS_PROCESS_HPP__</span></div><div 
class="line"><a name="l00015"></a><span class="lineno">   
15</span>&#160;</div><div class="line"><a name="l00016"></a><span 
class="lineno">   16</span>&#160;<span class="preprocessor">#include 
&lt;stdint.h&gt;</span></div><div class="line"><a name="l00017"></a><span 
class="lineno">   17</span>&#160;</div><div class="line"><a 
name="l00018"></a><span class="lineno">   18</span>&#160;<span 
class="preprocessor">#include &lt;memory&gt;</span></div><div class="line"><a 
name="l00019"></a><span class="lineno">   19</span>&#160;<span 
class="preprocessor">#include &lt;map&gt;</span></div><div class="line"><a 
name="l00020"></a><span class="lineno">   20</span>&#160;<span class="p
 reprocessor">#include &lt;queue&gt;</span></div><div class="line"><a 
name="l00021"></a><span class="lineno">   21</span>&#160;<span 
class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a 
name="l00022"></a><span class="lineno">   22</span>&#160;</div><div 
class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="address_8hpp.html">process/address.hpp</a>&gt;</span></div><div 
class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="3rdparty_2libprocess_2include_2process_2authenticator_8hpp.html">process/authenticator.hpp</a>&gt;</span></div><div
 class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="clock_8hpp.html">process/clock.hpp</a>&gt;</span></div><div 
class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<
 span class="preprocessor">#include &lt;<a class="code" 
href="event_8hpp.html">process/event.hpp</a>&gt;</span></div><div 
class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="3rdparty_2libprocess_2include_2process_2filter_8hpp.html">process/filter.hpp</a>&gt;</span></div><div
 class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="firewall_8hpp.html">process/firewall.hpp</a>&gt;</span></div><div 
class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="3rdparty_2libprocess_2include_2process_2http_8hpp.html">process/http.hpp</a>&gt;</span></div><div
 class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="3rdparty_2libprocess_2include_2process_2message_8hpp.html">process/mes
 sage.hpp</a>&gt;</span></div><div class="line"><a name="l00031"></a><span 
class="lineno">   31</span>&#160;<span class="preprocessor">#include &lt;<a 
class="code" href="mime_8hpp.html">process/mime.hpp</a>&gt;</span></div><div 
class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="owned_8hpp.html">process/owned.hpp</a>&gt;</span></div><div 
class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="3rdparty_2libprocess_2include_2process_2pid_8hpp.html">process/pid.hpp</a>&gt;</span></div><div
 class="line"><a name="l00034"></a><span class="lineno">   
34</span>&#160;</div><div class="line"><a name="l00035"></a><span 
class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;<a 
class="code" 
href="duration_8hpp.html">stout/duration.hpp</a>&gt;</span></div><div 
class="line"><a name="l00036"></a><span class="lineno">   36<
 /span>&#160;<span class="preprocessor">#include &lt;<a class="code" 
href="hashmap_8hpp.html">stout/hashmap.hpp</a>&gt;</span></div><div 
class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="lambda_8hpp.html">stout/lambda.hpp</a>&gt;</span></div><div 
class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="option_8hpp.html">stout/option.hpp</a>&gt;</span></div><div 
class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span 
class="preprocessor">#include &lt;<a class="code" 
href="synchronized_8hpp.html">stout/synchronized.hpp</a>&gt;</span></div><div 
class="line"><a name="l00040"></a><span class="lineno">   
40</span>&#160;</div><div class="line"><a name="l00041"></a><span 
class="lineno">   41</span>&#160;<span class="keyword">namespace </span><a 
class="code" href="namespaceprocess.html">process</a> {</div><div
  class="line"><a name="l00042"></a><span class="lineno">   
42</span>&#160;</div><div class="line"><a name="l00043"></a><span 
class="lineno">   43</span>&#160;<span class="comment">// Forward 
declaration.</span></div><div class="line"><a name="l00044"></a><span 
class="lineno">   44</span>&#160;<span class="keyword">class 
</span>EventQueue;</div><div class="line"><a name="l00045"></a><span 
class="lineno">   45</span>&#160;<span class="keyword">class 
</span>Gate;</div><div class="line"><a name="l00046"></a><span class="lineno">  
 46</span>&#160;<span class="keyword">class </span>Logging;</div><div 
class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span 
class="keyword">class </span>Sequence;</div><div class="line"><a 
name="l00048"></a><span class="lineno">   48</span>&#160;</div><div 
class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span 
class="keyword">namespace </span>firewall {</div><div class="line"><a 
name="l00050"></a><span class="lin
 eno">   50</span>&#160;</div><div class="line"><a name="l00068"></a><span 
class="lineno">   68</span>&#160;<span class="keywordtype">void</span> <a 
class="code" 
href="namespaceprocess_1_1firewall.html#a99a70c4d8e775bb1692693ec278d0877">install</a>(std::vector&lt;Owned&lt;FirewallRule&gt;&gt;&amp;&amp;
 rules);</div><div class="line"><a name="l00069"></a><span class="lineno">   
69</span>&#160;</div><div class="line"><a name="l00070"></a><span 
class="lineno">   70</span>&#160;} <span class="comment">// namespace firewall 
{</span></div><div class="line"><a name="l00071"></a><span class="lineno">   
71</span>&#160;</div><div class="line"><a name="l00072"></a><span 
class="lineno"><a class="line" href="classprocess_1_1ProcessBase.html">   
72</a></span>&#160;<span class="keyword">class </span><a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a> : <span 
class="keyword">public</span> <a class="code" 
href="structprocess_1_1EventConsumer.html">EventConsumer</a></div><div class
 ="line"><a name="l00073"></a><span class="lineno">   
73</span>&#160;{</div><div class="line"><a name="l00074"></a><span 
class="lineno">   74</span>&#160;<span class="keyword">public</span>:</div><div 
class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  
<span class="keyword">explicit</span> <a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>(<span 
class="keyword">const</span> std::string&amp; <span 
class="keywordtype">id</span> = <span 
class="stringliteral">&quot;&quot;</span>);</div><div class="line"><a 
name="l00076"></a><span class="lineno">   76</span>&#160;</div><div 
class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  
<span class="keyword">virtual</span> ~<a class="code" 
href="classprocess_1_1ProcessBase.html">ProcessBase</a>();</div><div 
class="line"><a name="l00078"></a><span class="lineno">   
78</span>&#160;</div><div class="line"><a name="l00079"></a><span 
class="lineno"><a class="line" href="classprocess_1_1Pro
 cessBase.html#a7ff87364baa79991901b8d73dc5c5fca">   79</a></span>&#160;  <span 
class="keyword">const</span> <a class="code" 
href="structprocess_1_1UPID.html">UPID</a>&amp; <span 
class="keyword">self</span>() <span class="keyword">const</span> { <span 
class="keywordflow">return</span> pid; }</div><div class="line"><a 
name="l00080"></a><span class="lineno">   80</span>&#160;</div><div 
class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span 
class="keyword">protected</span>:</div><div class="line"><a 
name="l00085"></a><span class="lineno"><a class="line" 
href="classprocess_1_1ProcessBase.html#a2accda04cb99a8337c501958ff85ce01">   
85</a></s

<TRUNCATED>

Reply via email to