blob: 0169cc4fc530d7aa27e257f4a815124d38844ce9 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="canonical" href="https://ignite.apache.org/releases/2.9.0/cppdoc/future_8h_source.html" />
<META NAME="ROBOTS" CONTENT="NOINDEX">
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>&nbsp; Apache Ignite C++: future.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-61232409-1', 'auto');
ga('send', 'pageview');
</script></head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="ignite_logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">&nbsp; Apache Ignite C++
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_bdd9a5d540de89e9fe90efdfc6973a4f.html">common</a></li><li class="navelem"><a class="el" href="dir_11fbc4217d50ab21044e5ad6614aede5.html">include</a></li><li class="navelem"><a class="el" href="dir_2dedece15635f75054d44afc50ccfbaf.html">ignite</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">future.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="future_8h.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">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> * contributor license agreements. See the NOTICE file distributed with</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * this work for additional information regarding copyright ownership.</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance with</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * the License. You may obtain a copy of the License at</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</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="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#ifndef _IGNITE_FUTURE</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#define _IGNITE_FUTURE</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;ignite/common/shared_state.h&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="ignite__error_8h.html">ignite/ignite_error.h</a>&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceignite.html">ignite</a></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;{</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; <span class="keyword">namespace </span>common</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; {</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="comment">// Forward declaration</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="classignite_1_1common_1_1Promise.html"> 36</a></span>&#160; <span class="keyword">class </span><a class="code" href="classignite_1_1common_1_1Promise.html">Promise</a>;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; }</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html"> 46</a></span>&#160; <span class="keyword">class </span><a class="code" href="classignite_1_1Future.html">Future</a></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; {</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classignite_1_1common_1_1Promise.html">common::Promise</a>&lt;T&gt;;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#a9d30e65c248b3b2dddb620bf99e0c06a"> 52</a></span>&#160; <span class="keyword">typedef</span> T <a class="code" href="classignite_1_1Future.html#a9d30e65c248b3b2dddb620bf99e0c06a">ValueType</a>;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#a5dd1c5eb96ad2d3cae49f03cfd7b7c8d"> 59</a></span>&#160; <a class="code" href="classignite_1_1Future.html#a5dd1c5eb96ad2d3cae49f03cfd7b7c8d">Future</a>(<span class="keyword">const</span> <a class="code" href="classignite_1_1Future.html">Future&lt;ValueType&gt;</a>&amp; src) :</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; state(src.state)</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; {</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="comment">// No-op.</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; }</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#ab22e443f0d35cecfdd677dc237c0c4f7"> 71</a></span>&#160; <a class="code" href="classignite_1_1Future.html">Future</a>&amp; <a class="code" href="classignite_1_1Future.html#ab22e443f0d35cecfdd677dc237c0c4f7">operator=</a>(<span class="keyword">const</span> <a class="code" href="classignite_1_1Future.html">Future&lt;ValueType&gt;</a>&amp; other)</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; {</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; state = other.state;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordflow">return</span> *<span class="keyword">this</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;</div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#a924add850583c8a9957624532b5d5072"> 82</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classignite_1_1Future.html#a924add850583c8a9957624532b5d5072">Wait</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keyword">const</span> common::SharedState&lt;ValueType&gt;* state0 = state.Get();</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; assert(state0 != 0);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; state0-&gt;Wait();</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;</div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#aa0cde9bfdea20adf70231b48d57e449a"> 98</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classignite_1_1Future.html#aa0cde9bfdea20adf70231b48d57e449a">WaitFor</a>(int32_t msTimeout)<span class="keyword"> const</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keyword">const</span> common::SharedState&lt;ValueType&gt;* state0 = state.Get();</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; assert(state0 != 0);</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordflow">return</span> state0-&gt;WaitFor(msTimeout);</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; }</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#acb63f3a5780e1b462555cfc45044d0c8"> 114</a></span>&#160; <span class="keyword">const</span> ValueType&amp; <a class="code" href="classignite_1_1Future.html#acb63f3a5780e1b462555cfc45044d0c8">GetValue</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keyword">const</span> common::SharedState&lt;ValueType&gt;* state0 = state.Get();</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; assert(state0 != 0);</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordflow">return</span> state0-&gt;GetValue();</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; }</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#a01ea459a52a53e861c22d7c1ba6669d1"> 126</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classignite_1_1Future.html#a01ea459a52a53e861c22d7c1ba6669d1">Cancel</a>()</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; {</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; common::SharedState&lt;ValueType&gt;* state0 = state.Get();</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; assert(state0 != 0);</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; state0-&gt;Cancel();</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; }</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#abd7a19a568856867d220383751af553b"> 138</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classignite_1_1Future.html#abd7a19a568856867d220383751af553b">IsReady</a>()</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; {</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; common::SharedState&lt;ValueType&gt;* state0 = state.Get();</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; assert(state0 != 0);</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keywordflow">return</span> state0-&gt;IsSet();</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; }</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <a class="code" href="classignite_1_1Future.html">Future</a>(common::concurrent::SharedPointer&lt; common::SharedState&lt;ValueType&gt; &gt; state0) :</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; state(state0)</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; {</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="comment">// No-op.</span></div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; }</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; common::concurrent::SharedPointer&lt; common::SharedState&lt;ValueType&gt; &gt; state;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; };</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="keyword">template</span>&lt;&gt;</div><div class="line"><a name="l00167"></a><span class="lineno"><a class="line" href="classignite_1_1Future_3_01void_01_4.html"> 167</a></span>&#160; <span class="keyword">class </span><a class="code" href="classignite_1_1Future.html">Future</a>&lt;void&gt;</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; {</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classignite_1_1common_1_1Promise.html">common::Promise</a>&lt;void&gt;;</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00173"></a><span class="lineno"><a class="line" href="classignite_1_1Future_3_01void_01_4.html#ab0fe288cfa7d13ef9f2243f6313990d7"> 173</a></span>&#160; <span class="keyword">typedef</span> <span class="keywordtype">void</span> <a class="code" href="classignite_1_1Future_3_01void_01_4.html#ab0fe288cfa7d13ef9f2243f6313990d7">ValueType</a>;</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;</div><div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="classignite_1_1Future_3_01void_01_4.html#a759984cc1557ce3ed6430a8f93e82f61"> 180</a></span>&#160; <a class="code" href="classignite_1_1Future_3_01void_01_4.html#a759984cc1557ce3ed6430a8f93e82f61">Future</a>(<span class="keyword">const</span> <a class="code" href="classignite_1_1Future.html">Future&lt;ValueType&gt;</a>&amp; src) :</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; state(src.state)</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; {</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="comment">// No-op.</span></div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; }</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;</div><div class="line"><a name="l00192"></a><span class="lineno"><a class="line" href="classignite_1_1Future_3_01void_01_4.html#ae5463b058aa141dc9321df728bed98d5"> 192</a></span>&#160; <a class="code" href="classignite_1_1Future.html">Future</a>&amp; <a class="code" href="classignite_1_1Future_3_01void_01_4.html#ae5463b058aa141dc9321df728bed98d5">operator=</a>(<span class="keyword">const</span> <a class="code" href="classignite_1_1Future.html">Future&lt;ValueType&gt;</a>&amp; other)</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; {</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; state = other.state;</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; }</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160;</div><div class="line"><a name="l00203"></a><span class="lineno"><a class="line" href="classignite_1_1Future_3_01void_01_4.html#abfb2edf9b58faafefa6ec5dde9d72ebe"> 203</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classignite_1_1Future_3_01void_01_4.html#abfb2edf9b58faafefa6ec5dde9d72ebe">Wait</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keyword">const</span> common::SharedState&lt;ValueType&gt;* state0 = state.Get();</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; assert(state0 != 0);</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; state0-&gt;Wait();</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; }</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160;</div><div class="line"><a name="l00219"></a><span class="lineno"><a class="line" href="classignite_1_1Future_3_01void_01_4.html#ab93e601bf38da51a4df68f592eeb6c3f"> 219</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classignite_1_1Future_3_01void_01_4.html#ab93e601bf38da51a4df68f592eeb6c3f">WaitFor</a>(int32_t msTimeout)<span class="keyword"> const</span></div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keyword">const</span> common::SharedState&lt;ValueType&gt;* state0 = state.Get();</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; assert(state0 != 0);</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <span class="keywordflow">return</span> state0-&gt;WaitFor(msTimeout);</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; }</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;</div><div class="line"><a name="l00234"></a><span class="lineno"><a class="line" href="classignite_1_1Future_3_01void_01_4.html#a9d915f14c46a3b5d2c8d43f78a9d2a37"> 234</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classignite_1_1Future_3_01void_01_4.html#a9d915f14c46a3b5d2c8d43f78a9d2a37">GetValue</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <span class="keyword">const</span> common::SharedState&lt;ValueType&gt;* state0 = state.Get();</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</span>&#160; assert(state0 != 0);</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; state0-&gt;GetValue();</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; }</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;</div><div class="line"><a name="l00246"></a><span class="lineno"><a class="line" href="classignite_1_1Future_3_01void_01_4.html#acca8bb514dd248d61bd28768fccb9cad"> 246</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classignite_1_1Future_3_01void_01_4.html#acca8bb514dd248d61bd28768fccb9cad">Cancel</a>()</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; {</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; common::SharedState&lt;ValueType&gt;* state0 = state.Get();</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; assert(state0 != 0);</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; state0-&gt;Cancel();</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; }</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;</div><div class="line"><a name="l00258"></a><span class="lineno"><a class="line" href="classignite_1_1Future_3_01void_01_4.html#af83cc0bc375a9f42b588362743832f39"> 258</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classignite_1_1Future_3_01void_01_4.html#af83cc0bc375a9f42b588362743832f39">IsReady</a>()</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; {</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; common::SharedState&lt;ValueType&gt;* state0 = state.Get();</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"> 262</span>&#160; assert(state0 != 0);</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; <span class="keywordflow">return</span> state0-&gt;IsSet();</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; }</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <a class="code" href="classignite_1_1Future.html">Future</a>(common::concurrent::SharedPointer&lt; common::SharedState&lt;ValueType&gt; &gt; state0) :</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; state(state0)</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; {</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="comment">// No-op.</span></div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; }</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160;</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; common::concurrent::SharedPointer&lt; common::SharedState&lt;ValueType&gt; &gt; state;</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; };</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160;}</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160;</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160;<span class="preprocessor">#endif //_IGNITE_FUTURE</span></div><div class="ttc" id="classignite_1_1Future_html_ab22e443f0d35cecfdd677dc237c0c4f7"><div class="ttname"><a href="classignite_1_1Future.html#ab22e443f0d35cecfdd677dc237c0c4f7">ignite::Future::operator=</a></div><div class="ttdeci">Future &amp; operator=(const Future&lt; ValueType &gt; &amp;other)</div><div class="ttdoc">Assignment operator. </div><div class="ttdef"><b>Definition:</b> future.h:71</div></div>
<div class="ttc" id="classignite_1_1Future_3_01void_01_4_html_acca8bb514dd248d61bd28768fccb9cad"><div class="ttname"><a href="classignite_1_1Future_3_01void_01_4.html#acca8bb514dd248d61bd28768fccb9cad">ignite::Future&lt; void &gt;::Cancel</a></div><div class="ttdeci">void Cancel()</div><div class="ttdoc">Cancel related operation. </div><div class="ttdef"><b>Definition:</b> future.h:246</div></div>
<div class="ttc" id="classignite_1_1Future_html_a01ea459a52a53e861c22d7c1ba6669d1"><div class="ttname"><a href="classignite_1_1Future.html#a01ea459a52a53e861c22d7c1ba6669d1">ignite::Future::Cancel</a></div><div class="ttdeci">void Cancel()</div><div class="ttdoc">Cancel related operation. </div><div class="ttdef"><b>Definition:</b> future.h:126</div></div>
<div class="ttc" id="classignite_1_1Future_html_aa0cde9bfdea20adf70231b48d57e449a"><div class="ttname"><a href="classignite_1_1Future.html#aa0cde9bfdea20adf70231b48d57e449a">ignite::Future::WaitFor</a></div><div class="ttdeci">bool WaitFor(int32_t msTimeout) const</div><div class="ttdoc">Wait for value to be set for specified time. </div><div class="ttdef"><b>Definition:</b> future.h:98</div></div>
<div class="ttc" id="classignite_1_1Future_html_abd7a19a568856867d220383751af553b"><div class="ttname"><a href="classignite_1_1Future.html#abd7a19a568856867d220383751af553b">ignite::Future::IsReady</a></div><div class="ttdeci">bool IsReady()</div><div class="ttdoc">Check if the future ready. </div><div class="ttdef"><b>Definition:</b> future.h:138</div></div>
<div class="ttc" id="classignite_1_1Future_html_acb63f3a5780e1b462555cfc45044d0c8"><div class="ttname"><a href="classignite_1_1Future.html#acb63f3a5780e1b462555cfc45044d0c8">ignite::Future::GetValue</a></div><div class="ttdeci">const ValueType &amp; GetValue() const</div><div class="ttdoc">Get the set value. </div><div class="ttdef"><b>Definition:</b> future.h:114</div></div>
<div class="ttc" id="classignite_1_1Future_3_01void_01_4_html_ae5463b058aa141dc9321df728bed98d5"><div class="ttname"><a href="classignite_1_1Future_3_01void_01_4.html#ae5463b058aa141dc9321df728bed98d5">ignite::Future&lt; void &gt;::operator=</a></div><div class="ttdeci">Future &amp; operator=(const Future&lt; ValueType &gt; &amp;other)</div><div class="ttdoc">Assignment operator. </div><div class="ttdef"><b>Definition:</b> future.h:192</div></div>
<div class="ttc" id="classignite_1_1Future_3_01void_01_4_html_a759984cc1557ce3ed6430a8f93e82f61"><div class="ttname"><a href="classignite_1_1Future_3_01void_01_4.html#a759984cc1557ce3ed6430a8f93e82f61">ignite::Future&lt; void &gt;::Future</a></div><div class="ttdeci">Future(const Future&lt; ValueType &gt; &amp;src)</div><div class="ttdoc">Copy constructor. </div><div class="ttdef"><b>Definition:</b> future.h:180</div></div>
<div class="ttc" id="classignite_1_1Future_3_01void_01_4_html_a9d915f14c46a3b5d2c8d43f78a9d2a37"><div class="ttname"><a href="classignite_1_1Future_3_01void_01_4.html#a9d915f14c46a3b5d2c8d43f78a9d2a37">ignite::Future&lt; void &gt;::GetValue</a></div><div class="ttdeci">void GetValue() const</div><div class="ttdoc">Wait for operation complition or error. </div><div class="ttdef"><b>Definition:</b> future.h:234</div></div>
<div class="ttc" id="classignite_1_1Future_3_01void_01_4_html_af83cc0bc375a9f42b588362743832f39"><div class="ttname"><a href="classignite_1_1Future_3_01void_01_4.html#af83cc0bc375a9f42b588362743832f39">ignite::Future&lt; void &gt;::IsReady</a></div><div class="ttdeci">bool IsReady()</div><div class="ttdoc">Check if the future ready. </div><div class="ttdef"><b>Definition:</b> future.h:258</div></div>
<div class="ttc" id="classignite_1_1common_1_1Promise_html"><div class="ttname"><a href="classignite_1_1common_1_1Promise.html">ignite::common::Promise</a></div><div class="ttdef"><b>Definition:</b> future.h:36</div></div>
<div class="ttc" id="classignite_1_1Future_3_01void_01_4_html_ab0fe288cfa7d13ef9f2243f6313990d7"><div class="ttname"><a href="classignite_1_1Future_3_01void_01_4.html#ab0fe288cfa7d13ef9f2243f6313990d7">ignite::Future&lt; void &gt;::ValueType</a></div><div class="ttdeci">void ValueType</div><div class="ttdoc">Template value type. </div><div class="ttdef"><b>Definition:</b> future.h:173</div></div>
<div class="ttc" id="classignite_1_1Future_html_a5dd1c5eb96ad2d3cae49f03cfd7b7c8d"><div class="ttname"><a href="classignite_1_1Future.html#a5dd1c5eb96ad2d3cae49f03cfd7b7c8d">ignite::Future::Future</a></div><div class="ttdeci">Future(const Future&lt; ValueType &gt; &amp;src)</div><div class="ttdoc">Copy constructor. </div><div class="ttdef"><b>Definition:</b> future.h:59</div></div>
<div class="ttc" id="classignite_1_1Future_3_01void_01_4_html_abfb2edf9b58faafefa6ec5dde9d72ebe"><div class="ttname"><a href="classignite_1_1Future_3_01void_01_4.html#abfb2edf9b58faafefa6ec5dde9d72ebe">ignite::Future&lt; void &gt;::Wait</a></div><div class="ttdeci">void Wait() const</div><div class="ttdoc">Wait for value to be set. </div><div class="ttdef"><b>Definition:</b> future.h:203</div></div>
<div class="ttc" id="classignite_1_1Future_html_a924add850583c8a9957624532b5d5072"><div class="ttname"><a href="classignite_1_1Future.html#a924add850583c8a9957624532b5d5072">ignite::Future::Wait</a></div><div class="ttdeci">void Wait() const</div><div class="ttdoc">Wait for value to be set. </div><div class="ttdef"><b>Definition:</b> future.h:82</div></div>
<div class="ttc" id="namespaceignite_html"><div class="ttname"><a href="namespaceignite.html">ignite</a></div><div class="ttdoc">Apache Ignite API. </div><div class="ttdef"><b>Definition:</b> cache.h:48</div></div>
<div class="ttc" id="classignite_1_1Future_html_a9d30e65c248b3b2dddb620bf99e0c06a"><div class="ttname"><a href="classignite_1_1Future.html#a9d30e65c248b3b2dddb620bf99e0c06a">ignite::Future::ValueType</a></div><div class="ttdeci">T ValueType</div><div class="ttdoc">Template value type. </div><div class="ttdef"><b>Definition:</b> future.h:52</div></div>
<div class="ttc" id="ignite__error_8h_html"><div class="ttname"><a href="ignite__error_8h.html">ignite_error.h</a></div><div class="ttdoc">Declares ignite::IgniteError class. </div></div>
<div class="ttc" id="classignite_1_1Future_3_01void_01_4_html_ab93e601bf38da51a4df68f592eeb6c3f"><div class="ttname"><a href="classignite_1_1Future_3_01void_01_4.html#ab93e601bf38da51a4df68f592eeb6c3f">ignite::Future&lt; void &gt;::WaitFor</a></div><div class="ttdeci">bool WaitFor(int32_t msTimeout) const</div><div class="ttdoc">Wait for value to be set for specified time. </div><div class="ttdef"><b>Definition:</b> future.h:219</div></div>
<div class="ttc" id="classignite_1_1Future_html"><div class="ttname"><a href="classignite_1_1Future.html">ignite::Future</a></div><div class="ttdoc">Future class template. </div><div class="ttdef"><b>Definition:</b> future.h:46</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Oct 15 2020 12:17:17 for &nbsp; Apache Ignite C++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>