blob: 2558f21b40e27b8e609092d6b6fcbddf365b694a [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::client 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_1client.html">client</a>
</div>
</div>
<div class="contents">
<h1>mqtt::client Class Reference</h1><!-- doxytag: class="mqtt::client" -->
<p>Lightweight <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> for talking to an MQTT server using methods that block until an operation completes.
<a href="#_details">More...</a></p>
<p><code>#include &lt;<a class="el" href="client_8h_source.html">client.h</a>&gt;</code></p>
<p><a href="classmqtt_1_1client-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="a9d525663010133829d3a6d279f60de7f"></a><!-- doxytag: member="mqtt::client::ptr_t" ref="a9d525663010133829d3a6d279f60de7f" args="" -->
typedef std::shared_ptr&lt; <a class="el" href="classmqtt_1_1client.html">client</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#a9d525663010133829d3a6d279f60de7f">ptr_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Smart pointer type for this object. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a79b4ff7f06e5d5410cdf88484b564d0d"></a><!-- doxytag: member="mqtt::client::topic_filter_collection" ref="a79b4ff7f06e5d5410cdf88484b564d0d" args="" -->
typedef <br class="typebreak"/>
<a class="el" href="classmqtt_1_1iasync__client.html#a058f9d82f67aac8415f8475ed63a5dad">async_client::topic_filter_collection</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#a79b4ff7f06e5d5410cdf88484b564d0d">topic_filter_collection</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type for a collection of filters. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af8dcdca03f88e6ecb5c64561e77265ab"></a><!-- doxytag: member="mqtt::client::qos_collection" ref="af8dcdca03f88e6ecb5c64561e77265ab" args="" -->
typedef <br class="typebreak"/>
<a class="el" href="classmqtt_1_1iasync__client.html#a2a86f5766c4b7f4f0c6cf01611380ccf">async_client::qos_collection</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#af8dcdca03f88e6ecb5c64561e77265ab">qos_collection</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type for a collection of QOS values. <br/></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_1client.html#a34def25f0e39a17671960dd05e52e1cc">client</a> (const std::string &amp;serverURI, const std::string &amp;clientId)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a <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 can be used to communicate with an MQTT server. <a href="#a34def25f0e39a17671960dd05e52e1cc"></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_1client.html#a3c48f2967aba592d9a114fb45b849075">client</a> (const std::string &amp;serverURI, const std::string &amp;clientId, const std::string &amp;persistDir)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a <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 can be used to communicate with an MQTT server. <a href="#a3c48f2967aba592d9a114fb45b849075"></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_1client.html#a4a5890082e0da5dad7cc4c5e399b484a">client</a> (const std::string &amp;serverURI, const std::string &amp;clientId, <a class="el" href="classmqtt_1_1iclient__persistence.html">iclient_persistence</a> *persistence)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a <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 can be used to communicate with an MQTT server. <a href="#a4a5890082e0da5dad7cc4c5e399b484a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a69ebdd298caaa5be788a0625f2c55700"></a><!-- doxytag: member="mqtt::client::close" ref="a69ebdd298caaa5be788a0625f2c55700" args="()" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#a69ebdd298caaa5be788a0625f2c55700">close</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close the <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> and releases all resource associated with the <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>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8807675e81a186f09eba5b5f050d772c"></a><!-- doxytag: member="mqtt::client::connect" ref="a8807675e81a186f09eba5b5f050d772c" args="()" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#a8807675e81a186f09eba5b5f050d772c">connect</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Connects to an MQTT server using the default options. <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_1client.html#ad5ea573f70c4290b01f79af4b123d3e1">connect</a> (<a class="el" href="classmqtt_1_1connect__options.html">connect_options</a> options)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Connects to an MQTT server using the specified options. <a href="#ad5ea573f70c4290b01f79af4b123d3e1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3b0035bbb0a2ecd382a32862323540f8"></a><!-- doxytag: member="mqtt::client::disconnect" ref="a3b0035bbb0a2ecd382a32862323540f8" args="()" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#a3b0035bbb0a2ecd382a32862323540f8">disconnect</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Disconnects from the server. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a81dc36a21b1e6af6502ec783fa121330"></a><!-- doxytag: member="mqtt::client::disconnect" ref="a81dc36a21b1e6af6502ec783fa121330" args="(long quiesceTimeout)" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#a81dc36a21b1e6af6502ec783fa121330">disconnect</a> (long quiesceTimeout)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Disconnects from the server. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#ad147f1d3bb2da1741e6f0eeba84f320c">get_client_id</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a randomly generated <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> identifier based on the current user's login name and the system time. <a href="#ad147f1d3bb2da1741e6f0eeba84f320c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6decac54ce0b43453991964e1978fd97"></a><!-- doxytag: member="mqtt::client::get_pending_delivery_tokens" ref="a6decac54ce0b43453991964e1978fd97" args="() const " -->
virtual std::vector<br class="typebreak"/>
&lt; idelivery_token_ptr &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#a6decac54ce0b43453991964e1978fd97">get_pending_delivery_tokens</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the delivery tokens for any outstanding publish operations. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#ad7023de6695b304f9532a8efc44bbcb4">get_server_uri</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the address of the server used by this <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>, as a URI. <a href="#ad7023de6695b304f9532a8efc44bbcb4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#a8db3af55ae54802c5d5ef02ceac9c506">get_time_to_wait</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the maximum time to wait for an action to complete. <a href="#a8db3af55ae54802c5d5ef02ceac9c506"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classmqtt_1_1topic.html">topic</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#ab13f7be6405ab2d8a6d9255aeee85014">get_topic</a> (const std::string &amp;tpc)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get a <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a> object which can be used to publish messages. <a href="#ab13f7be6405ab2d8a6d9255aeee85014"></a><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_1client.html#af37670f9792f932e273867a31f8cb2a5">is_connected</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Determines if this <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> is currently connected to the server. <a href="#af37670f9792f932e273867a31f8cb2a5"></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_1client.html#a6ecede0190eb852fdefaa5a3b560bd68">publish</a> (const std::string &amp;top, const void *payload, size_t n, int qos, bool retained)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Publishes a <a class="el" href="classmqtt_1_1message.html" title="An MQTT message holds the application payload and options specifying how the message...">message</a> to a <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a> on the server and return once it is delivered. <a href="#a6ecede0190eb852fdefaa5a3b560bd68"></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_1client.html#a6bc83be653c24412f3417d22cf79bd9e">publish</a> (const std::string &amp;tpc, message_ptr msg)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Publishes a <a class="el" href="classmqtt_1_1message.html" title="An MQTT message holds the application payload and options specifying how the message...">message</a> to a <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a> on the server. <a href="#a6bc83be653c24412f3417d22cf79bd9e"></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_1client.html#a49d9d64861e7f6bf436b212e26d3ba33">set_callback</a> (<a class="el" href="classmqtt_1_1callback.html">callback</a> &amp;cb)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the <a class="el" href="classmqtt_1_1callback.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">callback</a> listener to use for events that happen asynchronously. <a href="#a49d9d64861e7f6bf436b212e26d3ba33"></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_1client.html#a40ee56f042da294015d013d56bc698ba">set_time_to_wait</a> (int timeToWaitInMillis)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the maximum time to wait for an action to complete. <a href="#a40ee56f042da294015d013d56bc698ba"></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_1client.html#a889ab68441badf3c5b4b5174ace82e4c">subscribe</a> (const std::string &amp;topicFilter)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Subscribe to a <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a>, which may include wildcards using a QoS of 1. <a href="#a889ab68441badf3c5b4b5174ace82e4c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a92cf9329279f0ff1af6082192a5bef02"></a><!-- doxytag: member="mqtt::client::subscribe" ref="a92cf9329279f0ff1af6082192a5bef02" args="(const topic_filter_collection &amp;topicFilters)" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#a92cf9329279f0ff1af6082192a5bef02">subscribe</a> (const <a class="el" href="classmqtt_1_1client.html#a79b4ff7f06e5d5410cdf88484b564d0d">topic_filter_collection</a> &amp;topicFilters)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Subscribes to a one or more topics, which may include wildcards using a QoS of 1. <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_1client.html#a80d0fb2327e41dd570a8d7deeea32ece">subscribe</a> (const <a class="el" href="classmqtt_1_1client.html#a79b4ff7f06e5d5410cdf88484b564d0d">topic_filter_collection</a> &amp;topicFilters, const <a class="el" href="classmqtt_1_1client.html#af8dcdca03f88e6ecb5c64561e77265ab">qos_collection</a> &amp;qos)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Subscribes to multiple topics, each of which may include wildcards. <a href="#a80d0fb2327e41dd570a8d7deeea32ece"></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_1client.html#a8ceeccec14fda125a5a692019abfd20f">subscribe</a> (const std::string &amp;topicFilter, int qos)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Subscribe to a <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a>, which may include wildcards. <a href="#a8ceeccec14fda125a5a692019abfd20f"></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_1client.html#af237c77971882b968f9369a4f4e2422e">unsubscribe</a> (const std::string &amp;topicFilter)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Requests the server unsubscribe the <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> from a <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a>. <a href="#af237c77971882b968f9369a4f4e2422e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2ece201fad4a208f32fd667dc1bd6a73"></a><!-- doxytag: member="mqtt::client::unsubscribe" ref="a2ece201fad4a208f32fd667dc1bd6a73" args="(const topic_filter_collection &amp;topicFilters)" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1client.html#a2ece201fad4a208f32fd667dc1bd6a73">unsubscribe</a> (const <a class="el" href="classmqtt_1_1client.html#a79b4ff7f06e5d5410cdf88484b564d0d">topic_filter_collection</a> &amp;topicFilters)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Requests the server unsubscribe the <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> from one or more topics. <br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Lightweight <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> for talking to an MQTT server using methods that block until an operation completes. </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a34def25f0e39a17671960dd05e52e1cc"></a><!-- doxytag: member="mqtt::client::client" ref="a34def25f0e39a17671960dd05e52e1cc" args="(const std::string &amp;serverURI, const std::string &amp;clientId)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mqtt::client::client </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>serverURI</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>clientId</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create a <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 can be used to communicate with an MQTT server. </p>
<p>This uses file-based persistence in the current working directory. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>serverURI</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>clientId</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a3c48f2967aba592d9a114fb45b849075"></a><!-- doxytag: member="mqtt::client::client" ref="a3c48f2967aba592d9a114fb45b849075" args="(const std::string &amp;serverURI, const std::string &amp;clientId, const std::string &amp;persistDir)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mqtt::client::client </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>serverURI</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>clientId</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>persistDir</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create a <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 can be used to communicate with an MQTT server. </p>
<p>This uses file-based persistence in the specified directory. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>serverURI</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>clientId</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>persistDir</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a4a5890082e0da5dad7cc4c5e399b484a"></a><!-- doxytag: member="mqtt::client::client" ref="a4a5890082e0da5dad7cc4c5e399b484a" args="(const std::string &amp;serverURI, const std::string &amp;clientId, iclient_persistence *persistence)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mqtt::client::client </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>serverURI</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>clientId</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classmqtt_1_1iclient__persistence.html">iclient_persistence</a> *&nbsp;</td>
<td class="paramname"> <em>persistence</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create a <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 can be used to communicate with an MQTT server. </p>
<p>This allows the caller to specify a user-defined persistance object, or use no persistence. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>serverURI</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>clientId</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>persistence</em>&nbsp;</td><td>The user persistence structure. If this is null, then no persistence is used. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ad5ea573f70c4290b01f79af4b123d3e1"></a><!-- doxytag: member="mqtt::client::connect" ref="ad5ea573f70c4290b01f79af4b123d3e1" args="(connect_options options)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void mqtt::client::connect </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmqtt_1_1connect__options.html">connect_options</a>&nbsp;</td>
<td class="paramname"> <em>options</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Connects to an MQTT server using the specified options. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>options</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ad147f1d3bb2da1741e6f0eeba84f320c"></a><!-- doxytag: member="mqtt::client::get_client_id" ref="ad147f1d3bb2da1741e6f0eeba84f320c" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual std::string mqtt::client::get_client_id </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td> const<code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns a randomly generated <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> identifier based on the current user's login name and the system time. </p>
<p>Returns the <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> ID used by this <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>. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>std::string </dd></dl>
</div>
</div>
<a class="anchor" id="ad7023de6695b304f9532a8efc44bbcb4"></a><!-- doxytag: member="mqtt::client::get_server_uri" ref="ad7023de6695b304f9532a8efc44bbcb4" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual std::string mqtt::client::get_server_uri </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td> const<code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the address of the server used by this <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>, as a URI. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>std::string </dd></dl>
</div>
</div>
<a class="anchor" id="a8db3af55ae54802c5d5ef02ceac9c506"></a><!-- doxytag: member="mqtt::client::get_time_to_wait" ref="a8db3af55ae54802c5d5ef02ceac9c506" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual long mqtt::client::get_time_to_wait </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td> const<code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the maximum time to wait for an action to complete. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>long </dd></dl>
</div>
</div>
<a class="anchor" id="ab13f7be6405ab2d8a6d9255aeee85014"></a><!-- doxytag: member="mqtt::client::get_topic" ref="ab13f7be6405ab2d8a6d9255aeee85014" args="(const std::string &amp;tpc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classmqtt_1_1topic.html">topic</a> mqtt::client::get_topic </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>tpc</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Get a <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a> object which can be used to publish messages. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>tpc</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a> </dd></dl>
</div>
</div>
<a class="anchor" id="af37670f9792f932e273867a31f8cb2a5"></a><!-- doxytag: member="mqtt::client::is_connected" ref="af37670f9792f932e273867a31f8cb2a5" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual bool mqtt::client::is_connected </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td> const<code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Determines if this <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> is currently connected to the server. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>bool </dd></dl>
</div>
</div>
<a class="anchor" id="a6bc83be653c24412f3417d22cf79bd9e"></a><!-- doxytag: member="mqtt::client::publish" ref="a6bc83be653c24412f3417d22cf79bd9e" args="(const std::string &amp;tpc, message_ptr msg)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void mqtt::client::publish </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>tpc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">message_ptr&nbsp;</td>
<td class="paramname"> <em>msg</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Publishes a <a class="el" href="classmqtt_1_1message.html" title="An MQTT message holds the application payload and options specifying how the message...">message</a> to a <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a> on the server. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>tpc</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>msg</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a6ecede0190eb852fdefaa5a3b560bd68"></a><!-- doxytag: member="mqtt::client::publish" ref="a6ecede0190eb852fdefaa5a3b560bd68" args="(const std::string &amp;top, const void *payload, size_t n, int qos, bool retained)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void mqtt::client::publish </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>top</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void *&nbsp;</td>
<td class="paramname"> <em>payload</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>n</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&nbsp;</td>
<td class="paramname"> <em>qos</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&nbsp;</td>
<td class="paramname"> <em>retained</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Publishes a <a class="el" href="classmqtt_1_1message.html" title="An MQTT message holds the application payload and options specifying how the message...">message</a> to a <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a> on the server and return once it is delivered. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a></em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>payload</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>qos</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>retained</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a49d9d64861e7f6bf436b212e26d3ba33"></a><!-- doxytag: member="mqtt::client::set_callback" ref="a49d9d64861e7f6bf436b212e26d3ba33" args="(callback &amp;cb)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void mqtt::client::set_callback </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmqtt_1_1callback.html">callback</a> &amp;&nbsp;</td>
<td class="paramname"> <em>cb</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the <a class="el" href="classmqtt_1_1callback.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">callback</a> listener to use for events that happen asynchronously. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="classmqtt_1_1callback.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">callback</a></em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a40ee56f042da294015d013d56bc698ba"></a><!-- doxytag: member="mqtt::client::set_time_to_wait" ref="a40ee56f042da294015d013d56bc698ba" args="(int timeToWaitInMillis)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void mqtt::client::set_time_to_wait </td>
<td>(</td>
<td class="paramtype">int&nbsp;</td>
<td class="paramname"> <em>timeToWaitInMillis</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set the maximum time to wait for an 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>timeToWaitInMillis</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a8ceeccec14fda125a5a692019abfd20f"></a><!-- doxytag: member="mqtt::client::subscribe" ref="a8ceeccec14fda125a5a692019abfd20f" args="(const std::string &amp;topicFilter, int qos)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void mqtt::client::subscribe </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>topicFilter</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&nbsp;</td>
<td class="paramname"> <em>qos</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Subscribe to a <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a>, which may include wildcards. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>topicFilter</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>qos</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a80d0fb2327e41dd570a8d7deeea32ece"></a><!-- doxytag: member="mqtt::client::subscribe" ref="a80d0fb2327e41dd570a8d7deeea32ece" args="(const topic_filter_collection &amp;topicFilters, const qos_collection &amp;qos)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void mqtt::client::subscribe </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classmqtt_1_1client.html#a79b4ff7f06e5d5410cdf88484b564d0d">topic_filter_collection</a> &amp;&nbsp;</td>
<td class="paramname"> <em>topicFilters</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classmqtt_1_1client.html#af8dcdca03f88e6ecb5c64561e77265ab">qos_collection</a> &amp;&nbsp;</td>
<td class="paramname"> <em>qos</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Subscribes to multiple topics, each of which may include wildcards. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>string</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a889ab68441badf3c5b4b5174ace82e4c"></a><!-- doxytag: member="mqtt::client::subscribe" ref="a889ab68441badf3c5b4b5174ace82e4c" args="(const std::string &amp;topicFilter)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void mqtt::client::subscribe </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>topicFilter</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Subscribe to a <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a>, which may include wildcards using a QoS of 1. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>topicFilter</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="af237c77971882b968f9369a4f4e2422e"></a><!-- doxytag: member="mqtt::client::unsubscribe" ref="af237c77971882b968f9369a4f4e2422e" args="(const std::string &amp;topicFilter)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void mqtt::client::unsubscribe </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&nbsp;</td>
<td class="paramname"> <em>topicFilter</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Requests the server unsubscribe the <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> from a <a class="el" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>topicFilter</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>mqtt/<a class="el" href="client_8h_source.html">client.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>