mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-23 12:35:50 +00:00
deploy: 6534757d85
This commit is contained in:
@@ -91,116 +91,114 @@ $(function() {
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <boost/optional.hpp></span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/condition_variable.html">condition_variable</a>></span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/functional.html">functional</a>></span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/mutex.html">mutex</a>></span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/thread.html">thread</a>></span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/vector.html">vector</a>></span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacebeast.html">beast</a> {</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="namespacebeast_1_1test.html"> 22</a></span><span class="keyword">namespace </span>test {</div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html"> 30</a></span><span class="keyword">class </span><a class="code hl_class" href="classbeast_1_1test_1_1enable__yield__to.html">enable_yield_to</a></div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span>{</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="keyword">protected</span>:</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0"> 33</a></span> boost::asio::io_service <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0">ios_</a>;</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="keyword">private</span>:</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a6d28d5bdfb18c54c0d12ec1832352bca"> 36</a></span> boost::optional<boost::asio::io_service::work> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a6d28d5bdfb18c54c0d12ec1832352bca">work_</a>;</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#aca4940910f75e655a6d47d8363496fbc"> 37</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::thread></a> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#aca4940910f75e655a6d47d8363496fbc">threads_</a>;</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a3f6b147fb7df18f9344cfd33b68305ee"> 38</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/thread/mutex.html">std::mutex</a> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a3f6b147fb7df18f9344cfd33b68305ee">m_</a>;</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a52f1f5d44106a2a01bd690cf5791542f"> 39</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/thread/condition_variable.html">std::condition_variable</a> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a52f1f5d44106a2a01bd690cf5791542f">cv_</a>;</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a2f3d805b9b02be4d295ee8e66c21a47e"> 40</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a2f3d805b9b02be4d295ee8e66c21a47e">running_</a> = 0;</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a431255178ff3bda7a31296d830d5c504"> 44</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classbeast_1_1test_1_1enable__yield__to.html#a431255178ff3bda7a31296d830d5c504">yield_context</a> = boost::asio::yield_context;</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a28026f7d95dd5784e15b6985953f6912"> 46</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#a28026f7d95dd5784e15b6985953f6912">enable_yield_to</a>(<a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a> concurrency = 1) : <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a6d28d5bdfb18c54c0d12ec1832352bca">work_</a>(<a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0">ios_</a>)</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#aca4940910f75e655a6d47d8363496fbc">threads_</a>.<a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/container/vector/reserve.html">reserve</a>(concurrency);</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">while</span> (concurrency--)</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#aca4940910f75e655a6d47d8363496fbc">threads_</a>.<a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html">emplace_back</a>([&] { <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0">ios_</a>.run(); });</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> }</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#aaabb0659d5957fcafde65bc87870dd57"> 53</a></span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#aaabb0659d5957fcafde65bc87870dd57">~enable_yield_to</a>()</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> {</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a6d28d5bdfb18c54c0d12ec1832352bca">work_</a> = boost::none;</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>& t : <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#aca4940910f75e655a6d47d8363496fbc">threads_</a>)</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> t.join();</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> }</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> boost::asio::io_service&</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#abb142c7d4539816aa4d3c37d4ac28950"> 62</a></span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#abb142c7d4539816aa4d3c37d4ac28950">get_io_service</a>()</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> {</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0">ios_</a>;</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> }</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> </div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span><span class="preprocessor">#if BEAST_DOXYGEN</span></div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keyword">template</span> <<span class="keyword">class</span>... FN></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#a611cd725aff174c8578d112a122fe419">yield_to</a>(FN&&... fn);</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span><span class="preprocessor">#else</span></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keyword">template</span> <<span class="keyword">class </span>F0, <span class="keyword">class</span>... FN></div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#a611cd725aff174c8578d112a122fe419">yield_to</a>(F0&& f0, FN&&... fn);</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="keyword">private</span>:</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992"> 90</a></span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992">spawn</a>()</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> {</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> }</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keyword">template</span> <<span class="keyword">class </span>F0, <span class="keyword">class</span>... FN></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992">spawn</a>(F0&& f, FN&&... fn);</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span>};</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="keyword">template</span> <<span class="keyword">class </span>F0, <span class="keyword">class</span>... FN></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="keywordtype">void</span></div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a611cd725aff174c8578d112a122fe419"> 101</a></span><a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#a611cd725aff174c8578d112a122fe419">enable_yield_to::yield_to</a>(F0&& f0, FN&&... fn)</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span>{</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a2f3d805b9b02be4d295ee8e66c21a47e">running_</a> = 1 + <span class="keyword">sizeof</span>...(FN);</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992">spawn</a>(f0, fn...);</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/thread/unique_lock.html">std::unique_lock<std::mutex></a> lock{<a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a3f6b147fb7df18f9344cfd33b68305ee">m_</a>};</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a52f1f5d44106a2a01bd690cf5791542f">cv_</a>.<a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/thread/condition_variable/wait.html">wait</a>(lock, [&] { <span class="keywordflow">return</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a2f3d805b9b02be4d295ee8e66c21a47e">running_</a> == 0; });</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span>}</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> </div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span><span class="keyword">template</span> <<span class="keyword">class </span>F0, <span class="keyword">class</span>... FN></div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span><span class="keyword">inline</span> <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#ae5e5e8c703a37a75b53d23490d28c741"> 111</a></span><a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992">enable_yield_to::spawn</a>(F0&& f, FN&&... fn)</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span>{</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> boost::asio::spawn(</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0">ios_</a>,</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> [&](<a class="code hl_typedef" href="classbeast_1_1test_1_1enable__yield__to.html#a431255178ff3bda7a31296d830d5c504">yield_context</a> yield) {</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> f(yield);</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/thread/lock_guard.html">std::lock_guard</a> lock{<a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a3f6b147fb7df18f9344cfd33b68305ee">m_</a>};</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">if</span> (--<a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a2f3d805b9b02be4d295ee8e66c21a47e">running_</a> == 0)</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a52f1f5d44106a2a01bd690cf5791542f">cv_</a>.<a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/thread/condition_variable/notify_all.html">notify_all</a>();</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> },</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> boost::coroutines::attributes(2 * 1024 * 1024));</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992">spawn</a>(fn...);</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span>}</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span>} <span class="comment">// namespace test</span></div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span>} <span class="comment">// namespace beast</span></div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html">beast::test::enable_yield_to</a></div><div class="ttdoc">Mix-in to support tests using asio coroutines.</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00030">yield_to.h:31</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a28026f7d95dd5784e15b6985953f6912"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a28026f7d95dd5784e15b6985953f6912">beast::test::enable_yield_to::enable_yield_to</a></div><div class="ttdeci">enable_yield_to(std::size_t concurrency=1)</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00046">yield_to.h:46</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a2f3d805b9b02be4d295ee8e66c21a47e"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a2f3d805b9b02be4d295ee8e66c21a47e">beast::test::enable_yield_to::running_</a></div><div class="ttdeci">std::size_t running_</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00040">yield_to.h:40</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a3f6b147fb7df18f9344cfd33b68305ee"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a3f6b147fb7df18f9344cfd33b68305ee">beast::test::enable_yield_to::m_</a></div><div class="ttdeci">std::mutex m_</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00038">yield_to.h:38</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a431255178ff3bda7a31296d830d5c504"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a431255178ff3bda7a31296d830d5c504">beast::test::enable_yield_to::yield_context</a></div><div class="ttdeci">boost::asio::yield_context yield_context</div><div class="ttdoc">The type of yield context passed to functions.</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00044">yield_to.h:44</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a52f1f5d44106a2a01bd690cf5791542f"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a52f1f5d44106a2a01bd690cf5791542f">beast::test::enable_yield_to::cv_</a></div><div class="ttdeci">std::condition_variable cv_</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00039">yield_to.h:39</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a611cd725aff174c8578d112a122fe419"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a611cd725aff174c8578d112a122fe419">beast::test::enable_yield_to::yield_to</a></div><div class="ttdeci">void yield_to(F0 &&f0, FN &&... fn)</div><div class="ttdoc">Run one or more functions, each in a coroutine.</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00101">yield_to.h:101</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a6d28d5bdfb18c54c0d12ec1832352bca"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a6d28d5bdfb18c54c0d12ec1832352bca">beast::test::enable_yield_to::work_</a></div><div class="ttdeci">boost::optional< boost::asio::io_service::work > work_</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00036">yield_to.h:36</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_aaabb0659d5957fcafde65bc87870dd57"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#aaabb0659d5957fcafde65bc87870dd57">beast::test::enable_yield_to::~enable_yield_to</a></div><div class="ttdeci">~enable_yield_to()</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00053">yield_to.h:53</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_abb142c7d4539816aa4d3c37d4ac28950"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#abb142c7d4539816aa4d3c37d4ac28950">beast::test::enable_yield_to::get_io_service</a></div><div class="ttdeci">boost::asio::io_service & get_io_service()</div><div class="ttdoc">Return the io_service associated with the object.</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00062">yield_to.h:62</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_ac043a57142d6c9afd9b608c732de6992"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992">beast::test::enable_yield_to::spawn</a></div><div class="ttdeci">void spawn()</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00090">yield_to.h:90</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_aca4940910f75e655a6d47d8363496fbc"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#aca4940910f75e655a6d47d8363496fbc">beast::test::enable_yield_to::threads_</a></div><div class="ttdeci">std::vector< std::thread > threads_</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00037">yield_to.h:37</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_afe3afff6f26cf0e761df6edfc80ac7c0"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0">beast::test::enable_yield_to::ios_</a></div><div class="ttdeci">boost::asio::io_service ios_</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00033">yield_to.h:33</a></div></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/mutex.html">mutex</a>></span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/thread.html">thread</a>></span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/vector.html">vector</a>></span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacebeast.html">beast</a> {</div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="namespacebeast_1_1test.html"> 21</a></span><span class="keyword">namespace </span>test {</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html"> 29</a></span><span class="keyword">class </span><a class="code hl_class" href="classbeast_1_1test_1_1enable__yield__to.html">enable_yield_to</a></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span>{</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword">protected</span>:</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0"> 32</a></span> boost::asio::io_service <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0">ios_</a>;</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="keyword">private</span>:</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a6d28d5bdfb18c54c0d12ec1832352bca"> 35</a></span> boost::optional<boost::asio::io_service::work> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a6d28d5bdfb18c54c0d12ec1832352bca">work_</a>;</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#aca4940910f75e655a6d47d8363496fbc"> 36</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::thread></a> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#aca4940910f75e655a6d47d8363496fbc">threads_</a>;</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a3f6b147fb7df18f9344cfd33b68305ee"> 37</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/thread/mutex.html">std::mutex</a> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a3f6b147fb7df18f9344cfd33b68305ee">m_</a>;</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a52f1f5d44106a2a01bd690cf5791542f"> 38</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/thread/condition_variable.html">std::condition_variable</a> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a52f1f5d44106a2a01bd690cf5791542f">cv_</a>;</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a2f3d805b9b02be4d295ee8e66c21a47e"> 39</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a2f3d805b9b02be4d295ee8e66c21a47e">running_</a> = 0;</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a431255178ff3bda7a31296d830d5c504"> 43</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classbeast_1_1test_1_1enable__yield__to.html#a431255178ff3bda7a31296d830d5c504">yield_context</a> = boost::asio::yield_context;</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> </div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a28026f7d95dd5784e15b6985953f6912"> 45</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#a28026f7d95dd5784e15b6985953f6912">enable_yield_to</a>(<a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a> concurrency = 1) : <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a6d28d5bdfb18c54c0d12ec1832352bca">work_</a>(<a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0">ios_</a>)</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> {</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#aca4940910f75e655a6d47d8363496fbc">threads_</a>.<a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/container/vector/reserve.html">reserve</a>(concurrency);</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">while</span> (concurrency--)</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#aca4940910f75e655a6d47d8363496fbc">threads_</a>.<a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html">emplace_back</a>([&] { <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0">ios_</a>.run(); });</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#aaabb0659d5957fcafde65bc87870dd57"> 52</a></span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#aaabb0659d5957fcafde65bc87870dd57">~enable_yield_to</a>()</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> {</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a6d28d5bdfb18c54c0d12ec1832352bca">work_</a> = boost::none;</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>& t : <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#aca4940910f75e655a6d47d8363496fbc">threads_</a>)</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> t.join();</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> }</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> </div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> boost::asio::io_service&</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#abb142c7d4539816aa4d3c37d4ac28950"> 61</a></span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#abb142c7d4539816aa4d3c37d4ac28950">get_io_service</a>()</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> {</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0">ios_</a>;</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> }</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="preprocessor">#if BEAST_DOXYGEN</span></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keyword">template</span> <<span class="keyword">class</span>... FN></div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#a611cd725aff174c8578d112a122fe419">yield_to</a>(FN&&... fn);</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="preprocessor">#else</span></div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keyword">template</span> <<span class="keyword">class </span>F0, <span class="keyword">class</span>... FN></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#a611cd725aff174c8578d112a122fe419">yield_to</a>(F0&& f0, FN&&... fn);</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> </div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span><span class="keyword">private</span>:</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992"> 89</a></span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992">spawn</a>()</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> {</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> }</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keyword">template</span> <<span class="keyword">class </span>F0, <span class="keyword">class</span>... FN></div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992">spawn</a>(F0&& f, FN&&... fn);</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span>};</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> </div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="keyword">template</span> <<span class="keyword">class </span>F0, <span class="keyword">class</span>... FN></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="keywordtype">void</span></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#a611cd725aff174c8578d112a122fe419"> 100</a></span><a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#a611cd725aff174c8578d112a122fe419">enable_yield_to::yield_to</a>(F0&& f0, FN&&... fn)</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span>{</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a2f3d805b9b02be4d295ee8e66c21a47e">running_</a> = 1 + <span class="keyword">sizeof</span>...(FN);</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992">spawn</a>(f0, fn...);</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/thread/unique_lock.html">std::unique_lock<std::mutex></a> lock{<a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a3f6b147fb7df18f9344cfd33b68305ee">m_</a>};</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a52f1f5d44106a2a01bd690cf5791542f">cv_</a>.<a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/thread/condition_variable/wait.html">wait</a>(lock, [&] { <span class="keywordflow">return</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a2f3d805b9b02be4d295ee8e66c21a47e">running_</a> == 0; });</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span>}</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> </div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span><span class="keyword">template</span> <<span class="keyword">class </span>F0, <span class="keyword">class</span>... FN></div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span><span class="keyword">inline</span> <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="classbeast_1_1test_1_1enable__yield__to.html#ae5e5e8c703a37a75b53d23490d28c741"> 110</a></span><a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992">enable_yield_to::spawn</a>(F0&& f, FN&&... fn)</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span>{</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> boost::asio::spawn(</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0">ios_</a>,</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> [&](<a class="code hl_typedef" href="classbeast_1_1test_1_1enable__yield__to.html#a431255178ff3bda7a31296d830d5c504">yield_context</a> yield) {</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> f(yield);</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/thread/lock_guard.html">std::lock_guard</a> lock{<a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a3f6b147fb7df18f9344cfd33b68305ee">m_</a>};</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">if</span> (--<a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a2f3d805b9b02be4d295ee8e66c21a47e">running_</a> == 0)</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <a class="code hl_variable" href="classbeast_1_1test_1_1enable__yield__to.html#a52f1f5d44106a2a01bd690cf5791542f">cv_</a>.<a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/thread/condition_variable/notify_all.html">notify_all</a>();</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> },</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> boost::coroutines::attributes(2 * 1024 * 1024));</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <a class="code hl_function" href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992">spawn</a>(fn...);</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span>}</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> </div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span>} <span class="comment">// namespace test</span></div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span>} <span class="comment">// namespace beast</span></div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> </div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html">beast::test::enable_yield_to</a></div><div class="ttdoc">Mix-in to support tests using asio coroutines.</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00029">yield_to.h:30</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a28026f7d95dd5784e15b6985953f6912"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a28026f7d95dd5784e15b6985953f6912">beast::test::enable_yield_to::enable_yield_to</a></div><div class="ttdeci">enable_yield_to(std::size_t concurrency=1)</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00045">yield_to.h:45</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a2f3d805b9b02be4d295ee8e66c21a47e"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a2f3d805b9b02be4d295ee8e66c21a47e">beast::test::enable_yield_to::running_</a></div><div class="ttdeci">std::size_t running_</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00039">yield_to.h:39</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a3f6b147fb7df18f9344cfd33b68305ee"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a3f6b147fb7df18f9344cfd33b68305ee">beast::test::enable_yield_to::m_</a></div><div class="ttdeci">std::mutex m_</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00037">yield_to.h:37</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a431255178ff3bda7a31296d830d5c504"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a431255178ff3bda7a31296d830d5c504">beast::test::enable_yield_to::yield_context</a></div><div class="ttdeci">boost::asio::yield_context yield_context</div><div class="ttdoc">The type of yield context passed to functions.</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00043">yield_to.h:43</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a52f1f5d44106a2a01bd690cf5791542f"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a52f1f5d44106a2a01bd690cf5791542f">beast::test::enable_yield_to::cv_</a></div><div class="ttdeci">std::condition_variable cv_</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00038">yield_to.h:38</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a611cd725aff174c8578d112a122fe419"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a611cd725aff174c8578d112a122fe419">beast::test::enable_yield_to::yield_to</a></div><div class="ttdeci">void yield_to(F0 &&f0, FN &&... fn)</div><div class="ttdoc">Run one or more functions, each in a coroutine.</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00100">yield_to.h:100</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_a6d28d5bdfb18c54c0d12ec1832352bca"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#a6d28d5bdfb18c54c0d12ec1832352bca">beast::test::enable_yield_to::work_</a></div><div class="ttdeci">boost::optional< boost::asio::io_service::work > work_</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00035">yield_to.h:35</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_aaabb0659d5957fcafde65bc87870dd57"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#aaabb0659d5957fcafde65bc87870dd57">beast::test::enable_yield_to::~enable_yield_to</a></div><div class="ttdeci">~enable_yield_to()</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00052">yield_to.h:52</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_abb142c7d4539816aa4d3c37d4ac28950"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#abb142c7d4539816aa4d3c37d4ac28950">beast::test::enable_yield_to::get_io_service</a></div><div class="ttdeci">boost::asio::io_service & get_io_service()</div><div class="ttdoc">Return the io_service associated with the object.</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00061">yield_to.h:61</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_ac043a57142d6c9afd9b608c732de6992"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#ac043a57142d6c9afd9b608c732de6992">beast::test::enable_yield_to::spawn</a></div><div class="ttdeci">void spawn()</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00089">yield_to.h:89</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_aca4940910f75e655a6d47d8363496fbc"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#aca4940910f75e655a6d47d8363496fbc">beast::test::enable_yield_to::threads_</a></div><div class="ttdeci">std::vector< std::thread > threads_</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00036">yield_to.h:36</a></div></div>
|
||||
<div class="ttc" id="aclassbeast_1_1test_1_1enable__yield__to_html_afe3afff6f26cf0e761df6edfc80ac7c0"><div class="ttname"><a href="classbeast_1_1test_1_1enable__yield__to.html#afe3afff6f26cf0e761df6edfc80ac7c0">beast::test::enable_yield_to::ios_</a></div><div class="ttdeci">boost::asio::io_service ios_</div><div class="ttdef"><b>Definition:</b> <a href="yield__to_8h_source.html#l00032">yield_to.h:32</a></div></div>
|
||||
<div class="ttc" id="acondition_variable_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/condition_variable.html">condition_variable</a></div></div>
|
||||
<div class="ttc" id="aemplace_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/emplace_back.html">std::vector::emplace_back</a></div><div class="ttdeci">T emplace_back(T... args)</div></div>
|
||||
<div class="ttc" id="afunctional_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/functional.html">functional</a></div></div>
|
||||
<div class="ttc" id="alock_guard_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/thread/lock_guard.html">std::lock_guard</a></div></div>
|
||||
<div class="ttc" id="amutex_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/mutex.html">mutex</a></div></div>
|
||||
<div class="ttc" id="anamespacebeast_html"><div class="ttname"><a href="namespacebeast.html">beast</a></div><div class="ttdef"><b>Definition:</b> <a href="base__uint_8h_source.html#l00662">base_uint.h:662</a></div></div>
|
||||
|
||||
Reference in New Issue
Block a user