Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 2aa62c5bbb658df1fece777472a7bcf2 > files > 792

barry-devel-docs-0.17-0.3.20100730git.fc14.noarch.rpm

<!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>Barry: Barry::RecordParser&lt; RecordT, StorageT &gt; Class Template 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.2-20100208 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</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>
      <li><a href="dirs.html"><span>Directories</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"><a class="el" href="namespaceBarry.html">Barry</a>::<a class="el" href="classBarry_1_1RecordParser.html">RecordParser</a>
  </div>
</div>
<div class="contents">
<h1>Barry::RecordParser&lt; RecordT, StorageT &gt; Class Template Reference</h1><!-- doxytag: class="Barry::RecordParser" --><!-- doxytag: inherits="Barry::Parser" -->
<p>Template class for easy creation of specific parser objects.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="parser_8h_source.html">parser.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Barry::RecordParser&lt; RecordT, StorageT &gt;:</div>
<div class="dynsection">
<div class="center"><img src="classBarry_1_1RecordParser__inherit__graph.png" border="0" usemap="#Barry_1_1RecordParser_3_01RecordT_00_01StorageT_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="Barry_1_1RecordParser_3_01RecordT_00_01StorageT_01_4_inherit__map" id="Barry_1_1RecordParser_3_01RecordT_00_01StorageT_01_4_inherit__map">
<area shape="rect" id="node2" href="classBarry_1_1Parser.html" title="Base class for the parser hierarchy." alt="" coords="99,6,200,37"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for Barry::RecordParser&lt; RecordT, StorageT &gt;:</div>
<div class="dynsection">
<div class="center"><img src="classBarry_1_1RecordParser__coll__graph.png" border="0" usemap="#Barry_1_1RecordParser_3_01RecordT_00_01StorageT_01_4_coll__map" alt="Collaboration graph"/></div>
<map name="Barry_1_1RecordParser_3_01RecordT_00_01StorageT_01_4_coll__map" id="Barry_1_1RecordParser_3_01RecordT_00_01StorageT_01_4_coll__map">
<area shape="rect" id="node2" href="classBarry_1_1Parser.html" title="Base class for the parser hierarchy." alt="" coords="99,6,200,37"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classBarry_1_1RecordParser-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<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="classBarry_1_1RecordParser.html#aa52373dc3d72cea727838bae98d5f8af">RecordParser</a> (StorageT &amp;storage)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor that references an externally managed storage object.  <a href="#aa52373dc3d72cea727838bae98d5f8af"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1RecordParser.html#aff411ca33106a4d2e2a51dd776fc8263">RecordParser</a> (StorageT *storage)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor that references a locally managed storage object.  <a href="#aff411ca33106a4d2e2a51dd776fc8263"></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="classBarry_1_1RecordParser.html#ade7a031f4f771ebda4b0a7a20f0366ec">Clear</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reset and prepare for a new raw data packet.  <a href="#ade7a031f4f771ebda4b0a7a20f0366ec"></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="classBarry_1_1RecordParser.html#ad61af6f1a0290ab7827ecb594438b593">SetIds</a> (uint8_t RecType, uint32_t UniqueId)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stores the IDs.  <a href="#ad61af6f1a0290ab7827ecb594438b593"></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="classBarry_1_1RecordParser.html#acf87e45e72a2f9960c2b6b0dedf087bd">ParseHeader</a> (const <a class="el" href="classBarry_1_1Data.html">Data</a> &amp;data, size_t &amp;offset)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Called to parse the header portion of the raw data packet.  <a href="#acf87e45e72a2f9960c2b6b0dedf087bd"></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="classBarry_1_1RecordParser.html#aede0d6cc45821fddf0f18069e8a5b6ed">ParseFields</a> (const <a class="el" href="classBarry_1_1Data.html">Data</a> &amp;data, size_t &amp;offset, const <a class="el" href="classBarry_1_1IConverter.html">IConverter</a> *ic)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Called to parse sub fields in the raw data packet.  <a href="#aede0d6cc45821fddf0f18069e8a5b6ed"></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="classBarry_1_1RecordParser.html#a95d327d972468d7360e961f14dc67c70">Store</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Called at the very end of record parsing, and used to store the final packet somewhere, either in memory, disk, etc.  <a href="#a95d327d972468d7360e961f14dc67c70"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;class RecordT, class StorageT&gt;<br/>
 class Barry::RecordParser&lt; RecordT, StorageT &gt;</h3>

<p>Template class for easy creation of specific parser objects. </p>
<p>This template takes the following template arguments:</p>
<ul>
<li>RecordT: One of the record parser classes in <a class="el" href="record_8h.html" title="Blackberry database record classes.">record.h</a></li>
<li>StorageT: A custom storage functor class. An object of this type will be called as a function with parsed Record as an argument. This happens on the fly as the data is retrieved from the device over USB, so it should not block forever.</li>
</ul>
<p>Example LoadDatabase() call:</p>
<pre>
    struct StoreContact
    {
        std::vector&lt;Contact&gt; &amp;array;
        StoreContact(std::vector&lt;Contact&gt; &amp;a) : array(a) {}
        void operator() (const <a class="el" href="classBarry_1_1Contact.html" title="Represents a single record in the Address Book Blackberry database.">Contact</a> &amp;c)
        {
            array.push_back(c);
        }
    };</pre><pre>    <a class="el" href="classBarry_1_1Controller.html" title="The main interface class.">Controller</a> con(probeResult);
    con.OpenMode(Controller::Desktop);
    std::vector&lt;Contact&gt; contactList;
    StoreContact storage(contactList);
    RecordParser&lt;Contact, StoreContact&gt; parser(storage);
    con.LoadDatabase(con.GetDBID("Address Book"), parser);
    </pre> 
<p>Definition at line <a class="el" href="parser_8h_source.html#l00158">158</a> of file <a class="el" href="parser_8h_source.html">parser.h</a>.</p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa52373dc3d72cea727838bae98d5f8af"></a><!-- doxytag: member="Barry::RecordParser::RecordParser" ref="aa52373dc3d72cea727838bae98d5f8af" args="(StorageT &amp;storage)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RecordT, class StorageT&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classBarry_1_1RecordParser.html">Barry::RecordParser</a>&lt; RecordT, StorageT &gt;::<a class="el" href="classBarry_1_1RecordParser.html">RecordParser</a> </td>
          <td>(</td>
          <td class="paramtype">StorageT &amp;&nbsp;</td>
          <td class="paramname"> <em>storage</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructor that references an externally managed storage object. </p>

<p>Definition at line <a class="el" href="parser_8h_source.html#l00166">166</a> of file <a class="el" href="parser_8h_source.html">parser.h</a>.</p>

</div>
</div>
<a class="anchor" id="aff411ca33106a4d2e2a51dd776fc8263"></a><!-- doxytag: member="Barry::RecordParser::RecordParser" ref="aff411ca33106a4d2e2a51dd776fc8263" args="(StorageT *storage)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RecordT, class StorageT&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classBarry_1_1RecordParser.html">Barry::RecordParser</a>&lt; RecordT, StorageT &gt;::<a class="el" href="classBarry_1_1RecordParser.html">RecordParser</a> </td>
          <td>(</td>
          <td class="paramtype">StorageT *&nbsp;</td>
          <td class="paramname"> <em>storage</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructor that references a locally managed storage object. </p>
<p>The pointer passed in will be stored, and freed when this class is destroyed. It is safe to call this constructor with a 'new'ly created storage object. </p>

<p>Definition at line <a class="el" href="parser_8h_source.html#l00173">173</a> of file <a class="el" href="parser_8h_source.html">parser.h</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ade7a031f4f771ebda4b0a7a20f0366ec"></a><!-- doxytag: member="Barry::RecordParser::Clear" ref="ade7a031f4f771ebda4b0a7a20f0366ec" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RecordT, class StorageT&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="classBarry_1_1RecordParser.html">Barry::RecordParser</a>&lt; RecordT, StorageT &gt;::Clear </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reset and prepare for a new raw data packet. </p>

<p>Implements <a class="el" href="classBarry_1_1Parser.html#a15acb3544613d43d8f928cd63a19022b">Barry::Parser</a>.</p>

<p>Definition at line <a class="el" href="parser_8h_source.html#l00192">192</a> of file <a class="el" href="parser_8h_source.html">parser.h</a>.</p>

</div>
</div>
<a class="anchor" id="aede0d6cc45821fddf0f18069e8a5b6ed"></a><!-- doxytag: member="Barry::RecordParser::ParseFields" ref="aede0d6cc45821fddf0f18069e8a5b6ed" args="(const Data &amp;data, size_t &amp;offset, const IConverter *ic)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RecordT, class StorageT&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="classBarry_1_1RecordParser.html">Barry::RecordParser</a>&lt; RecordT, StorageT &gt;::ParseFields </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classBarry_1_1Data.html">Data</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t &amp;&nbsp;</td>
          <td class="paramname"> <em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classBarry_1_1IConverter.html">IConverter</a> *&nbsp;</td>
          <td class="paramname"> <em>ic</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called to parse sub fields in the raw data packet. </p>
<p>The same data is passed as was passed in ParseHeader, only the offset will be updated if it was advanced during the header parsing. </p>

<p>Implements <a class="el" href="classBarry_1_1Parser.html#a645718d87aaad3ee2c36664de05046d2">Barry::Parser</a>.</p>

<p>Definition at line <a class="el" href="parser_8h_source.html#l00207">207</a> of file <a class="el" href="parser_8h_source.html">parser.h</a>.</p>

</div>
</div>
<a class="anchor" id="acf87e45e72a2f9960c2b6b0dedf087bd"></a><!-- doxytag: member="Barry::RecordParser::ParseHeader" ref="acf87e45e72a2f9960c2b6b0dedf087bd" args="(const Data &amp;data, size_t &amp;offset)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RecordT, class StorageT&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="classBarry_1_1RecordParser.html">Barry::RecordParser</a>&lt; RecordT, StorageT &gt;::ParseHeader </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classBarry_1_1Data.html">Data</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t &amp;&nbsp;</td>
          <td class="paramname"> <em>offset</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called to parse the header portion of the raw data packet. </p>
<p>data contains the entire packet, and offset contains the location at which to start parsing. </p>

<p>Implements <a class="el" href="classBarry_1_1Parser.html#a2087d07fb5d8d57c934c4e60278f41d8">Barry::Parser</a>.</p>

<p>Definition at line <a class="el" href="parser_8h_source.html#l00202">202</a> of file <a class="el" href="parser_8h_source.html">parser.h</a>.</p>

</div>
</div>
<a class="anchor" id="ad61af6f1a0290ab7827ecb594438b593"></a><!-- doxytag: member="Barry::RecordParser::SetIds" ref="ad61af6f1a0290ab7827ecb594438b593" args="(uint8_t RecType, uint32_t UniqueId)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RecordT, class StorageT&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="classBarry_1_1RecordParser.html">Barry::RecordParser</a>&lt; RecordT, StorageT &gt;::SetIds </td>
          <td>(</td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>RecType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&nbsp;</td>
          <td class="paramname"> <em>UniqueId</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Stores the IDs. </p>

<p>Implements <a class="el" href="classBarry_1_1Parser.html#a95bfc4014e3e8ded94625f43d1d29800">Barry::Parser</a>.</p>

<p>Definition at line <a class="el" href="parser_8h_source.html#l00197">197</a> of file <a class="el" href="parser_8h_source.html">parser.h</a>.</p>

</div>
</div>
<a class="anchor" id="a95d327d972468d7360e961f14dc67c70"></a><!-- doxytag: member="Barry::RecordParser::Store" ref="a95d327d972468d7360e961f14dc67c70" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RecordT, class StorageT&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="classBarry_1_1RecordParser.html">Barry::RecordParser</a>&lt; RecordT, StorageT &gt;::<a class="el" href="structStore.html">Store</a> </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called at the very end of record parsing, and used to store the final packet somewhere, either in memory, disk, etc. </p>

<p>Implements <a class="el" href="classBarry_1_1Parser.html#abf8ab1598be74268ee486af938c527d4">Barry::Parser</a>.</p>

<p>Definition at line <a class="el" href="parser_8h_source.html#l00213">213</a> of file <a class="el" href="parser_8h_source.html">parser.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="parser_8h_source.html">parser.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address>
</body>
</html>