Sophie

Sophie

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

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::SocketRoutingQueue 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.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_1SocketRoutingQueue.html">SocketRoutingQueue</a>
  </div>
</div>
<div class="contents">
<h1>Barry::SocketRoutingQueue Class Reference</h1><!-- doxytag: class="Barry::SocketRoutingQueue" --><div class="dynheader">
Collaboration diagram for Barry::SocketRoutingQueue:</div>
<div class="dynsection">
<div class="center"><img src="classBarry_1_1SocketRoutingQueue__coll__graph.png" border="0" usemap="#Barry_1_1SocketRoutingQueue_coll__map" alt="Collaboration graph"/></div>
<map name="Barry_1_1SocketRoutingQueue_coll__map" id="Barry_1_1SocketRoutingQueue_coll__map">
<area shape="rect" id="node2" href="classUsb_1_1Device.html" title="Usb::Device" alt="" coords="5,203,101,234"/><area shape="rect" id="node6" href="classBarry_1_1DataQueue.html" title="This class provides a thread aware fifo queue for Data objects, providing memory..." alt="" coords="392,203,523,234"/><area shape="rect" id="node10" href="classBarry_1_1Data.html" title="Barry::Data" alt="" coords="412,6,503,37"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classBarry_1_1SocketRoutingQueue-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structBarry_1_1SocketRoutingQueue_1_1QueueEntry.html">QueueEntry</a></td></tr>
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1SocketRoutingQueue.html#a6b4f7e9653512bb6ad91d05894248517">AllocateBuffers</a> (int count)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This class starts out with no buffers, and will grow one buffer at a time if needed.  <a href="#a6b4f7e9653512bb6ad91d05894248517"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1SocketRoutingQueue.html#adc15a0034c1dac424cf8a5dc32f12595">DefaultRead</a> (<a class="el" href="classBarry_1_1Data.html">Data</a> &amp;receive, int timeout=-1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the data for the next unregistered socket.  <a href="#adc15a0034c1dac424cf8a5dc32f12595"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classBarry_1_1DataHandle.html">DataHandle</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1SocketRoutingQueue.html#ae9fac0a9073c44567987230843712e94">DefaultRead</a> (int timeout=-1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This version does not perform a copy.  <a href="#ae9fac0a9073c44567987230843712e94"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1SocketRoutingQueue.html#a5ef298211c09178f25bd043eca283ccb">RegisterInterest</a> (SocketId socket, SocketDataHandler handler=0, void *context=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Register an interest in data from a certain socket.  <a href="#a5ef298211c09178f25bd043eca283ccb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1SocketRoutingQueue.html#aaa0f088f013150bc45ca47fabede9731">UnregisterInterest</a> (SocketId socket)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unregisters interest in data from the given socket, and discards any existing data in its interest queue.  <a href="#aaa0f088f013150bc45ca47fabede9731"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1SocketRoutingQueue.html#a58298b4598a0166720b745198cb99fe6">SocketRead</a> (SocketId socket, <a class="el" href="classBarry_1_1Data.html">Data</a> &amp;receive, int timeout=-1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reads data from the interested socket cache.  <a href="#a58298b4598a0166720b745198cb99fe6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classBarry_1_1DataHandle.html">DataHandle</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1SocketRoutingQueue.html#acbe8506c04cb6ff9942766a3ba39cbd4">SocketRead</a> (SocketId socket, int timeout=-1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Copying is not performed with this function.  <a href="#acbe8506c04cb6ff9942766a3ba39cbd4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1SocketRoutingQueue.html#aa66c053840c931e3c6f1ed2293bd3736">DoRead</a> (std::string &amp;msg, int timeout=-1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Called by the application's "read thread" to read the next usb packet and route it to the correct queue.  <a href="#aa66c053840c931e3c6f1ed2293bd3736"></a><br/></td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1SocketRoutingQueue.html#aa496dddb546fc96f337cf885dfdf219c">ReturnBuffer</a> (<a class="el" href="classBarry_1_1Data.html">Data</a> *buf)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Provides a method of returning a buffer to the free queue after processing.  <a href="#aa496dddb546fc96f337cf885dfdf219c"></a><br/></td></tr>
<tr><td colspan="2"><h2>Static Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBarry_1_1SocketRoutingQueue.html#a43c1fc957e2da415290e86bc6e66aa25">SimpleReadThread</a> (void *userptr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convenience thread to handle USB read activity.  <a href="#a43c1fc957e2da415290e86bc6e66aa25"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>

<p>Definition at line <a class="el" href="router_8h_source.html#l00039">39</a> of file <a class="el" href="router_8h_source.html">router.h</a>.</p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a6b4f7e9653512bb6ad91d05894248517"></a><!-- doxytag: member="Barry::SocketRoutingQueue::AllocateBuffers" ref="a6b4f7e9653512bb6ad91d05894248517" args="(int count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Barry::SocketRoutingQueue::AllocateBuffers </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>count</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This class starts out with no buffers, and will grow one buffer at a time if needed. </p>
<p>Call this to allocate count buffers all at once and place them on the free queue. After calling this function, at least count buffers will exist in the free queue. If there are already count buffers, none will be added. </p>

<p>Definition at line <a class="el" href="router_8cc_source.html#l00136">136</a> of file <a class="el" href="router_8cc_source.html">router.cc</a>.</p>

<p>References <a class="el" href="dataqueue_8cc_source.html#l00058">Barry::DataQueue::push()</a>, and <a class="el" href="dataqueue_8cc_source.html#l00205">Barry::DataQueue::size()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="classBarry_1_1SocketRoutingQueue_a6b4f7e9653512bb6ad91d05894248517_cgraph.png" border="0" usemap="#classBarry_1_1SocketRoutingQueue_a6b4f7e9653512bb6ad91d05894248517_cgraph_map" alt=""></div>
<map name="classBarry_1_1SocketRoutingQueue_a6b4f7e9653512bb6ad91d05894248517_cgraph_map" id="classBarry_1_1SocketRoutingQueue_a6b4f7e9653512bb6ad91d05894248517_cgraph">
<area shape="rect" id="node3" href="classBarry_1_1DataQueue.html#aea470a11cbda20dd9af1a92148ecb223" title="Pushes data into the end of the queue." alt="" coords="343,5,508,35"/><area shape="rect" id="node5" href="classBarry_1_1DataQueue.html#ada0c2fd55a8f221aadbf0b7165043e06" title="Returns number of items in the queue." alt="" coords="344,58,507,89"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ae9fac0a9073c44567987230843712e94"></a><!-- doxytag: member="Barry::SocketRoutingQueue::DefaultRead" ref="ae9fac0a9073c44567987230843712e94" args="(int timeout=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classBarry_1_1DataHandle.html">DataHandle</a> Barry::SocketRoutingQueue::DefaultRead </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>timeout</em> = <code>-1</code></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This version does not perform a copy. </p>

<p>Definition at line <a class="el" href="router_8cc_source.html#l00171">171</a> of file <a class="el" href="router_8cc_source.html">router.cc</a>.</p>

<p>References <a class="el" href="dataqueue_8cc_source.html#l00107">Barry::DataQueue::wait_pop()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="classBarry_1_1SocketRoutingQueue_ae9fac0a9073c44567987230843712e94_cgraph.png" border="0" usemap="#classBarry_1_1SocketRoutingQueue_ae9fac0a9073c44567987230843712e94_cgraph_map" alt=""></div>
<map name="classBarry_1_1SocketRoutingQueue_ae9fac0a9073c44567987230843712e94_cgraph_map" id="classBarry_1_1SocketRoutingQueue_ae9fac0a9073c44567987230843712e94_cgraph">
<area shape="rect" id="node3" href="classBarry_1_1DataQueue.html#a27d4830d37b0f7a1bee3a63b0f5a5b2b" title="Pops the next element off the front of the queue, and waits until one exists if empty..." alt="" coords="325,31,517,62"/><area shape="rect" id="node5" href="classBarry_1_1DataQueue.html#ada0c2fd55a8f221aadbf0b7165043e06" title="Returns number of items in the queue." alt="" coords="567,5,729,35"/><area shape="rect" id="node7" href="namespaceBarry.html#a0e1dc80f82d25739631c39b545f812bb" title="Creates a pthread_cond_timedwait() compatible timespec struct, based on a given timeout..." alt="" coords="569,58,727,89"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="adc15a0034c1dac424cf8a5dc32f12595"></a><!-- doxytag: member="Barry::SocketRoutingQueue::DefaultRead" ref="adc15a0034c1dac424cf8a5dc32f12595" args="(Data &amp;receive, int timeout=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Barry::SocketRoutingQueue::DefaultRead </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classBarry_1_1Data.html">Data</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>receive</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>timeout</em> = <code>-1</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the data for the next unregistered socket. </p>
<p>Blocks until timeout or data is available. Returns false (or null pointer) on timeout and no data. With the return version of the function, there is no copying performed.</p>
<p>This version performs a copy. </p>

<p>Definition at line <a class="el" href="router_8cc_source.html#l00157">157</a> of file <a class="el" href="router_8cc_source.html">router.cc</a>.</p>

</div>
</div>
<a class="anchor" id="aa66c053840c931e3c6f1ed2293bd3736"></a><!-- doxytag: member="Barry::SocketRoutingQueue::DoRead" ref="aa66c053840c931e3c6f1ed2293bd3736" args="(std::string &amp;msg, int timeout=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Barry::SocketRoutingQueue::DoRead </td>
          <td>(</td>
          <td class="paramtype">std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>timeout</em> = <code>-1</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called by the application's "read thread" to read the next usb packet and route it to the correct queue. </p>
<p>Returns after every read, even if a handler is associated with a queue. Note: this function is safe to call before SetUsbDevice() is called... it just doesn't do anything if there is no usb device to work with.</p>
<p>Timeout is in milliseconds.</p>
<p>Returns false in the case of USB errors and puts the error message in msg. </p>

<p>Definition at line <a class="el" href="router_8cc_source.html#l00336">336</a> of file <a class="el" href="router_8cc_source.html">router.cc</a>.</p>

<p>References <a class="el" href="dataqueue_8cc_source.html#l00085">Barry::DataQueue::pop()</a>, and <a class="el" href="dataqueue_8cc_source.html#l00058">Barry::DataQueue::push()</a>.</p>

<p>Referenced by <a class="el" href="router_8cc_source.html#l00080">SimpleReadThread()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="classBarry_1_1SocketRoutingQueue_aa66c053840c931e3c6f1ed2293bd3736_cgraph.png" border="0" usemap="#classBarry_1_1SocketRoutingQueue_aa66c053840c931e3c6f1ed2293bd3736_cgraph_map" alt=""></div>
<map name="classBarry_1_1SocketRoutingQueue_aa66c053840c931e3c6f1ed2293bd3736_cgraph_map" id="classBarry_1_1SocketRoutingQueue_aa66c053840c931e3c6f1ed2293bd3736_cgraph">
<area shape="rect" id="node3" href="classBarry_1_1DataQueue.html#ad1f454f70a9b6ec667e0e22a7ddd6eca" title="Pops the next element off the front of the queue." alt="" coords="305,5,465,35"/><area shape="rect" id="node5" href="classBarry_1_1DataQueue.html#aea470a11cbda20dd9af1a92148ecb223" title="Pushes data into the end of the queue." alt="" coords="303,58,468,89"/></map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="classBarry_1_1SocketRoutingQueue_aa66c053840c931e3c6f1ed2293bd3736_icgraph.png" border="0" usemap="#classBarry_1_1SocketRoutingQueue_aa66c053840c931e3c6f1ed2293bd3736_icgraph_map" alt=""></div>
<map name="classBarry_1_1SocketRoutingQueue_aa66c053840c931e3c6f1ed2293bd3736_icgraph_map" id="classBarry_1_1SocketRoutingQueue_aa66c053840c931e3c6f1ed2293bd3736_icgraph">
<area shape="rect" id="node3" href="classBarry_1_1SocketRoutingQueue.html#a43c1fc957e2da415290e86bc6e66aa25" title="Convenience thread to handle USB read activity." alt="" coords="303,5,617,35"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a5ef298211c09178f25bd043eca283ccb"></a><!-- doxytag: member="Barry::SocketRoutingQueue::RegisterInterest" ref="a5ef298211c09178f25bd043eca283ccb" args="(SocketId socket, SocketDataHandler handler=0, void *context=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Barry::SocketRoutingQueue::RegisterInterest </td>
          <td>(</td>
          <td class="paramtype">SocketId&nbsp;</td>
          <td class="paramname"> <em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">SocketDataHandler&nbsp;</td>
          <td class="paramname"> <em>handler</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>context</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Register an interest in data from a certain socket. </p>
<p>To read from that socket, use the <a class="el" href="classBarry_1_1SocketRoutingQueue.html#a58298b4598a0166720b745198cb99fe6" title="Reads data from the interested socket cache.">SocketRead()</a> function from then on.</p>
<p>Any non-registered socket goes in the default queue and must be read by <a class="el" href="classBarry_1_1SocketRoutingQueue.html#adc15a0034c1dac424cf8a5dc32f12595" title="Returns the data for the next unregistered socket.">DefaultRead()</a></p>
<p>If not null, handler is called when new data is read. It will be called in the same thread instance that <a class="el" href="classBarry_1_1SocketRoutingQueue.html#aa66c053840c931e3c6f1ed2293bd3736" title="Called by the application&#39;s &quot;read thread&quot; to read the next usb packet...">DoRead()</a> is called from. Handler is passed the <a class="el" href="classBarry_1_1DataQueue.html" title="This class provides a thread aware fifo queue for Data objects, providing memory...">DataQueue</a> <a class="el" href="classBarry_1_1Data.html">Data</a> pointer, and so no copying is done. Once the handler returns, the data is considered processed and not added to the interested queue, but instead returned to m_free.</p>
<p>Throws std::logic_error if already registered. </p>

<p>Definition at line <a class="el" href="router_8cc_source.html#l00196">196</a> of file <a class="el" href="router_8cc_source.html">router.cc</a>.</p>

</div>
</div>
<a class="anchor" id="aa496dddb546fc96f337cf885dfdf219c"></a><!-- doxytag: member="Barry::SocketRoutingQueue::ReturnBuffer" ref="aa496dddb546fc96f337cf885dfdf219c" args="(Data *buf)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Barry::SocketRoutingQueue::ReturnBuffer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classBarry_1_1Data.html">Data</a> *&nbsp;</td>
          <td class="paramname"> <em>buf</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Provides a method of returning a buffer to the free queue after processing. </p>
<p>The <a class="el" href="classBarry_1_1DataHandle.html" title="std::auto_ptr like class that handles pointers to Data, but instead of freeing them...">DataHandle</a> class calls this automatically from its destructor. </p>

<p>Definition at line <a class="el" href="router_8cc_source.html#l00069">69</a> of file <a class="el" href="router_8cc_source.html">router.cc</a>.</p>

<p>References <a class="el" href="dataqueue_8cc_source.html#l00058">Barry::DataQueue::push()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="classBarry_1_1SocketRoutingQueue_aa496dddb546fc96f337cf885dfdf219c_cgraph.png" border="0" usemap="#classBarry_1_1SocketRoutingQueue_aa496dddb546fc96f337cf885dfdf219c_cgraph_map" alt=""></div>
<map name="classBarry_1_1SocketRoutingQueue_aa496dddb546fc96f337cf885dfdf219c_cgraph_map" id="classBarry_1_1SocketRoutingQueue_aa496dddb546fc96f337cf885dfdf219c_cgraph">
<area shape="rect" id="node3" href="classBarry_1_1DataQueue.html#aea470a11cbda20dd9af1a92148ecb223" title="Pushes data into the end of the queue." alt="" coords="324,5,489,35"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a43c1fc957e2da415290e86bc6e66aa25"></a><!-- doxytag: member="Barry::SocketRoutingQueue::SimpleReadThread" ref="a43c1fc957e2da415290e86bc6e66aa25" args="(void *userptr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * Barry::SocketRoutingQueue::SimpleReadThread </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>userptr</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Convenience thread to handle USB read activity. </p>

<p>Definition at line <a class="el" href="router_8cc_source.html#l00080">80</a> of file <a class="el" href="router_8cc_source.html">router.cc</a>.</p>

<p>References <a class="el" href="router_8cc_source.html#l00336">DoRead()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="classBarry_1_1SocketRoutingQueue_a43c1fc957e2da415290e86bc6e66aa25_cgraph.png" border="0" usemap="#classBarry_1_1SocketRoutingQueue_a43c1fc957e2da415290e86bc6e66aa25_cgraph_map" alt=""></div>
<map name="classBarry_1_1SocketRoutingQueue_a43c1fc957e2da415290e86bc6e66aa25_cgraph_map" id="classBarry_1_1SocketRoutingQueue_a43c1fc957e2da415290e86bc6e66aa25_cgraph">
<area shape="rect" id="node3" href="classBarry_1_1SocketRoutingQueue.html#aa66c053840c931e3c6f1ed2293bd3736" title="Called by the application&#39;s &quot;read thread&quot; to read the next usb packet..." alt="" coords="371,31,619,62"/><area shape="rect" id="node5" href="classBarry_1_1DataQueue.html#ad1f454f70a9b6ec667e0e22a7ddd6eca" title="Pops the next element off the front of the queue." alt="" coords="671,5,831,35"/><area shape="rect" id="node7" href="classBarry_1_1DataQueue.html#aea470a11cbda20dd9af1a92148ecb223" title="Pushes data into the end of the queue." alt="" coords="668,58,833,89"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="acbe8506c04cb6ff9942766a3ba39cbd4"></a><!-- doxytag: member="Barry::SocketRoutingQueue::SocketRead" ref="acbe8506c04cb6ff9942766a3ba39cbd4" args="(SocketId socket, int timeout=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classBarry_1_1DataHandle.html">DataHandle</a> Barry::SocketRoutingQueue::SocketRead </td>
          <td>(</td>
          <td class="paramtype">SocketId&nbsp;</td>
          <td class="paramname"> <em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>timeout</em> = <code>-1</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Copying is not performed with this function. </p>
<p>Throws std::logic_error if a socket was requested that was not previously registered. </p>

<p>Definition at line <a class="el" href="router_8cc_source.html#l00271">271</a> of file <a class="el" href="router_8cc_source.html">router.cc</a>.</p>

<p>References <a class="el" href="dataqueue_8cc_source.html#l00107">Barry::DataQueue::wait_pop()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="classBarry_1_1SocketRoutingQueue_acbe8506c04cb6ff9942766a3ba39cbd4_cgraph.png" border="0" usemap="#classBarry_1_1SocketRoutingQueue_acbe8506c04cb6ff9942766a3ba39cbd4_cgraph_map" alt=""></div>
<map name="classBarry_1_1SocketRoutingQueue_acbe8506c04cb6ff9942766a3ba39cbd4_cgraph_map" id="classBarry_1_1SocketRoutingQueue_acbe8506c04cb6ff9942766a3ba39cbd4_cgraph">
<area shape="rect" id="node3" href="classBarry_1_1DataQueue.html#a27d4830d37b0f7a1bee3a63b0f5a5b2b" title="Pops the next element off the front of the queue, and waits until one exists if empty..." alt="" coords="325,31,517,62"/><area shape="rect" id="node5" href="classBarry_1_1DataQueue.html#ada0c2fd55a8f221aadbf0b7165043e06" title="Returns number of items in the queue." alt="" coords="567,5,729,35"/><area shape="rect" id="node7" href="namespaceBarry.html#a0e1dc80f82d25739631c39b545f812bb" title="Creates a pthread_cond_timedwait() compatible timespec struct, based on a given timeout..." alt="" coords="569,58,727,89"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a58298b4598a0166720b745198cb99fe6"></a><!-- doxytag: member="Barry::SocketRoutingQueue::SocketRead" ref="a58298b4598a0166720b745198cb99fe6" args="(SocketId socket, Data &amp;receive, int timeout=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Barry::SocketRoutingQueue::SocketRead </td>
          <td>(</td>
          <td class="paramtype">SocketId&nbsp;</td>
          <td class="paramname"> <em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classBarry_1_1Data.html">Data</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>receive</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>timeout</em> = <code>-1</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reads data from the interested socket cache. </p>
<p>Can only read from sockets that have been previously registered.</p>
<p>Blocks until timeout or data is available.</p>
<p>Returns false (or null pointer) on timeout and no data. With the return version of the function, there is no copying performed.</p>
<p>Throws std::logic_error if a socket was requested that was not previously registered.</p>
<p>Copying is performed with this function. </p>

<p>Definition at line <a class="el" href="router_8cc_source.html#l00254">254</a> of file <a class="el" href="router_8cc_source.html">router.cc</a>.</p>

</div>
</div>
<a class="anchor" id="aaa0f088f013150bc45ca47fabede9731"></a><!-- doxytag: member="Barry::SocketRoutingQueue::UnregisterInterest" ref="aaa0f088f013150bc45ca47fabede9731" args="(SocketId socket)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Barry::SocketRoutingQueue::UnregisterInterest </td>
          <td>(</td>
          <td class="paramtype">SocketId&nbsp;</td>
          <td class="paramname"> <em>socket</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Unregisters interest in data from the given socket, and discards any existing data in its interest queue. </p>
<p>Any new incoming data for this socket will be placed in the default queue. </p>

<p>Definition at line <a class="el" href="router_8cc_source.html#l00218">218</a> of file <a class="el" href="router_8cc_source.html">router.cc</a>.</p>

<p>References <a class="el" href="dataqueue_8cc_source.html#l00175">Barry::DataQueue::append_from()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="classBarry_1_1SocketRoutingQueue_aaa0f088f013150bc45ca47fabede9731_cgraph.png" border="0" usemap="#classBarry_1_1SocketRoutingQueue_aaa0f088f013150bc45ca47fabede9731_cgraph_map" alt=""></div>
<map name="classBarry_1_1SocketRoutingQueue_aaa0f088f013150bc45ca47fabede9731_cgraph_map" id="classBarry_1_1SocketRoutingQueue_aaa0f088f013150bc45ca47fabede9731_cgraph">
<area shape="rect" id="node3" href="classBarry_1_1DataQueue.html#a12a7a82124799a6803b28efd89e1dd05" title="Pops all data from other and appends it to this." alt="" coords="356,5,572,35"/></map>
</div>
</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="router_8h_source.html">router.h</a></li>
<li><a class="el" href="router_8cc_source.html">router.cc</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>