| <!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::ipersistable 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 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 List</span></a></li> |
| <li><a href="classes.html"><span>Class Index</span></a></li> |
| <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> |
| <li><a href="functions.html"><span>Class Members</span></a></li> |
| </ul> |
| </div> |
| <div class="navpath"><b>mqtt</b>::<a class="el" href="classmqtt_1_1ipersistable.html">ipersistable</a> |
| </div> |
| </div> |
| <div class="contents"> |
| <h1>mqtt::ipersistable Class Reference</h1><!-- doxytag: class="mqtt::ipersistable" --> |
| <p>Represents an object used to pass data to be persisted across the MqttClientPersistence interface. |
| <a href="#_details">More...</a></p> |
| |
| <p><code>#include <<a class="el" href="ipersistable_8h_source.html">ipersistable.h</a>></code></p> |
| |
| <p><a href="classmqtt_1_1ipersistable-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="ae17a8c2edd1852f427eb5ff520fa45c8"></a><!-- doxytag: member="mqtt::ipersistable::ptr_t" ref="ae17a8c2edd1852f427eb5ff520fa45c8" args="" --> |
| typedef std::shared_ptr<br class="typebreak"/> |
| < <a class="el" href="classmqtt_1_1ipersistable.html">ipersistable</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1ipersistable.html#ae17a8c2edd1852f427eb5ff520fa45c8">ptr_t</a></td></tr> |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Smart/shared pointer to this class. <br/></td></tr> |
| <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac02929cb8906fa53dda75d9cd917fbd3"></a><!-- doxytag: member="mqtt::ipersistable::~ipersistable" ref="ac02929cb8906fa53dda75d9cd917fbd3" args="()" --> |
| virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1ipersistable.html#ac02929cb8906fa53dda75d9cd917fbd3">~ipersistable</a> ()</td></tr> |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Virtual destructor. <br/></td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">virtual const uint8_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1ipersistable.html#a5e744d618be72f5350ef249e2e8e1a9f">get_header_bytes</a> () const =0</td></tr> |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the header bytes in an array. <a href="#a5e744d618be72f5350ef249e2e8e1a9f"></a><br/></td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">virtual std::vector< uint8_t > </td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1ipersistable.html#a3907db1d0ffcdfd2cfe3585493f85b7d">get_header_byte_arr</a> () const =0</td></tr> |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the header bytes in an array. <a href="#a3907db1d0ffcdfd2cfe3585493f85b7d"></a><br/></td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1ipersistable.html#afafc9251d83c85b5be9fd8f5c5cb6e96">get_header_length</a> () const =0</td></tr> |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the length of the header. <a href="#afafc9251d83c85b5be9fd8f5c5cb6e96"></a><br/></td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1ipersistable.html#a080a0e8919c54bcfc548e0e02975991a">get_header_offset</a> () const =0</td></tr> |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the offset of the header within the byte array returned by <a class="el" href="classmqtt_1_1ipersistable.html#a5e744d618be72f5350ef249e2e8e1a9f" title="Returns the header bytes in an array.">get_header_bytes()</a>. <a href="#a080a0e8919c54bcfc548e0e02975991a"></a><br/></td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">virtual const uint8_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1ipersistable.html#a0be9dff3255662056a5e853631272d8d">get_payload_bytes</a> () const =0</td></tr> |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the payload bytes in an array. <a href="#a0be9dff3255662056a5e853631272d8d"></a><br/></td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">virtual std::vector< uint8_t > </td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1ipersistable.html#ac21fc97fbf6be4f69b82de29db45fbcc">get_payload_byte_arr</a> () const =0</td></tr> |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the payload bytes in an array. <a href="#ac21fc97fbf6be4f69b82de29db45fbcc"></a><br/></td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1ipersistable.html#abb701ea822c67608a1057d93fbb1037a">get_payload_length</a> () const =0</td></tr> |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the length of the payload. <a href="#abb701ea822c67608a1057d93fbb1037a"></a><br/></td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmqtt_1_1ipersistable.html#a2542383f0da366ba76b7b07151fe23b4">get_payload_offset</a> () const =0</td></tr> |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the offset of the payload within the byte array returned by <a class="el" href="classmqtt_1_1ipersistable.html#a0be9dff3255662056a5e853631272d8d" title="Returns the payload bytes in an array.">get_payload_bytes()</a>. <a href="#a2542383f0da366ba76b7b07151fe23b4"></a><br/></td></tr> |
| </table> |
| <hr/><a name="_details"></a><h2>Detailed Description</h2> |
| <p>Represents an object used to pass data to be persisted across the MqttClientPersistence interface. </p> |
| <p>When data is passed across the interface the header and payload are separated, so that unnecessary <a class="el" href="classmqtt_1_1message.html" title="An MQTT message holds the application payload and options specifying how the message...">message</a> copies may be avoided. For example, if a 10 MB payload was published it would be inefficient to create a byte array a few bytes larger than 10 MB and copy the MQTT <a class="el" href="classmqtt_1_1message.html" title="An MQTT message holds the application payload and options specifying how the message...">message</a> header and payload into a contiguous byte array.</p> |
| <p>When the request to persist data is made a separate byte array and offset is passed for the header and payload. Only the data between offset and length need be persisted. So for example, 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 be persisted consists of a header byte array starting at offset 1 and length 4, plus a payload byte array starting at offset 30 and length 40000. There are three ways in which the persistence implementation may return data to 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> on recovery:</p> |
| <ul> |
| <li>It could return the data as it was passed in originally, with the same byte arrays and offsets.</li> |
| </ul> |
| <ul> |
| <li>It could safely just persist and return the bytes from the offset for the specified length. For example, return a header byte array with offset 0 and length 4, plus a payload byte array with offset 0 and length 40000</li> |
| </ul> |
| <ul> |
| <li>It could return the header and payload as a contiguous byte array with the header bytes preceeding the payload. The contiguous byte array should be set as the header byte array, with the payload byte array being null. For example, return a single byte array with offset 0 and length 40004. This is useful when recovering from a file where the header and payload could be written as a contiguous stream of bytes. </li> |
| </ul> |
| <hr/><h2>Member Function Documentation</h2> |
| <a class="anchor" id="a3907db1d0ffcdfd2cfe3585493f85b7d"></a><!-- doxytag: member="mqtt::ipersistable::get_header_byte_arr" ref="a3907db1d0ffcdfd2cfe3585493f85b7d" args="() const =0" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual std::vector<uint8_t> mqtt::ipersistable::get_header_byte_arr </td> |
| <td>(</td> |
| <td class="paramname"></td> |
| <td> ) </td> |
| <td> const<code> [pure virtual]</code></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p>Returns the header bytes in an array. </p> |
| <dl class="return"><dt><b>Returns:</b></dt><dd>std::vector<uint8_t> </dd></dl> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a5e744d618be72f5350ef249e2e8e1a9f"></a><!-- doxytag: member="mqtt::ipersistable::get_header_bytes" ref="a5e744d618be72f5350ef249e2e8e1a9f" args="() const =0" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual const uint8_t* mqtt::ipersistable::get_header_bytes </td> |
| <td>(</td> |
| <td class="paramname"></td> |
| <td> ) </td> |
| <td> const<code> [pure virtual]</code></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p>Returns the header bytes in an array. </p> |
| <dl class="return"><dt><b>Returns:</b></dt><dd>std::vector<uint8_t> </dd></dl> |
| |
| </div> |
| </div> |
| <a class="anchor" id="afafc9251d83c85b5be9fd8f5c5cb6e96"></a><!-- doxytag: member="mqtt::ipersistable::get_header_length" ref="afafc9251d83c85b5be9fd8f5c5cb6e96" args="() const =0" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual size_t mqtt::ipersistable::get_header_length </td> |
| <td>(</td> |
| <td class="paramname"></td> |
| <td> ) </td> |
| <td> const<code> [pure virtual]</code></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p>Returns the length of the header. </p> |
| <dl class="return"><dt><b>Returns:</b></dt><dd>int </dd></dl> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a080a0e8919c54bcfc548e0e02975991a"></a><!-- doxytag: member="mqtt::ipersistable::get_header_offset" ref="a080a0e8919c54bcfc548e0e02975991a" args="() const =0" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual size_t mqtt::ipersistable::get_header_offset </td> |
| <td>(</td> |
| <td class="paramname"></td> |
| <td> ) </td> |
| <td> const<code> [pure virtual]</code></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p>Returns the offset of the header within the byte array returned by <a class="el" href="classmqtt_1_1ipersistable.html#a5e744d618be72f5350ef249e2e8e1a9f" title="Returns the header bytes in an array.">get_header_bytes()</a>. </p> |
| <dl class="return"><dt><b>Returns:</b></dt><dd>int </dd></dl> |
| |
| </div> |
| </div> |
| <a class="anchor" id="ac21fc97fbf6be4f69b82de29db45fbcc"></a><!-- doxytag: member="mqtt::ipersistable::get_payload_byte_arr" ref="ac21fc97fbf6be4f69b82de29db45fbcc" args="() const =0" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual std::vector<uint8_t> mqtt::ipersistable::get_payload_byte_arr </td> |
| <td>(</td> |
| <td class="paramname"></td> |
| <td> ) </td> |
| <td> const<code> [pure virtual]</code></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p>Returns the payload bytes in an array. </p> |
| <dl class="return"><dt><b>Returns:</b></dt><dd>std::vector<uint8_t> </dd></dl> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a0be9dff3255662056a5e853631272d8d"></a><!-- doxytag: member="mqtt::ipersistable::get_payload_bytes" ref="a0be9dff3255662056a5e853631272d8d" args="() const =0" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual const uint8_t* mqtt::ipersistable::get_payload_bytes </td> |
| <td>(</td> |
| <td class="paramname"></td> |
| <td> ) </td> |
| <td> const<code> [pure virtual]</code></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p>Returns the payload bytes in an array. </p> |
| <dl class="return"><dt><b>Returns:</b></dt><dd>std::vector<uint8_t> </dd></dl> |
| |
| </div> |
| </div> |
| <a class="anchor" id="abb701ea822c67608a1057d93fbb1037a"></a><!-- doxytag: member="mqtt::ipersistable::get_payload_length" ref="abb701ea822c67608a1057d93fbb1037a" args="() const =0" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual size_t mqtt::ipersistable::get_payload_length </td> |
| <td>(</td> |
| <td class="paramname"></td> |
| <td> ) </td> |
| <td> const<code> [pure virtual]</code></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p>Returns the length of the payload. </p> |
| <dl class="return"><dt><b>Returns:</b></dt><dd>int </dd></dl> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a2542383f0da366ba76b7b07151fe23b4"></a><!-- doxytag: member="mqtt::ipersistable::get_payload_offset" ref="a2542383f0da366ba76b7b07151fe23b4" args="() const =0" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual size_t mqtt::ipersistable::get_payload_offset </td> |
| <td>(</td> |
| <td class="paramname"></td> |
| <td> ) </td> |
| <td> const<code> [pure virtual]</code></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p>Returns the offset of the payload within the byte array returned by <a class="el" href="classmqtt_1_1ipersistable.html#a0be9dff3255662056a5e853631272d8d" title="Returns the payload bytes in an array.">get_payload_bytes()</a>. </p> |
| <dl class="return"><dt><b>Returns:</b></dt><dd>int </dd></dl> |
| |
| </div> |
| </div> |
| <hr/>The documentation for this class was generated from the following file:<ul> |
| <li>mqtt/<a class="el" href="ipersistable_8h_source.html">ipersistable.h</a></li> |
| </ul> |
| </div> |
| <hr size="1"/><address style="text-align: right;"><small>Generated on 30 Apr 2014 for mqttpp by |
| <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> |
| </body> |
| </html> |