<!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>GNU Radio 3.2.2 C++ API: gr_buffer.h File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">GNU Radio 3.2.2 C++ API</div> </td> </tr> </tbody> </table> </div> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('gr__buffer_8h.html',''); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> | <a href="#func-members">Functions</a> </div> <div class="headertitle"> <h1>gr_buffer.h File Reference</h1> </div> </div> <div class="contents"> <div class="textblock"><code>#include <<a class="el" href="gr__runtime__types_8h_source.html">gr_runtime_types.h</a>></code><br/> <code>#include <boost/weak_ptr.hpp></code><br/> <code>#include <boost/thread.hpp></code><br/> </div><div class="textblock"><div class="dynheader"> Include dependency graph for gr_buffer.h:</div> <div class="dyncontent"> <div class="center"><img src="gr__buffer_8h__incl.png" border="0" usemap="#gr__buffer_8h" alt=""/></div> <map name="gr__buffer_8h" id="gr__buffer_8h"> <area shape="rect" id="node3" href="gr__runtime__types_8h.html" title="gr_runtime_types.h" alt="" coords="180,83,313,112"/><area shape="rect" id="node5" href="gr__types_8h.html" title="gr_types.h" alt="" coords="205,160,288,189"/><area shape="rect" id="node13" href="gr__complex_8h.html" title="gr_complex.h" alt="" coords="349,237,448,267"/></map> </div> </div> <p><a href="gr__buffer_8h_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="nested-classes"></a> Classes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__buffer.html">gr_buffer</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Single writer, multiple reader fifo. <a href="classgr__buffer.html#_details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__buffer__reader.html">gr_buffer_reader</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">How we keep track of the readers of a <a class="el" href="classgr__buffer.html" title="Single writer, multiple reader fifo.">gr_buffer</a>. <a href="classgr__buffer__reader.html#_details">More...</a><br/></td></tr> <tr><td colspan="2"><h2><a name="func-members"></a> Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classboost_1_1shared__ptr.html">gr_buffer_sptr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="gr__buffer_8h.html#aebc8f592465e520011dc5eb872b1a5e7">gr_make_buffer</a> (int nitems, size_t sizeof_item, <a class="el" href="classboost_1_1shared__ptr.html">gr_block_sptr</a> link=<a class="el" href="classboost_1_1shared__ptr.html">gr_block_sptr</a>())</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Allocate a buffer that holds at least <code>nitems</code> of size <code>sizeof_item</code>. <a href="#aebc8f592465e520011dc5eb872b1a5e7"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classboost_1_1shared__ptr.html">gr_buffer_reader_sptr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="gr__buffer_8h.html#aa5e3f8c5b81a3b5395efb545e5b56613">gr_buffer_add_reader</a> (<a class="el" href="classboost_1_1shared__ptr.html">gr_buffer_sptr</a> buf, int nzero_preload, <a class="el" href="classboost_1_1shared__ptr.html">gr_block_sptr</a> link=<a class="el" href="classboost_1_1shared__ptr.html">gr_block_sptr</a>())</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new <a class="el" href="classgr__buffer__reader.html" title="How we keep track of the readers of a gr_buffer.">gr_buffer_reader</a> and attach it to buffer <code>buf</code>. <a href="#aa5e3f8c5b81a3b5395efb545e5b56613"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="gr__buffer_8h.html#aa863a94ed8f87b2603df59e7b0eeed37">gr_buffer_ncurrently_allocated</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">returns # of gr_buffers currently allocated <a href="#aa863a94ed8f87b2603df59e7b0eeed37"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="gr__buffer_8h.html#a229e8245902aa53c7fe9644c2fc6f3a9">gr_buffer_reader_ncurrently_allocated</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">returns # of gr_buffer_readers currently allocated <a href="#a229e8245902aa53c7fe9644c2fc6f3a9"></a><br/></td></tr> </table> <hr/><h2>Function Documentation</h2> <a class="anchor" id="aa5e3f8c5b81a3b5395efb545e5b56613"></a><!-- doxytag: member="gr_buffer.h::gr_buffer_add_reader" ref="aa5e3f8c5b81a3b5395efb545e5b56613" args="(gr_buffer_sptr buf, int nzero_preload, gr_block_sptr link=gr_block_sptr())" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classboost_1_1shared__ptr.html">gr_buffer_reader_sptr</a> gr_buffer_add_reader </td> <td>(</td> <td class="paramtype"><a class="el" href="classboost_1_1shared__ptr.html">gr_buffer_sptr</a> </td> <td class="paramname"><em>buf</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>nzero_preload</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classboost_1_1shared__ptr.html">gr_block_sptr</a> </td> <td class="paramname"><em>link</em> = <code><a class="el" href="classboost_1_1shared__ptr.html">gr_block_sptr</a>()</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Create a new <a class="el" href="classgr__buffer__reader.html" title="How we keep track of the readers of a gr_buffer.">gr_buffer_reader</a> and attach it to buffer <code>buf</code>. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">buf</td><td>is the buffer the <code><a class="el" href="classgr__buffer__reader.html" title="How we keep track of the readers of a gr_buffer.">gr_buffer_reader</a></code> reads from. </td></tr> <tr><td class="paramname">nzero_preload</td><td>-- number of zero items to "preload" into buffer. </td></tr> <tr><td class="paramname">link</td><td>is the block that reads from the buffer using this <a class="el" href="classgr__buffer__reader.html" title="How we keep track of the readers of a gr_buffer.">gr_buffer_reader</a>. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="aa863a94ed8f87b2603df59e7b0eeed37"></a><!-- doxytag: member="gr_buffer.h::gr_buffer_ncurrently_allocated" ref="aa863a94ed8f87b2603df59e7b0eeed37" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">long gr_buffer_ncurrently_allocated </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>returns # of gr_buffers currently allocated </p> </div> </div> <a class="anchor" id="a229e8245902aa53c7fe9644c2fc6f3a9"></a><!-- doxytag: member="gr_buffer.h::gr_buffer_reader_ncurrently_allocated" ref="a229e8245902aa53c7fe9644c2fc6f3a9" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">long gr_buffer_reader_ncurrently_allocated </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>returns # of gr_buffer_readers currently allocated </p> </div> </div> <a class="anchor" id="aebc8f592465e520011dc5eb872b1a5e7"></a><!-- doxytag: member="gr_buffer.h::gr_make_buffer" ref="aebc8f592465e520011dc5eb872b1a5e7" args="(int nitems, size_t sizeof_item, gr_block_sptr link=gr_block_sptr())" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classboost_1_1shared__ptr.html">gr_buffer_sptr</a> gr_make_buffer </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>nitems</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>sizeof_item</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classboost_1_1shared__ptr.html">gr_block_sptr</a> </td> <td class="paramname"><em>link</em> = <code><a class="el" href="classboost_1_1shared__ptr.html">gr_block_sptr</a>()</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Allocate a buffer that holds at least <code>nitems</code> of size <code>sizeof_item</code>. </p> <p>The total size of the buffer will be rounded up to a system dependent boundary. This is typically the system page size, but under MS windows is 64KB.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">nitems</td><td>is the minimum number of items the buffer will hold. </td></tr> <tr><td class="paramname">sizeof_item</td><td>is the size of an item in bytes. </td></tr> <tr><td class="paramname">link</td><td>is the block that writes to this buffer. </td></tr> </table> </dd> </dl> </div> </div> </div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="gr__buffer_8h.html">gr_buffer.h</a> </li> <li class="footer">Generated on Thu Feb 17 2011 for GNU Radio 3.2.2 C++ API by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li> </ul> </div> </body> </html>