blob: 91b4b6e72aae2fa798e838db74da2ecb5b5781a9 [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/delivery_token.h Source File</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><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
</ul>
</div>
<h1>mqtt/delivery_token.h</h1><a href="delivery__token_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
<a name="l00002"></a>00002
<a name="l00003"></a>00003
<a name="l00004"></a>00004
<a name="l00005"></a>00005
<a name="l00006"></a>00006
<a name="l00007"></a>00007
<a name="l00008"></a>00008 <span class="comment">/*******************************************************************************</span>
<a name="l00009"></a>00009 <span class="comment"> * Copyright (c) 2013 Frank Pagliughi &lt;fpagliughi@mindspring.com&gt;</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * All rights reserved. This program and the accompanying materials</span>
<a name="l00012"></a>00012 <span class="comment"> * are made available under the terms of the Eclipse Public License v1.0</span>
<a name="l00013"></a>00013 <span class="comment"> * and Eclipse Distribution License v1.0 which accompany this distribution. </span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * The Eclipse Public License is available at </span>
<a name="l00016"></a>00016 <span class="comment"> * http://www.eclipse.org/legal/epl-v10.html</span>
<a name="l00017"></a>00017 <span class="comment"> * and the Eclipse Distribution License is available at </span>
<a name="l00018"></a>00018 <span class="comment"> * http://www.eclipse.org/org/documents/edl-v10.php.</span>
<a name="l00019"></a>00019 <span class="comment"> *</span>
<a name="l00020"></a>00020 <span class="comment"> * Contributors:</span>
<a name="l00021"></a>00021 <span class="comment"> * Frank Pagliughi - initial implementation and documentation</span>
<a name="l00022"></a>00022 <span class="comment"> *******************************************************************************/</span>
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="preprocessor">#ifndef __mqtt_delivery_token_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define __mqtt_delivery_token_h</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span>
<a name="l00027"></a>00027 <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00028"></a>00028 <span class="preprocessor"> #include &quot;MQTTAsync.h&quot;</span>
<a name="l00029"></a>00029 }
<a name="l00030"></a>00030
<a name="l00031"></a>00031 <span class="preprocessor">#include &quot;<a class="code" href="token_8h.html" title="Declaration of MQTT token class.">mqtt/token.h</a>&quot;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &quot;<a class="code" href="message_8h.html" title="Declaration of MQTT message class.">mqtt/message.h</a>&quot;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;memory&gt;</span>
<a name="l00034"></a>00034
<a name="l00035"></a>00035 <span class="keyword">namespace </span>mqtt {
<a name="l00036"></a>00036
<a name="l00038"></a>00038
<a name="l00042"></a><a class="code" href="classmqtt_1_1idelivery__token.html">00042</a> <span class="keyword">class </span><a class="code" href="classmqtt_1_1idelivery__token.html" title="Provides a mechanism for tracking the delivery of a message.">idelivery_token</a> : <span class="keyword">public</span> <span class="keyword">virtual</span> <a class="code" href="classmqtt_1_1itoken.html" title="Provides a mechanism for tracking the completion of an asynchronous task.">itoken</a>
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044 <span class="keyword">public</span>:
<a name="l00045"></a>00045 <span class="keyword">typedef</span> std::shared_ptr&lt;idelivery_token&gt; ptr_t;
<a name="l00050"></a>00050 <span class="keyword">virtual</span> message_ptr <a class="code" href="classmqtt_1_1idelivery__token.html#a0893fbca7c700c4d2389ec180f4d3224" title="Returns the message associated with this token.">get_message</a>() <span class="keyword">const</span> =0;
<a name="l00051"></a>00051 };
<a name="l00052"></a>00052
<a name="l00053"></a>00053 <span class="keyword">typedef</span> idelivery_token::ptr_t idelivery_token_ptr;
<a name="l00054"></a>00054
<a name="l00056"></a>00056
<a name="l00062"></a><a class="code" href="classmqtt_1_1delivery__token.html">00062</a> <span class="keyword">class </span><a class="code" href="classmqtt_1_1delivery__token.html" title="Provides a mechanism to track the delivery progress of a message.">delivery_token</a> : <span class="keyword">public</span> <span class="keyword">virtual</span> <a class="code" href="classmqtt_1_1idelivery__token.html" title="Provides a mechanism for tracking the delivery of a message.">idelivery_token</a>,
<a name="l00063"></a>00063 <span class="keyword">public</span> <a class="code" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a>
<a name="l00064"></a>00064 {
<a name="l00066"></a>00066 message_ptr msg_;
<a name="l00067"></a>00067
<a name="l00069"></a><a class="code" href="classmqtt_1_1delivery__token.html#ac39954340d8b15edaa883af1bcfcf7ae">00069</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classmqtt_1_1async__client.html" title="Lightweight client for talking to an MQTT server using non-blocking methods that...">async_client</a>;
<a name="l00070"></a>00070
<a name="l00075"></a>00075 <span class="keywordtype">void</span> set_message(message_ptr msg) { msg_ = msg; }
<a name="l00076"></a>00076
<a name="l00077"></a>00077 <span class="keyword">public</span>:
<a name="l00081"></a><a class="code" href="classmqtt_1_1delivery__token.html#a4c913bf67fcc303f2fae41b22c73164e">00081</a> <span class="keyword">typedef</span> std::shared_ptr&lt;delivery_token&gt; <a class="code" href="classmqtt_1_1delivery__token.html#a4c913bf67fcc303f2fae41b22c73164e" title="Smart/shared pointer to this class.">ptr_t</a>;
<a name="l00082"></a>00082
<a name="l00083"></a>00083 <a class="code" href="classmqtt_1_1delivery__token.html" title="Provides a mechanism to track the delivery progress of a message.">delivery_token</a>(<a class="code" href="classmqtt_1_1iasync__client.html" title="Enables an application to communicate with an MQTT server using non-blocking methods...">iasync_client</a>&amp; cli) : <a class="code" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a>(cli) {}
<a name="l00084"></a>00084
<a name="l00085"></a>00085 <a class="code" href="classmqtt_1_1delivery__token.html" title="Provides a mechanism to track the delivery progress of a message.">delivery_token</a>(<a class="code" href="classmqtt_1_1iasync__client.html" title="Enables an application to communicate with an MQTT server using non-blocking methods...">iasync_client</a>&amp; cli, <span class="keyword">const</span> std::string&amp; <a class="code" href="classmqtt_1_1topic.html" title="Represents a topic destination, used for publish/subscribe messaging.">topic</a>) : <a class="code" href="classmqtt_1_1token.html" title="Provides a mechanism for tracking the completion of an asynchronous action.">token</a>(cli, topic) {}
<a name="l00086"></a>00086
<a name="l00087"></a>00087 delivery_token(iasync_client&amp; cli, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; topics)
<a name="l00088"></a>00088 : <a class="code" href="classmqtt_1_1token.html#a5d479b98ffa8efdd8e85c0d647f02a15" title="Constructs a token object.">token</a>(cli, topics) {}
<a name="l00089"></a>00089
<a name="l00090"></a>00090 <span class="comment">//delivery_token(const std::string&amp; logContext);</span>
<a name="l00091"></a>00091
<a name="l00096"></a><a class="code" href="classmqtt_1_1delivery__token.html#a30e8217f6b395170fff24733c5716a08">00096</a> <span class="keyword">virtual</span> message_ptr <a class="code" href="classmqtt_1_1delivery__token.html#a30e8217f6b395170fff24733c5716a08" title="Returns the message associated with this token.">get_message</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> msg_; }
<a name="l00097"></a>00097 };
<a name="l00098"></a>00098
<a name="l00102"></a>00102 <span class="keyword">typedef</span> <a class="code" href="classmqtt_1_1delivery__token.html#a4c913bf67fcc303f2fae41b22c73164e" title="Smart/shared pointer to this class.">delivery_token::ptr_t</a> delivery_token_ptr;
<a name="l00103"></a>00103
<a name="l00105"></a>00105 <span class="comment">// end namespace mqtt</span>
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107
<a name="l00108"></a>00108 <span class="preprocessor">#endif // __mqtt_delivery_token_h</span>
<a name="l00109"></a>00109 <span class="preprocessor"></span>
</pre></div></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>