blob: e0b26d96c58d5e32972657f62d52a1dbf8e23e84 [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>mqttpp: mqtt::token Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
<div class="navpath"><b>mqtt</b>::<a class="el" href="classmqtt_1_1token.html">token</a>
</div>
</div>
<div class="contents">
<h1>mqtt::token Class Reference</h1><!-- doxytag: class="mqtt::token" --><!-- doxytag: inherits="mqtt::itoken" -->
<p>Provides a mechanism for tracking the completion of an asynchronous action.
<a href="#_details">More...</a></p>
<p><code>#include &lt;<a class="el" href="token_8h_source.html">token.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for mqtt::token:</div>
<div class="dynsection">
<div class="center">
<img src="classmqtt_1_1token.gif" usemap="#mqtt::token_map" alt=""/>
<map id="mqtt::token_map" name="mqtt::token_map">
<area href="classmqtt_1_1itoken.html" alt="mqtt::itoken" shape="rect" coords="0,0,122,24"/>
<area href="classmqtt_1_1delivery__token.html" alt="mqtt::delivery_token" shape="rect" coords="0,112,122,136"/>
</map>
</div>
</div>
<p><a href="classmqtt_1_1token-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad34cd0a1e00409bcb77e51bc7b6d774a"></a><!-- doxytag: member="mqtt::token::ptr_t" ref="ad34cd0a1e00409bcb77e51bc7b6d774a" args="" -->
typedef std::shared_ptr&lt; <a class="el" href="classmqtt_1_1token.html">token</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><b>ptr_t</b></td></tr>
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#a5d479b98ffa8efdd8e85c0d647f02a15">token</a> (<a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;cli)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a> object. <a href="#a5d479b98ffa8efdd8e85c0d647f02a15"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#a7462c0eaef923aa48806760ab7b0b745">token</a> (<a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;cli, MQTTAsync_token tok)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a> object. <a href="#a7462c0eaef923aa48806760ab7b0b745"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#a92c59bcdbb845f050b6cb4d298923b15">token</a> (<a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;cli, const std::string &amp;<a class="el" href="classmqtt_1_1topic.html">topic</a>)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a> object. <a href="#a92c59bcdbb845f050b6cb4d298923b15"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#a1e5df1b87b9b28a52dedd57767f0655d">token</a> (<a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;cli, const std::vector&lt; std::string &gt; &amp;topics)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a> object. <a href="#a1e5df1b87b9b28a52dedd57767f0655d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classmqtt_1_1iaction__listener.html">iaction_listener</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#aad3c92d4e1be659101e118fc11daf963">get_action_callback</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the async listener for this <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a>. <a href="#aad3c92d4e1be659101e118fc11daf963"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#ab23933fa6d8db2501c976b79df91d1cb">get_client</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the MQTT <a class="el" href="classmqtt_1_1client.html" title="Lightweight client for talking to an MQTT server using methods that block until an...">client</a> that is responsible for processing the asynchronous action. <a href="#ab23933fa6d8db2501c976b79df91d1cb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#a5bab8b8df3d9f04e75e9c57a6c36e93c">get_message_id</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns an <a class="el" href="classmqtt_1_1exception.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">exception</a> providing more detail if an operation failed. <a href="#a5bab8b8df3d9f04e75e9c57a6c36e93c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a55d8798a9def10c8f714953b696ad3e2"></a><!-- doxytag: member="mqtt::token::get_topics" ref="a55d8798a9def10c8f714953b696ad3e2" args="() const " -->
virtual const std::vector<br class="typebreak"/>
&lt; std::string &gt; &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#a55d8798a9def10c8f714953b696ad3e2">get_topics</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a> string(s) for the action being tracked by this <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8fb4c13db17d0861b17cbe220b0696de"></a><!-- doxytag: member="mqtt::token::get_user_context" ref="a8fb4c13db17d0861b17cbe220b0696de" args="() const " -->
virtual void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#a8fb4c13db17d0861b17cbe220b0696de">get_user_context</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Retrieve the context associated with an action. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#a57c8c9e1f7c404a023022eba9dbcc0c2">is_complete</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns whether or not the action has finished. <a href="#a57c8c9e1f7c404a023022eba9dbcc0c2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#ad916dc92354e24c17969334d84a119d6">set_action_callback</a> (<a class="el" href="classmqtt_1_1iaction__listener.html">iaction_listener</a> &amp;listener)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Register a listener to be notified when an action completes. <a href="#ad916dc92354e24c17969334d84a119d6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#a5faa55b04ee75f18df7b019bf443b1a0">set_user_context</a> (void *userContext)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Store some context associated with an action. <a href="#a5faa55b04ee75f18df7b019bf443b1a0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac4e39b9656105835e8b0eba20b3b2164"></a><!-- doxytag: member="mqtt::token::wait_for_completion" ref="ac4e39b9656105835e8b0eba20b3b2164" args="()" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#ac4e39b9656105835e8b0eba20b3b2164">wait_for_completion</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Blocks the current thread until the action this <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a> is associated with has completed. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#a9d9f139a8aa0b197db6ef810f5c88684">wait_for_completion</a> (long timeout)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Blocks the current thread until the action this <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a> is associated with has completed. <a href="#a9d9f139a8aa0b197db6ef810f5c88684"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;class Rep , class Period &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#a688d9101d2a1370871ba9a960a4fd0c6">wait_for_completion</a> (const std::chrono::duration&lt; Rep, Period &gt; &amp;relTime)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Waits a relative amount of time for the action to complete. <a href="#a688d9101d2a1370871ba9a960a4fd0c6"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;class Clock , class Duration &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#a27d4518d8962405c9f883761c0bf4e1c">wait_until_completion</a> (const std::chrono::time_point&lt; Clock, Duration &gt; &amp;absTime)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Waits until an absolute time for the action to complete. <a href="#a27d4518d8962405c9f883761c0bf4e1c"></a><br/></td></tr>
<tr><td colspan="2"><h2>Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac39954340d8b15edaa883af1bcfcf7ae"></a><!-- doxytag: member="mqtt::token::async_client" ref="ac39954340d8b15edaa883af1bcfcf7ae" args="" -->
class&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1token.html#ac39954340d8b15edaa883af1bcfcf7ae">async_client</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Client has special access for full initialization. <br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Provides a mechanism for tracking the completion of an asynchronous action. </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a5d479b98ffa8efdd8e85c0d647f02a15"></a><!-- doxytag: member="mqtt::token::token" ref="a5d479b98ffa8efdd8e85c0d647f02a15" args="(iasync_client &amp;cli)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mqtt::token::token </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;&nbsp;</td>
<td class="paramname"> <em>cli</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a> object. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>cli</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a7462c0eaef923aa48806760ab7b0b745"></a><!-- doxytag: member="mqtt::token::token" ref="a7462c0eaef923aa48806760ab7b0b745" args="(iasync_client &amp;cli, MQTTAsync_token tok)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mqtt::token::token </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;&nbsp;</td>
<td class="paramname"> <em>cli</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">MQTTAsync_token&nbsp;</td>
<td class="paramname"> <em>tok</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a> object. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>tok</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a92c59bcdbb845f050b6cb4d298923b15"></a><!-- doxytag: member="mqtt::token::token" ref="a92c59bcdbb845f050b6cb4d298923b15" args="(iasync_client &amp;cli, const std::string &amp;topic)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mqtt::token::token </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;&nbsp;</td>
<td class="paramname"> <em>cli</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>topic</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a> object. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>cli</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a1e5df1b87b9b28a52dedd57767f0655d"></a><!-- doxytag: member="mqtt::token::token" ref="a1e5df1b87b9b28a52dedd57767f0655d" args="(iasync_client &amp;cli, const std::vector&lt; std::string &gt; &amp;topics)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mqtt::token::token </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a> &amp;&nbsp;</td>
<td class="paramname"> <em>cli</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; std::string &gt; &amp;&nbsp;</td>
<td class="paramname"> <em>topics</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a> object. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>cli</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aad3c92d4e1be659101e118fc11daf963"></a><!-- doxytag: member="mqtt::token::get_action_callback" ref="aad3c92d4e1be659101e118fc11daf963" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classmqtt_1_1iaction__listener.html">iaction_listener</a>* mqtt::token::get_action_callback </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td> const<code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the async listener for this <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a>. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd><a class="el" href="classmqtt_1_1iaction__listener.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">iaction_listener</a> </dd></dl>
<p>Implements <a class="el" href="classmqtt_1_1itoken.html#afb9395dcf53aa306368b7dfa7e7000a5">mqtt::itoken</a>.</p>
</div>
</div>
<a class="anchor" id="ab23933fa6d8db2501c976b79df91d1cb"></a><!-- doxytag: member="mqtt::token::get_client" ref="ab23933fa6d8db2501c976b79df91d1cb" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classmqtt_1_1iasync__client.html">iasync_client</a>* mqtt::token::get_client </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td> const<code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the MQTT <a class="el" href="classmqtt_1_1client.html" title="Lightweight client for talking to an MQTT server using methods that block until an...">client</a> that is responsible for processing the asynchronous action. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd><a class="el" href="classmqtt_1_1iasync__client.html" title="Enables an application to communicate with an MQTT server using non-blocking methods...">iasync_client</a> </dd></dl>
<p>Implements <a class="el" href="classmqtt_1_1itoken.html#a458008aba7949bdfe21c044b24c49721">mqtt::itoken</a>.</p>
</div>
</div>
<a class="anchor" id="a5bab8b8df3d9f04e75e9c57a6c36e93c"></a><!-- doxytag: member="mqtt::token::get_message_id" ref="a5bab8b8df3d9f04e75e9c57a6c36e93c" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual int mqtt::token::get_message_id </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td> const<code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns an <a class="el" href="classmqtt_1_1exception.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">exception</a> providing more detail if an operation failed. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Exception Returns the <a class="el" href="classmqtt_1_1message.html" title="An MQTT message holds the application payload and options specifying how the message...">message</a> ID of the <a class="el" href="classmqtt_1_1message.html" title="An MQTT message holds the application payload and options specifying how the message...">message</a> that is associated with the <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a>. </dd>
<dd>
int </dd></dl>
<p>Implements <a class="el" href="classmqtt_1_1itoken.html#a4bfa1320ee0000d0a54fd40ceed24658">mqtt::itoken</a>.</p>
</div>
</div>
<a class="anchor" id="a57c8c9e1f7c404a023022eba9dbcc0c2"></a><!-- doxytag: member="mqtt::token::is_complete" ref="a57c8c9e1f7c404a023022eba9dbcc0c2" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual bool mqtt::token::is_complete </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td> const<code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns whether or not the action has finished. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>bool </dd></dl>
<p>Implements <a class="el" href="classmqtt_1_1itoken.html#a99af88ac59f2ed5cb696b4566f58d6d2">mqtt::itoken</a>.</p>
</div>
</div>
<a class="anchor" id="ad916dc92354e24c17969334d84a119d6"></a><!-- doxytag: member="mqtt::token::set_action_callback" ref="ad916dc92354e24c17969334d84a119d6" args="(iaction_listener &amp;listener)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void mqtt::token::set_action_callback </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmqtt_1_1iaction__listener.html">iaction_listener</a> &amp;&nbsp;</td>
<td class="paramname"> <em>listener</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Register a listener to be notified when an action completes. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>listener</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
<p>Implements <a class="el" href="classmqtt_1_1itoken.html#aef0ed9396b89b2159a4a103a492fbc2e">mqtt::itoken</a>.</p>
</div>
</div>
<a class="anchor" id="a5faa55b04ee75f18df7b019bf443b1a0"></a><!-- doxytag: member="mqtt::token::set_user_context" ref="a5faa55b04ee75f18df7b019bf443b1a0" args="(void *userContext)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void mqtt::token::set_user_context </td>
<td>(</td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>userContext</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Store some context associated with an action. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>userContext</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
<p>Implements <a class="el" href="classmqtt_1_1itoken.html#a777df44320b48c494c3821f314d70f7a">mqtt::itoken</a>.</p>
</div>
</div>
<a class="anchor" id="a688d9101d2a1370871ba9a960a4fd0c6"></a><!-- doxytag: member="mqtt::token::wait_for_completion" ref="a688d9101d2a1370871ba9a960a4fd0c6" args="(const std::chrono::duration&lt; Rep, Period &gt; &amp;relTime)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Rep , class Period &gt; </div>
<table class="memname">
<tr>
<td class="memname">bool mqtt::token::wait_for_completion </td>
<td>(</td>
<td class="paramtype">const std::chrono::duration&lt; Rep, Period &gt; &amp;&nbsp;</td>
<td class="paramname"> <em>relTime</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits a relative amount of time for the action to complete. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>relTime</em>&nbsp;</td><td>The amount of time to wait for the event. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><em>true</em> if the event gets signaled in the specified time, <em>false</em> on a timeout. </dd></dl>
</div>
</div>
<a class="anchor" id="a9d9f139a8aa0b197db6ef810f5c88684"></a><!-- doxytag: member="mqtt::token::wait_for_completion" ref="a9d9f139a8aa0b197db6ef810f5c88684" args="(long timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void mqtt::token::wait_for_completion </td>
<td>(</td>
<td class="paramtype">long&nbsp;</td>
<td class="paramname"> <em>timeout</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Blocks the current thread until the action this <a class="el" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a> is associated with has completed. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>The timeout (in milliseconds) </td></tr>
</table>
</dd>
</dl>
<p>Implements <a class="el" href="classmqtt_1_1itoken.html#ae863704f781abb042774ecfb2f70bae0">mqtt::itoken</a>.</p>
</div>
</div>
<a class="anchor" id="a27d4518d8962405c9f883761c0bf4e1c"></a><!-- doxytag: member="mqtt::token::wait_until_completion" ref="a27d4518d8962405c9f883761c0bf4e1c" args="(const std::chrono::time_point&lt; Clock, Duration &gt; &amp;absTime)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Clock , class Duration &gt; </div>
<table class="memname">
<tr>
<td class="memname">bool mqtt::token::wait_until_completion </td>
<td>(</td>
<td class="paramtype">const std::chrono::time_point&lt; Clock, Duration &gt; &amp;&nbsp;</td>
<td class="paramname"> <em>absTime</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits until an absolute time for the action to complete. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>absTime</em>&nbsp;</td><td>The absolute time to wait for the event. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><em>true</em> if the event gets signaled in the specified time, <em>false</em> on a timeout. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>mqtt/<a class="el" href="token_8h_source.html">token.h</a></li>
</ul>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 30 Apr 2014 for mqttpp by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>