blob: 665b3a810529f4f5f26fdd84542d89f733e2d53e [file]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Avro C++: avro::DataFileReader&lt; T &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Avro C++
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceavro.html">avro</a></li><li class="navelem"><a class="el" href="classavro_1_1DataFileReader.html">DataFileReader</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classavro_1_1DataFileReader-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">avro::DataFileReader&lt; T &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Reads the contents of data file one after another.
<a href="classavro_1_1DataFileReader.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="DataFile_8hh_source.html">DataFile.hh</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for avro::DataFileReader&lt; T &gt;:</div>
<div class="dyncontent">
<div class="center">
<img src="classavro_1_1DataFileReader.png" alt=""/>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:adf75cbffd7028e2e383e15ae8caadbe4"><td class="memItemLeft" align="right" valign="top"><a id="adf75cbffd7028e2e383e15ae8caadbe4"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classavro_1_1DataFileReader.html#adf75cbffd7028e2e383e15ae8caadbe4">DataFileReader</a> (const char *filename, const <a class="el" href="classavro_1_1ValidSchema.html">ValidSchema</a> &amp;<a class="el" href="classavro_1_1DataFileReader.html#adfc2ab1b9b78c213e54ddd2e551aeefd">readerSchema</a>)</td></tr>
<tr class="memdesc:adf75cbffd7028e2e383e15ae8caadbe4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs the reader for the given file and the reader is expected to use the given schema. <br /></td></tr>
<tr class="separator:adf75cbffd7028e2e383e15ae8caadbe4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4edb0070537a540a9600667467a1915b"><td class="memItemLeft" align="right" valign="top"><a id="a4edb0070537a540a9600667467a1915b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>DataFileReader</b> (std::unique_ptr&lt; <a class="el" href="classavro_1_1InputStream.html">InputStream</a> &gt; inputStream, const <a class="el" href="classavro_1_1ValidSchema.html">ValidSchema</a> &amp;<a class="el" href="classavro_1_1DataFileReader.html#adfc2ab1b9b78c213e54ddd2e551aeefd">readerSchema</a>)</td></tr>
<tr class="separator:a4edb0070537a540a9600667467a1915b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1059583ebd55c0047b49d5933883a03"><td class="memItemLeft" align="right" valign="top"><a id="ab1059583ebd55c0047b49d5933883a03"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classavro_1_1DataFileReader.html#ab1059583ebd55c0047b49d5933883a03">DataFileReader</a> (const char *filename)</td></tr>
<tr class="memdesc:ab1059583ebd55c0047b49d5933883a03"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs the reader for the given file and the reader is expected to use the schema that is used with data. <br /></td></tr>
<tr class="separator:ab1059583ebd55c0047b49d5933883a03"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a536db10677c83b2d88f4ec056013ac2c"><td class="memItemLeft" align="right" valign="top"><a id="a536db10677c83b2d88f4ec056013ac2c"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>DataFileReader</b> (std::unique_ptr&lt; <a class="el" href="classavro_1_1InputStream.html">InputStream</a> &gt; inputStream)</td></tr>
<tr class="separator:a536db10677c83b2d88f4ec056013ac2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a043f1a4ab0541f9eddca9f3214b9eb4a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classavro_1_1DataFileReader.html#a043f1a4ab0541f9eddca9f3214b9eb4a">DataFileReader</a> (std::unique_ptr&lt; <a class="el" href="classavro_1_1DataFileReaderBase.html">DataFileReaderBase</a> &gt; base)</td></tr>
<tr class="memdesc:a043f1a4ab0541f9eddca9f3214b9eb4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a reader using the reader base. <a href="classavro_1_1DataFileReader.html#a043f1a4ab0541f9eddca9f3214b9eb4a">More...</a><br /></td></tr>
<tr class="separator:a043f1a4ab0541f9eddca9f3214b9eb4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35354b2c81a161c4b94b93aa5c6c0709"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classavro_1_1DataFileReader.html#a35354b2c81a161c4b94b93aa5c6c0709">DataFileReader</a> (std::unique_ptr&lt; <a class="el" href="classavro_1_1DataFileReaderBase.html">DataFileReaderBase</a> &gt; base, const <a class="el" href="classavro_1_1ValidSchema.html">ValidSchema</a> &amp;<a class="el" href="classavro_1_1DataFileReader.html#adfc2ab1b9b78c213e54ddd2e551aeefd">readerSchema</a>)</td></tr>
<tr class="memdesc:a35354b2c81a161c4b94b93aa5c6c0709"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a reader using the reader base. <a href="classavro_1_1DataFileReader.html#a35354b2c81a161c4b94b93aa5c6c0709">More...</a><br /></td></tr>
<tr class="separator:a35354b2c81a161c4b94b93aa5c6c0709"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d75e6f33030737fb15da2c57e63ec9f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classavro_1_1DataFileReader.html#a9d75e6f33030737fb15da2c57e63ec9f">read</a> (T &amp;datum)</td></tr>
<tr class="memdesc:a9d75e6f33030737fb15da2c57e63ec9f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the next entry from the data file. <a href="classavro_1_1DataFileReader.html#a9d75e6f33030737fb15da2c57e63ec9f">More...</a><br /></td></tr>
<tr class="separator:a9d75e6f33030737fb15da2c57e63ec9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfc2ab1b9b78c213e54ddd2e551aeefd"><td class="memItemLeft" align="right" valign="top"><a id="adfc2ab1b9b78c213e54ddd2e551aeefd"></a>
const <a class="el" href="classavro_1_1ValidSchema.html">ValidSchema</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classavro_1_1DataFileReader.html#adfc2ab1b9b78c213e54ddd2e551aeefd">readerSchema</a> ()</td></tr>
<tr class="memdesc:adfc2ab1b9b78c213e54ddd2e551aeefd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the schema for this object. <br /></td></tr>
<tr class="separator:adfc2ab1b9b78c213e54ddd2e551aeefd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e80d0b64e5eb7f8ffa5b52757171b6c"><td class="memItemLeft" align="right" valign="top"><a id="a1e80d0b64e5eb7f8ffa5b52757171b6c"></a>
const <a class="el" href="classavro_1_1ValidSchema.html">ValidSchema</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classavro_1_1DataFileReader.html#a1e80d0b64e5eb7f8ffa5b52757171b6c">dataSchema</a> ()</td></tr>
<tr class="memdesc:a1e80d0b64e5eb7f8ffa5b52757171b6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the schema stored with the data file. <br /></td></tr>
<tr class="separator:a1e80d0b64e5eb7f8ffa5b52757171b6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af92068c4498f900939e3208a2c370b2e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classavro_1_1DataFileReader.html#af92068c4498f900939e3208a2c370b2e">close</a> ()</td></tr>
<tr class="memdesc:af92068c4498f900939e3208a2c370b2e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes the reader. <a href="classavro_1_1DataFileReader.html#af92068c4498f900939e3208a2c370b2e">More...</a><br /></td></tr>
<tr class="separator:af92068c4498f900939e3208a2c370b2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab09737c46454c2e37df404a5befcbb3"><td class="memItemLeft" align="right" valign="top"><a id="aab09737c46454c2e37df404a5befcbb3"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classavro_1_1DataFileReader.html#aab09737c46454c2e37df404a5befcbb3">seek</a> (int64_t position)</td></tr>
<tr class="memdesc:aab09737c46454c2e37df404a5befcbb3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move to a specific, known synchronization point, for example one returned from <a class="el" href="classavro_1_1DataFileReader.html#a186b6aa483ed15d2ead25570da03a101" title="Return the last synchronization point before our current position.">previousSync()</a>. <br /></td></tr>
<tr class="separator:aab09737c46454c2e37df404a5befcbb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b3e2f8678c50b16ec06ea001730a112"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classavro_1_1DataFileReader.html#a3b3e2f8678c50b16ec06ea001730a112">sync</a> (int64_t position)</td></tr>
<tr class="memdesc:a3b3e2f8678c50b16ec06ea001730a112"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move to the next synchronization point after a position. <a href="classavro_1_1DataFileReader.html#a3b3e2f8678c50b16ec06ea001730a112">More...</a><br /></td></tr>
<tr class="separator:a3b3e2f8678c50b16ec06ea001730a112"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a162788cfe221aeac97d31d9b018e8f84"><td class="memItemLeft" align="right" valign="top"><a id="a162788cfe221aeac97d31d9b018e8f84"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classavro_1_1DataFileReader.html#a162788cfe221aeac97d31d9b018e8f84">pastSync</a> (int64_t position)</td></tr>
<tr class="memdesc:a162788cfe221aeac97d31d9b018e8f84"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return true if past the next synchronization point after a position. <br /></td></tr>
<tr class="separator:a162788cfe221aeac97d31d9b018e8f84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a186b6aa483ed15d2ead25570da03a101"><td class="memItemLeft" align="right" valign="top"><a id="a186b6aa483ed15d2ead25570da03a101"></a>
int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classavro_1_1DataFileReader.html#a186b6aa483ed15d2ead25570da03a101">previousSync</a> ()</td></tr>
<tr class="memdesc:a186b6aa483ed15d2ead25570da03a101"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the last synchronization point before our current position. <br /></td></tr>
<tr class="separator:a186b6aa483ed15d2ead25570da03a101"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename T&gt;<br />
class avro::DataFileReader&lt; T &gt;</h3>
<p>Reads the contents of data file one after another. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a043f1a4ab0541f9eddca9f3214b9eb4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a043f1a4ab0541f9eddca9f3214b9eb4a">&#9670;&nbsp;</a></span>DataFileReader() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classavro_1_1DataFileReader.html">avro::DataFileReader</a>&lt; T &gt;::<a class="el" href="classavro_1_1DataFileReader.html">DataFileReader</a> </td>
<td>(</td>
<td class="paramtype">std::unique_ptr&lt; <a class="el" href="classavro_1_1DataFileReaderBase.html">DataFileReaderBase</a> &gt;&#160;</td>
<td class="paramname"><em>base</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs a reader using the reader base. </p>
<p>This form of constructor allows the user to examine the schema of a given file and then decide to use the right type of data to be deserialize. Without this the user must know the type of data for the template <em>before</em> he knows the schema within the file. The schema present in the data file will be used for reading from this reader. </p>
</div>
</div>
<a id="a35354b2c81a161c4b94b93aa5c6c0709"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35354b2c81a161c4b94b93aa5c6c0709">&#9670;&nbsp;</a></span>DataFileReader() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classavro_1_1DataFileReader.html">avro::DataFileReader</a>&lt; T &gt;::<a class="el" href="classavro_1_1DataFileReader.html">DataFileReader</a> </td>
<td>(</td>
<td class="paramtype">std::unique_ptr&lt; <a class="el" href="classavro_1_1DataFileReaderBase.html">DataFileReaderBase</a> &gt;&#160;</td>
<td class="paramname"><em>base</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classavro_1_1ValidSchema.html">ValidSchema</a> &amp;&#160;</td>
<td class="paramname"><em>readerSchema</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">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs a reader using the reader base. </p>
<p>This form of constructor allows the user to examine the schema of a given file and then decide to use the right type of data to be deserialize. Without this the user must know the type of data for the template <em>before</em> he knows the schema within the file. The argument readerSchema will be used for reading from this reader. </p>
<p class="reference">References <a class="el" href="classavro_1_1DataFileReader.html#adfc2ab1b9b78c213e54ddd2e551aeefd">avro::DataFileReader&lt; T &gt;::readerSchema()</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="af92068c4498f900939e3208a2c370b2e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af92068c4498f900939e3208a2c370b2e">&#9670;&nbsp;</a></span>close()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classavro_1_1DataFileReader.html">avro::DataFileReader</a>&lt; T &gt;::close </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Closes the reader. </p>
<p>No further operation is possible on this reader. </p>
</div>
</div>
<a id="a9d75e6f33030737fb15da2c57e63ec9f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d75e6f33030737fb15da2c57e63ec9f">&#9670;&nbsp;</a></span>read()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classavro_1_1DataFileReader.html">avro::DataFileReader</a>&lt; T &gt;::read </td>
<td>(</td>
<td class="paramtype">T &amp;&#160;</td>
<td class="paramname"><em>datum</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Reads the next entry from the data file. </p>
<dl class="section return"><dt>Returns</dt><dd>true if an object has been successfully read into <code>datum</code> and false if there are no more entries in the file. </dd></dl>
<p class="reference">References <a class="el" href="namespaceavro.html#a9893c6f7b0f264029261056da57fbd2d">avro::decode()</a>.</p>
</div>
</div>
<a id="a3b3e2f8678c50b16ec06ea001730a112"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b3e2f8678c50b16ec06ea001730a112">&#9670;&nbsp;</a></span>sync()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classavro_1_1DataFileReader.html">avro::DataFileReader</a>&lt; T &gt;::sync </td>
<td>(</td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramname"><em>position</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Move to the next synchronization point after a position. </p>
<p>To process a range of file entries, call this with the starting position, then check <a class="el" href="classavro_1_1DataFileReader.html#a162788cfe221aeac97d31d9b018e8f84" title="Return true if past the next synchronization point after a position.">pastSync()</a> with the end point before each call to <a class="el" href="classavro_1_1DataFileReader.html#a9d75e6f33030737fb15da2c57e63ec9f" title="Reads the next entry from the data file.">read()</a>. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>api/<a class="el" href="DataFile_8hh_source.html">DataFile.hh</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>