blob: cd999ebf89299037f7b8ab48b2a04da64b65b744 [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>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>activemq-cpp-3.4.0: decaf::util::concurrent::Future&lt; V &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">activemq-cpp-3.4.0</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
</ul>
</div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
initNavTree('classdecaf_1_1util_1_1concurrent_1_1_future.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<h1>decaf::util::concurrent::Future&lt; V &gt; Class Template Reference</h1> </div>
</div>
<div class="contents">
<!-- doxytag: class="decaf::util::concurrent::Future" -->
<p>A <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html" title="A Future represents the result of an asynchronous computation.">Future</a> represents the result of an asynchronous computation.
<a href="#_details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_future_8h_source.html">src/main/decaf/util/concurrent/Future.h</a>&gt;</code></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html#ab09a23b5b979df419c6dc667f3c8ff4e">~Future</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html#a40cde03d58c1e15b0873d7b1a8bef29a">cancel</a> (bool mayInterruptIfRunning)=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Attempts to cancel execution of this task. <a href="#a40cde03d58c1e15b0873d7b1a8bef29a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html#a88e8583854ec3f8b178ecf02c3b44282">isCancelled</a> () const =0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if this task was canceled before it completed normally. <a href="#a88e8583854ec3f8b178ecf02c3b44282"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html#a35336fb2e311d079c60c9b3c1a7656dd">isDone</a> () const =0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if this task completed. <a href="#a35336fb2e311d079c60c9b3c1a7656dd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual V&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html#a11bef80234ffc78da7a6ed30f63c4bd5">get</a> ()=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits if necessary for the computation to complete, and then retrieves its result. <a href="#a11bef80234ffc78da7a6ed30f63c4bd5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual V&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html#ae54f74ab4075b49f182811b085ca6466">get</a> (long long timeout, const <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_time_unit.html">TimeUnit</a> &amp;unit)=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. <a href="#ae54f74ab4075b49f182811b085ca6466"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename V&gt;<br/>
class decaf::util::concurrent::Future&lt; V &gt;</h3>
<p>A <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html" title="A Future represents the result of an asynchronous computation.">Future</a> represents the result of an asynchronous computation. </p>
<p>Methods are provided to check if the computation is complete, to wait for its completion, and to retrieve the result of the computation. The result can only be retrieved using method get when the computation has completed, blocking if necessary until it is ready. Cancellation is performed by the cancel method. Additional methods are provided to determine if the task completed normally or was canceled. Once a computation has completed, the computation cannot be canceled. If you would like to use a <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html" title="A Future represents the result of an asynchronous computation.">Future</a> for the sake of cancellability but not provide a usable result, you can declare types of the form Future&lt;void*&gt; and return null as a result of the underlying task. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ab09a23b5b979df419c6dc667f3c8ff4e"></a><!-- doxytag: member="decaf::util::concurrent::Future::~Future" ref="ab09a23b5b979df419c6dc667f3c8ff4e" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename V &gt; </div>
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html">decaf::util::concurrent::Future</a>&lt; V &gt;::~<a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html">Future</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a40cde03d58c1e15b0873d7b1a8bef29a"></a><!-- doxytag: member="decaf::util::concurrent::Future::cancel" ref="a40cde03d58c1e15b0873d7b1a8bef29a" args="(bool mayInterruptIfRunning)=0" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename V &gt; </div>
<table class="memname">
<tr>
<td class="memname">virtual bool <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html">decaf::util::concurrent::Future</a>&lt; V &gt;::cancel </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>mayInterruptIfRunning</em></td><td>)</td>
<td><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Attempts to cancel execution of this task. </p>
<p>This attempt will fail if the task has already completed, has already been canceled, or could not be canceled for some other reason. If successful, and this task has not started when cancel is called, this task should never run. If the task has already started, then the mayInterruptIfRunning parameter determines whether the thread executing this task should be interrupted in an attempt to stop the task. </p>
<p>After this method returns, subsequent calls to <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html#a35336fb2e311d079c60c9b3c1a7656dd" title="Returns true if this task completed.">isDone()</a> will always return true. Subsequent calls to <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html#a88e8583854ec3f8b178ecf02c3b44282" title="Returns true if this task was canceled before it completed normally.">isCancelled()</a> will always return true if this method returned true. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">mayInterruptIfRunning</td><td>- true if the thread executing this task should be interrupted; otherwise, in-progress tasks are allowed to complete. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>false if the task could not be canceled, typically because it has already completed normally; true otherwise </dd></dl>
</div>
</div>
<a class="anchor" id="ae54f74ab4075b49f182811b085ca6466"></a><!-- doxytag: member="decaf::util::concurrent::Future::get" ref="ae54f74ab4075b49f182811b085ca6466" args="(long long timeout, const TimeUnit &amp;unit)=0" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename V &gt; </div>
<table class="memname">
<tr>
<td class="memname">virtual V <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html">decaf::util::concurrent::Future</a>&lt; V &gt;::get </td>
<td>(</td>
<td class="paramtype">long long&#160;</td>
<td class="paramname"><em>timeout</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_time_unit.html">TimeUnit</a> &amp;&#160;</td>
<td class="paramname"><em>unit</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timeout</td><td>- the maximum time to wait </td></tr>
<tr><td class="paramname">unit</td><td>- the time unit of the timeout argument </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the computed result </dd></dl>
<dl><dt><b>Exceptions:</b></dt><dd>
<table class="exception">
<tr><td class="paramname"><a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_cancellation_exception.html">CancellationException</a></td><td>- if the computation was canceled </td></tr>
<tr><td class="paramname"><a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_execution_exception.html">ExecutionException</a></td><td>- if the computation threw an exception </td></tr>
<tr><td class="paramname">InterruptedException</td><td>- if the current thread was interrupted while waiting </td></tr>
<tr><td class="paramname"><a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_timeout_exception.html">TimeoutException</a></td><td>- if the wait timed out </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a11bef80234ffc78da7a6ed30f63c4bd5"></a><!-- doxytag: member="decaf::util::concurrent::Future::get" ref="a11bef80234ffc78da7a6ed30f63c4bd5" args="()=0" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename V &gt; </div>
<table class="memname">
<tr>
<td class="memname">virtual V <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html">decaf::util::concurrent::Future</a>&lt; V &gt;::get </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits if necessary for the computation to complete, and then retrieves its result. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the computed result. </dd></dl>
<dl><dt><b>Exceptions:</b></dt><dd>
<table class="exception">
<tr><td class="paramname"><a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_cancellation_exception.html">CancellationException</a></td><td>- if the computation was canceled </td></tr>
<tr><td class="paramname"><a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_execution_exception.html">ExecutionException</a></td><td>- if the computation threw an exception </td></tr>
<tr><td class="paramname">InterruptedException</td><td>- if the current thread was interrupted while waiting </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a88e8583854ec3f8b178ecf02c3b44282"></a><!-- doxytag: member="decaf::util::concurrent::Future::isCancelled" ref="a88e8583854ec3f8b178ecf02c3b44282" args="() const =0" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename V &gt; </div>
<table class="memname">
<tr>
<td class="memname">virtual bool <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html">decaf::util::concurrent::Future</a>&lt; V &gt;::isCancelled </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if this task was canceled before it completed normally. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if this task was canceled before it completed </dd></dl>
</div>
</div>
<a class="anchor" id="a35336fb2e311d079c60c9b3c1a7656dd"></a><!-- doxytag: member="decaf::util::concurrent::Future::isDone" ref="a35336fb2e311d079c60c9b3c1a7656dd" args="() const =0" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename V &gt; </div>
<table class="memname">
<tr>
<td class="memname">virtual bool <a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html">decaf::util::concurrent::Future</a>&lt; V &gt;::isDone </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if this task completed. </p>
<p>Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if this task completed </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/main/decaf/util/concurrent/<a class="el" href="_future_8h_source.html">Future.h</a></li>
</ul>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacedecaf.html">decaf</a> </li>
<li class="navelem"><a class="el" href="namespacedecaf_1_1util.html">util</a> </li>
<li class="navelem"><a class="el" href="namespacedecaf_1_1util_1_1concurrent.html">concurrent</a> </li>
<li class="navelem"><a class="el" href="classdecaf_1_1util_1_1concurrent_1_1_future.html">Future</a> </li>
<li class="footer">Generated on Mon Apr 25 2011 for activemq-cpp-3.4.0 by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
</ul>
</div>
</body>
</html>