PIChunkStream

git-svn-id: svn://db.shs.com.ru/pip@176 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2016-01-31 09:05:23 +00:00
parent 57a7af0b35
commit cc22bf0c67
390 changed files with 5229 additions and 3603 deletions

View File

@@ -87,7 +87,9 @@ $(document).ready(function(){initNavTree('class_p_i_binary_log.html','');});
<div class="dynheader">
Inheritance diagram for PIBinaryLog:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="class_p_i_binary_log__inherit__graph.svg" width="122" height="262"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<div class="center"><img src="class_p_i_binary_log__inherit__graph.png" border="0" usemap="#_p_i_binary_log_inherit__map" alt="Inheritance graph"/></div>
<map name="_p_i_binary_log_inherit__map" id="_p_i_binary_log_inherit__map">
<area shape="rect" id="node2" href="class_p_i_i_o_device.html" title="Base class for input/output classes. " alt="" coords="9,155,112,181"/><area shape="rect" id="node3" href="class_p_i_thread.html" title="Thread class. " alt="" coords="17,80,104,107"/><area shape="rect" id="node4" href="class_p_i_object.html" title="This is base class for any classes which use events &#45;&gt; handlers mechanism. " alt="" coords="17,5,104,32"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
@@ -157,7 +159,7 @@ Public Member Functions</h2></td></tr>
<tr class="separator:a6dba45d4bc34989b7f35ddb4121357b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab448c517448d28fbd60cd291f577dd87"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab448c517448d28fbd60cd291f577dd87"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#ab448c517448d28fbd60cd291f577dd87">defaultID</a> () const </td></tr>
<tr class="memdesc:ab448c517448d28fbd60cd291f577dd87"><td class="mdescLeft">&#160;</td><td class="mdescRight">Current LogDir, returns directory where billogs wiil be saved. <br /></td></tr>
<tr class="memdesc:ab448c517448d28fbd60cd291f577dd87"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default ID, used in <em>write</em> function. <br /></td></tr>
<tr class="separator:ab448c517448d28fbd60cd291f577dd87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ad2125ec5521ea4ea100872863a9723"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0ad2125ec5521ea4ea100872863a9723"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#a0ad2125ec5521ea4ea100872863a9723">playSpeed</a> () const </td></tr>
@@ -183,6 +185,10 @@ int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#ac3c5ff83fdc8fea6711d53d4c08addae">rapidStart</a> () const </td></tr>
<tr class="memdesc:ac3c5ff83fdc8fea6711d53d4c08addae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns if rapid start enabled. <br /></td></tr>
<tr class="separator:ac3c5ff83fdc8fea6711d53d4c08addae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0586249105ab24e2b7975207882fe7bf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0586249105ab24e2b7975207882fe7bf"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#a0586249105ab24e2b7975207882fe7bf">createNewFile</a> (const <a class="el" href="class_p_i_string.html">PIString</a> &amp;<a class="el" href="class_p_i_i_o_device.html#a8bc4ff38695ab514f95fa1fa4da0f344">path</a>)</td></tr>
<tr class="memdesc:a0586249105ab24e2b7975207882fe7bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create binlog file with Filename = path. <br /></td></tr>
<tr class="separator:a0586249105ab24e2b7975207882fe7bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafbce26312ccb6c092a6f756b4fcd3c9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aafbce26312ccb6c092a6f756b4fcd3c9"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#aafbce26312ccb6c092a6f756b4fcd3c9">setPlayMode</a> (<a class="el" href="class_p_i_binary_log.html#a96a2d901e8d7b309a49003b3fa1846dc">PlayMode</a> <a class="el" href="class_p_i_i_o_device.html#aec8176a5b88b98aacba528b1dd20c7c4">mode</a>)</td></tr>
<tr class="memdesc:aafbce26312ccb6c092a6f756b4fcd3c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set <em>PlayMode</em>. <br /></td></tr>
@@ -229,18 +235,22 @@ int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#ab5002c94f2c849c0d341ac101578df43">writeBinLog</a> (int id, const void *<a class="el" href="class_p_i_thread.html#aa3c4138dc000e34fb74140d0a5be3afe">data</a>, int size)</td></tr>
<tr class="memdesc:ab5002c94f2c849c0d341ac101578df43"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write one record to BinLog file, with ID = id, id must be greather than 0. <br /></td></tr>
<tr class="separator:ab5002c94f2c849c0d341ac101578df43"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8815b776df2f7f73782b4e2f1683e42c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8815b776df2f7f73782b4e2f1683e42c"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#a8815b776df2f7f73782b4e2f1683e42c">writeBinLog_raw</a> (int id, const <a class="el" href="class_p_i_system_time.html">PISystemTime</a> &amp;time, const <a class="el" href="class_p_i_byte_array.html">PIByteArray</a> &amp;<a class="el" href="class_p_i_thread.html#aa3c4138dc000e34fb74140d0a5be3afe">data</a>)</td></tr>
<tr class="memdesc:a8815b776df2f7f73782b4e2f1683e42c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write one RAW record to BinLog file, with ID = id, Timestamp = time. <br /></td></tr>
<tr class="separator:a8815b776df2f7f73782b4e2f1683e42c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2c172d1b91528d2550b57ed100b65b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae2c172d1b91528d2550b57ed100b65b7"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#ae2c172d1b91528d2550b57ed100b65b7">writeCount</a> () const </td></tr>
<tr class="memdesc:ae2c172d1b91528d2550b57ed100b65b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns count of writed records. <br /></td></tr>
<tr class="separator:ae2c172d1b91528d2550b57ed100b65b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bfb70980b9842e06e8a5ed88a8829bf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5bfb70980b9842e06e8a5ed88a8829bf"></a>
<a class="el" href="class_p_i_byte_array.html">PIByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#a5bfb70980b9842e06e8a5ed88a8829bf">readBinLog</a> (int id=0)</td></tr>
<tr class="memdesc:a5bfb70980b9842e06e8a5ed88a8829bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read one record from BinLog file, with ID = id, if id = 0 than any id will be readed. <br /></td></tr>
<tr class="separator:a5bfb70980b9842e06e8a5ed88a8829bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a181b041101815059e03ea8e8cb36502b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a181b041101815059e03ea8e8cb36502b"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#a181b041101815059e03ea8e8cb36502b">readBinLog</a> (int id, void *read_to, int max_size)</td></tr>
<tr class="memdesc:a181b041101815059e03ea8e8cb36502b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read one record from BinLog file, with ID = id, if id = 0 than any id will be readed. <br /></td></tr>
<tr class="separator:a181b041101815059e03ea8e8cb36502b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d09347d6933b86b7fe18bf0da8d58e6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0d09347d6933b86b7fe18bf0da8d58e6"></a>
<a class="el" href="class_p_i_byte_array.html">PIByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#a0d09347d6933b86b7fe18bf0da8d58e6">readBinLog</a> (int id=0, <a class="el" href="class_p_i_system_time.html">PISystemTime</a> *time=0)</td></tr>
<tr class="memdesc:a0d09347d6933b86b7fe18bf0da8d58e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read one record from BinLog file, with ID = id, if id = 0 than any id will be readed. <br /></td></tr>
<tr class="separator:a0d09347d6933b86b7fe18bf0da8d58e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f7fecfa9d5426197324700a912781c5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7f7fecfa9d5426197324700a912781c5"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#a7f7fecfa9d5426197324700a912781c5">readBinLog</a> (int id, void *read_to, int max_size, <a class="el" href="class_p_i_system_time.html">PISystemTime</a> *time=0)</td></tr>
<tr class="memdesc:a7f7fecfa9d5426197324700a912781c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read one record from BinLog file, with ID = id, if id = 0 than any id will be readed. <br /></td></tr>
<tr class="separator:a7f7fecfa9d5426197324700a912781c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77710e9ce61a2f20187b886a397d82b1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a77710e9ce61a2f20187b886a397d82b1"></a>
llong&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#a77710e9ce61a2f20187b886a397d82b1">logSize</a> () const </td></tr>
<tr class="memdesc:a77710e9ce61a2f20187b886a397d82b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns binary log file size. <br /></td></tr>
@@ -307,6 +317,10 @@ int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class
<a class="el" href="class_p_i_i_o_device.html#a546a024c6ff4a1dca9350b520e73b595">DeviceMode</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_i_o_device.html#aec8176a5b88b98aacba528b1dd20c7c4">mode</a> () const </td></tr>
<tr class="memdesc:aec8176a5b88b98aacba528b1dd20c7c4 inherit pub_methods_class_p_i_i_o_device"><td class="mdescLeft">&#160;</td><td class="mdescRight">Current open mode of device. <br /></td></tr>
<tr class="separator:aec8176a5b88b98aacba528b1dd20c7c4 inherit pub_methods_class_p_i_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a589767ed326f04724ecfb3f73d51dc6d inherit pub_methods_class_p_i_i_o_device"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a589767ed326f04724ecfb3f73d51dc6d"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_i_o_device.html#a589767ed326f04724ecfb3f73d51dc6d">setMode</a> (<a class="el" href="class_p_i_i_o_device.html#a546a024c6ff4a1dca9350b520e73b595">DeviceMode</a> m)</td></tr>
<tr class="memdesc:a589767ed326f04724ecfb3f73d51dc6d inherit pub_methods_class_p_i_i_o_device"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set open mode of device. <br /></td></tr>
<tr class="separator:a589767ed326f04724ecfb3f73d51dc6d inherit pub_methods_class_p_i_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8bc4ff38695ab514f95fa1fa4da0f344 inherit pub_methods_class_p_i_i_o_device"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8bc4ff38695ab514f95fa1fa4da0f344"></a>
<a class="el" href="class_p_i_string.html">PIString</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_i_o_device.html#a8bc4ff38695ab514f95fa1fa4da0f344">path</a> () const </td></tr>
<tr class="memdesc:a8bc4ff38695ab514f95fa1fa4da0f344 inherit pub_methods_class_p_i_i_o_device"><td class="mdescLeft">&#160;</td><td class="mdescRight">Current path of device. <br /></td></tr>
@@ -681,8 +695,9 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="clas
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#a26af6aa5384bdd3160908ec8cb1942b5">propertyChanged</a> (const <a class="el" href="class_p_i_string.html">PIString</a> &amp;)</td></tr>
<tr class="memdesc:a26af6aa5384bdd3160908ec8cb1942b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Virtual function executes after property with name "name" has been changed. <br /></td></tr>
<tr class="separator:a26af6aa5384bdd3160908ec8cb1942b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78ea56ff4489d441205ded106c63966e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#a78ea56ff4489d441205ded106c63966e">threadedRead</a> (uchar *readed, int size)</td></tr>
<tr class="memdesc:a78ea56ff4489d441205ded106c63966e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function executed when thread read some data, default implementation execute external slot "ret_func_". <a href="#a78ea56ff4489d441205ded106c63966e">More...</a><br /></td></tr>
<tr class="memitem:a78ea56ff4489d441205ded106c63966e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a78ea56ff4489d441205ded106c63966e"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_binary_log.html#a78ea56ff4489d441205ded106c63966e">threadedRead</a> (uchar *readed, int size)</td></tr>
<tr class="memdesc:a78ea56ff4489d441205ded106c63966e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function executed when thread read some data, default implementation execute external slot "ret_func_". <br /></td></tr>
<tr class="separator:a78ea56ff4489d441205ded106c63966e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_class_p_i_i_o_device"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_class_p_i_i_o_device')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="class_p_i_i_o_device.html">PIIODevice</a></td></tr>
<tr class="memitem:a587c32639f2732920338a363ad163d81 inherit pro_methods_class_p_i_i_o_device"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a587c32639f2732920338a363ad163d81"></a>
@@ -912,7 +927,7 @@ Additional Inherited Members</h2></td></tr>
<p>TODO: Create static functions to split and join binlog files TODO: Create functions to insert and delete records</p>
<h1><a class="anchor" id="PIBinaryLog_sec0"></a>
Synopsis</h1>
<p>Binary Log is a file with simple header, where you can read and write some binary data. Any written data include special header with ID, size and timestamp. This header provides separation different messages from the one file by choosing different IDs. With <em>filterID</em> or special functions, like <em><a class="el" href="class_p_i_binary_log.html#a5bfb70980b9842e06e8a5ed88a8829bf" title="Read one record from BinLog file, with ID = id, if id = 0 than any id will be readed. ">readBinLog()</a></em> you can choose IDs what you want to read. With function <em><a class="el" href="class_p_i_binary_log.html#a3a53507e6ec360b5ba09e04c15502c11" title="Write one record to BinLog file, with ID = id, id must be greather than 0. ">writeBinLog()</a></em> or <em><a class="el" href="class_p_i_binary_log.html#aea988168342f83b830661c1bd067a9a0" title="Set defaultID, used in write function. ">setDefaultID()</a></em> you can choose ID that mark you data. By default ID = 1, and <em>filterID</em> is empty, that mean you read any ID without filtering. ThreadedRead provide you playback data, with delay that you write data. You can choose different playbak modes by set <em>PlayMode</em>.</p>
<p>Binary Log is a file with simple header, where you can read and write some binary data. Any written data include special header with ID, size and timestamp. This header provides separation different messages from the one file by choosing different IDs. With <em>filterID</em> or special functions, like <em><a class="el" href="class_p_i_binary_log.html#a0d09347d6933b86b7fe18bf0da8d58e6" title="Read one record from BinLog file, with ID = id, if id = 0 than any id will be readed. ">readBinLog()</a></em> you can choose IDs what you want to read. With function <em><a class="el" href="class_p_i_binary_log.html#a3a53507e6ec360b5ba09e04c15502c11" title="Write one record to BinLog file, with ID = id, id must be greather than 0. ">writeBinLog()</a></em> or <em><a class="el" href="class_p_i_binary_log.html#aea988168342f83b830661c1bd067a9a0" title="Set defaultID, used in write function. ">setDefaultID()</a></em> you can choose ID that mark you data. By default ID = 1, and <em>filterID</em> is empty, that mean you read any ID without filtering. ThreadedRead provide you playback data, with delay that you write data. You can choose different playbak modes by set <em>PlayMode</em>.</p>
<h1><a class="anchor" id="PIBinaryLog_sec1"></a>
Basic usage</h1>
<p>This class provide all functions of <em><a class="el" href="class_p_i_i_o_device.html" title="Base class for input/output classes. ">PIIODevice</a></em>, such <em><a class="el" href="class_p_i_i_o_device.html#a9df120510444c1ebe5fea7a7ca8e07d5" title="Open device. ">open()</a></em>, <em><a class="el" href="class_p_i_i_o_device.html#ad59f415f0fec6692f1b2982b7deabf50" title="Close device. ">close()</a></em>, <em><a class="el" href="class_p_i_binary_log.html#a14e2dda93e6e19c2b9cf003d4c5d70fd" title="Set position in file to reading/playing. ">read()</a></em> ,<em><a class="el" href="class_p_i_binary_log.html#a3a6adfae7fb359a7baa016a3df3819d3" title="Write one record to BinLog file, with ID = &quot;defaultID&quot;. ">write()</a></em>, and threaded read/write. function <em><a class="el" href="class_p_i_binary_log.html#a5bb6485891eb08ebafb1af0dbe6d4baf" title="Set path to directory where binlogs will be saved. ">setLogDir()</a></em> need to set directory for BinLog files function <em><a class="el" href="class_p_i_binary_log.html#ac5c3e00d5fe2bd28e0c27af39c18717f" title="Create new binlog file in logDir, if successful returns filename, else returns empty string...">createNewFile()</a></em> need to create new binlog file function <em><a class="el" href="class_p_i_binary_log.html#a776e7c48df18b40ef88cc703b3b32267" title="Go to begin of BinLog file. ">restart()</a></em> need start from the begining of binlog file </p>
@@ -1178,45 +1193,6 @@ Basic usage</h1>
<p>TODO: Think about index positions. </p>
<p>Get binlog info and statistic </p>
</div>
</div>
<a class="anchor" id="a78ea56ff4489d441205ded106c63966e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool PIBinaryLog::threadedRead </td>
<td>(</td>
<td class="paramtype">uchar *&#160;</td>
<td class="paramname"><em>readed</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>size</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Function executed when thread read some data, default implementation execute external slot "ret_func_". </p>
<p>TODO: Sleep by steps (about 100ms) </p>
<p>Reimplemented from <a class="el" href="class_p_i_i_o_device.html#a3c744704af365358af074e1089e20068">PIIODevice</a>.</p>
</div>
</div>
</div><!-- contents -->
@@ -1225,7 +1201,7 @@ Basic usage</h1>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="class_p_i_binary_log.html">PIBinaryLog</a></li>
<li class="footer">Generated on Mon Mar 23 2015 14:12:38 for PIP by
<li class="footer">Generated on Sat Jan 30 2016 21:43:28 for PIP by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
</ul>