| <!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.7.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.11"/> |
| <title> 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> |
| <script type="text/javascript"> |
| $(document).ready(function() { init_search(); }); |
| </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"> Apache Ignite C++ |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.8.11 --> |
| <script type="text/javascript"> |
| var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| </script> |
| <div id="navrow1" class="tabs"> |
| <ul class="tablist"> |
| <li><a href="index.html"><span>Main Page</span></a></li> |
| <li><a href="pages.html"><span>Related Pages</span></a></li> |
| <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
| <li><a href="annotated.html"><span>Classes</span></a></li> |
| <li class="current"><a href="files.html"><span>Files</span></a></li> |
| <li> |
| <div id="MSearchBox" class="MSearchBoxInactive"> |
| <span class="left"> |
| <img id="MSearchSelect" src="search/mag_sel.png" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| alt=""/> |
| <input type="text" id="MSearchField" value="Search" accesskey="S" |
| onfocus="searchBox.OnSearchFieldFocus(true)" |
| onblur="searchBox.OnSearchFieldFocus(false)" |
| onkeyup="searchBox.OnSearchFieldChange(event)"/> |
| </span><span class="right"> |
| <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> |
| </span> |
| </div> |
| </li> |
| </ul> |
| </div> |
| <div id="navrow2" class="tabs2"> |
| <ul class="tablist"> |
| <li><a href="files.html"><span>File List</span></a></li> |
| <li><a href="globals.html"><span>File Members</span></a></li> |
| </ul> |
| </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> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <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> <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> <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> <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> <span class="comment"> * (the "License"); you may not use this file except in compliance with</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <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> <span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <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> <span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <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> <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <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> <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> <span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> */</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#ifndef _IGNITE_FUTURE</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#define _IGNITE_FUTURE</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <ignite/common/shared_state.h></span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include <<a class="code" href="ignite__error_8h.html">ignite/ignite_error.h</a>></span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <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> {</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  <span class="keyword">namespace </span>common</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  {</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="comment">// Forward declaration</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="keyword">template</span><<span class="keyword">typename</span> T></div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="classignite_1_1common_1_1Promise.html"> 36</a></span>  <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>  }</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keyword">template</span><<span class="keyword">typename</span> T></div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html"> 46</a></span>  <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>  {</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classignite_1_1common_1_1Promise.html">common::Promise</a><T>;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <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>  <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> </div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#a5dd1c5eb96ad2d3cae49f03cfd7b7c8d"> 59</a></span>  <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<ValueType></a>& src) :</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  state(src.state)</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  {</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="comment">// No-op.</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  }</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#ab22e443f0d35cecfdd677dc237c0c4f7"> 71</a></span>  <a class="code" href="classignite_1_1Future.html">Future</a>& <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<ValueType></a>& other)</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  {</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  state = other.state;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  }</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> </div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#a2d130b07c96c9a4077bda10df7844181"> 82</a></span>  <span class="keywordtype">void</span> <a class="code" href="classignite_1_1Future.html#a2d130b07c96c9a4077bda10df7844181">Wait</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="keyword"> </span>{</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keyword">const</span> common::SharedState<ValueType>* state0 = state.Get();</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  assert(state0 != 0);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  state0->Wait();</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  }</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#ad33d4c003657d5f61ed1066e1b2761e4"> 98</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classignite_1_1Future.html#ad33d4c003657d5f61ed1066e1b2761e4">WaitFor</a>(int32_t msTimeout)<span class="keyword"> const</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="keyword"> </span>{</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keyword">const</span> common::SharedState<ValueType>* state0 = state.Get();</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  assert(state0 != 0);</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordflow">return</span> state0->WaitFor(msTimeout);</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  }</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span> </div><div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#abcd99fe69de65478b946f3c37e1aa084"> 114</a></span>  <span class="keyword">const</span> ValueType& <a class="code" href="classignite_1_1Future.html#abcd99fe69de65478b946f3c37e1aa084">GetValue</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> <span class="keyword"> </span>{</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keyword">const</span> common::SharedState<ValueType>* state0 = state.Get();</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  assert(state0 != 0);</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> </div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keywordflow">return</span> state0->GetValue();</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  }</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> </div><div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#a01ea459a52a53e861c22d7c1ba6669d1"> 126</a></span>  <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>  {</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  common::SharedState<ValueType>* state0 = state.Get();</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span> </div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  assert(state0 != 0);</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span> </div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  state0->Cancel();</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  }</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span> </div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="classignite_1_1Future.html#abd7a19a568856867d220383751af553b"> 138</a></span>  <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>  {</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  common::SharedState<ValueType>* state0 = state.Get();</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> </div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  assert(state0 != 0);</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> </div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="keywordflow">return</span> state0->IsSet();</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  }</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> </div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <a class="code" href="classignite_1_1Future.html">Future</a>(common::concurrent::SharedPointer< common::SharedState<ValueType> > state0) :</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  state(state0)</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  {</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="comment">// No-op.</span></div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  }</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> </div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  common::concurrent::SharedPointer< common::SharedState<ValueType> > state;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  };</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <span class="keyword">template</span><></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>  <span class="keyword">class </span><a class="code" href="classignite_1_1Future.html">Future</a><void></div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  {</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classignite_1_1common_1_1Promise.html">common::Promise</a><void>;</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span> </div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <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>  <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> </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>  <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<ValueType></a>& src) :</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  state(src.state)</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  {</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="comment">// No-op.</span></div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  }</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> </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>  <a class="code" href="classignite_1_1Future.html">Future</a>& <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<ValueType></a>& other)</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  {</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  state = other.state;</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span> </div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  }</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span> </div><div class="line"><a name="l00203"></a><span class="lineno"><a class="line" href="classignite_1_1Future_3_01void_01_4.html#a7d5d3f278bdfeafdf7f156e5ef4524af"> 203</a></span>  <span class="keywordtype">void</span> <a class="code" href="classignite_1_1Future_3_01void_01_4.html#a7d5d3f278bdfeafdf7f156e5ef4524af">Wait</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span> <span class="keyword"> </span>{</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keyword">const</span> common::SharedState<ValueType>* state0 = state.Get();</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span> </div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  assert(state0 != 0);</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span> </div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  state0->Wait();</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  }</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span> </div><div class="line"><a name="l00219"></a><span class="lineno"><a class="line" href="classignite_1_1Future_3_01void_01_4.html#a8d8f6cf4741d314fa3c60b30cf3e90c3"> 219</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classignite_1_1Future_3_01void_01_4.html#a8d8f6cf4741d314fa3c60b30cf3e90c3">WaitFor</a>(int32_t msTimeout)<span class="keyword"> const</span></div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span> <span class="keyword"> </span>{</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keyword">const</span> common::SharedState<ValueType>* state0 = state.Get();</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span> </div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  assert(state0 != 0);</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span> </div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordflow">return</span> state0->WaitFor(msTimeout);</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  }</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span> </div><div class="line"><a name="l00234"></a><span class="lineno"><a class="line" href="classignite_1_1Future_3_01void_01_4.html#a53ecb61d7765c7b256a49c43345e20db"> 234</a></span>  <span class="keywordtype">void</span> <a class="code" href="classignite_1_1Future_3_01void_01_4.html#a53ecb61d7765c7b256a49c43345e20db">GetValue</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span> <span class="keyword"> </span>{</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="keyword">const</span> common::SharedState<ValueType>* state0 = state.Get();</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span> </div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  assert(state0 != 0);</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span> </div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  state0->GetValue();</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  }</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span> </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>  <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>  {</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  common::SharedState<ValueType>* state0 = state.Get();</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span> </div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  assert(state0 != 0);</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span> </div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  state0->Cancel();</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  }</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span> </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>  <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>  {</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  common::SharedState<ValueType>* state0 = state.Get();</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span> </div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  assert(state0 != 0);</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span> </div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  <span class="keywordflow">return</span> state0->IsSet();</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  }</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span> </div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <a class="code" href="classignite_1_1Future.html">Future</a>(common::concurrent::SharedPointer< common::SharedState<ValueType> > state0) :</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  state(state0)</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  {</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  <span class="comment">// No-op.</span></div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  }</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span> </div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  common::concurrent::SharedPointer< common::SharedState<ValueType> > state;</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  };</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span> }</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span> </div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span> <span class="preprocessor">#endif //_IGNITE_FUTURE</span></div><div class="ttc" id="classignite_1_1Future_html_abcd99fe69de65478b946f3c37e1aa084"><div class="ttname"><a href="classignite_1_1Future.html#abcd99fe69de65478b946f3c37e1aa084">ignite::Future::GetValue</a></div><div class="ttdeci">const ValueType & 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_html_ab22e443f0d35cecfdd677dc237c0c4f7"><div class="ttname"><a href="classignite_1_1Future.html#ab22e443f0d35cecfdd677dc237c0c4f7">ignite::Future::operator=</a></div><div class="ttdeci">Future & operator=(const Future< ValueType > &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< void >::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_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_ad33d4c003657d5f61ed1066e1b2761e4"><div class="ttname"><a href="classignite_1_1Future.html#ad33d4c003657d5f61ed1066e1b2761e4">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_3_01void_01_4_html_a8d8f6cf4741d314fa3c60b30cf3e90c3"><div class="ttname"><a href="classignite_1_1Future_3_01void_01_4.html#a8d8f6cf4741d314fa3c60b30cf3e90c3">ignite::Future< void >::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_3_01void_01_4_html_ae5463b058aa141dc9321df728bed98d5"><div class="ttname"><a href="classignite_1_1Future_3_01void_01_4.html#ae5463b058aa141dc9321df728bed98d5">ignite::Future< void >::operator=</a></div><div class="ttdeci">Future & operator=(const Future< ValueType > &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< void >::Future</a></div><div class="ttdeci">Future(const Future< ValueType > &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_html_a2d130b07c96c9a4077bda10df7844181"><div class="ttname"><a href="classignite_1_1Future.html#a2d130b07c96c9a4077bda10df7844181">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="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< void >::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_1Future_3_01void_01_4_html_a53ecb61d7765c7b256a49c43345e20db"><div class="ttname"><a href="classignite_1_1Future_3_01void_01_4.html#a53ecb61d7765c7b256a49c43345e20db">ignite::Future< void >::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_a7d5d3f278bdfeafdf7f156e5ef4524af"><div class="ttname"><a href="classignite_1_1Future_3_01void_01_4.html#a7d5d3f278bdfeafdf7f156e5ef4524af">ignite::Future< void >::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_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< void >::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< ValueType > &src)</div><div class="ttdoc">Copy constructor. </div><div class="ttdef"><b>Definition:</b> future.h:59</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_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 Fri Nov 30 2018 20:09:21 for Apache Ignite C++ by  <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/> |
| </a> 1.8.11 |
| </small></address> |
| </body> |
| </html> |