<!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_stream_mux Class 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('classgr__stream__mux.html',''); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pro-methods">Protected Member Functions</a> | <a href="#friends">Friends</a> </div> <div class="headertitle"> <h1>gr_stream_mux Class Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="gr_stream_mux" --><!-- doxytag: inherits="gr_block" --> <p>Stream muxing block to multiplex many streams into one with a specified format. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="gr__stream__mux_8h_source.html">gr_stream_mux.h</a>></code></p> <div class="dynheader"> Inheritance diagram for gr_stream_mux:</div> <div class="dyncontent"> <div class="center"><img src="classgr__stream__mux__inherit__graph.png" border="0" usemap="#gr__stream__mux_inherit__map" alt="Inheritance graph"/></div> <map name="gr__stream__mux_inherit__map" id="gr__stream__mux_inherit__map"> <area shape="rect" id="node2" href="classgr__block.html" title="The abstract base class for all 'terminal' processing blocks.A signal processing flow is cons..." alt="" coords="27,83,96,112"/><area shape="rect" id="node4" href="classgr__basic__block.html" title="The abstract base class for all signal processing blocks.Basic blocks are the bare abstraction of an ..." alt="" coords="7,5,116,35"/></map> <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classgr__stream__mux-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__stream__mux.html#aba16e9bd3c58f75ec0e0ac3954ad6adc">~gr_stream_mux</a> (void)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__stream__mux.html#aae4b1c50e42e75a5c5a9d6f9e185ff84">forecast</a> (int noutput_items, <a class="el" href="classstd_1_1vector.html">gr_vector_int</a> &ninput_items_required)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Estimate input requirements given output request. <a href="#aae4b1c50e42e75a5c5a9d6f9e185ff84"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__stream__mux.html#a9505b30dc6957ad60dc27711573e6835">general_work</a> (int noutput_items, <a class="el" href="classstd_1_1vector.html">gr_vector_int</a> &ninput_items, <a class="el" href="classstd_1_1vector.html">gr_vector_const_void_star</a> &input_items, <a class="el" href="classstd_1_1vector.html">gr_vector_void_star</a> &output_items)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">compute output items from input items <a href="#a9505b30dc6957ad60dc27711573e6835"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__stream__mux.html#aa7c183af68557c9fcadd42a4fc0fac9f">gr_stream_mux</a> (size_t itemsize, const <a class="el" href="classstd_1_1vector.html">std::vector</a>< int > &lengths)</td></tr> <tr><td colspan="2"><h2><a name="friends"></a> Friends</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classboost_1_1shared__ptr.html">gr_stream_mux_sptr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__stream__mux.html#a6f3ee7564cc6b2ec763cc9ffffa839a8">gr_make_stream_mux</a> (size_t itemsize, const <a class="el" href="classstd_1_1vector.html">std::vector</a>< int > &lengths)</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Stream muxing block to multiplex many streams into one with a specified format. </p> <p>Muxes N streams together producing an output stream that contains N0 items from the first stream, N1 items from the second, etc. and repeats:</p> <p>[N0, N1, N2, ..., Nm, N0, N1, ...] </p> </div><hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="aa7c183af68557c9fcadd42a4fc0fac9f"></a><!-- doxytag: member="gr_stream_mux::gr_stream_mux" ref="aa7c183af68557c9fcadd42a4fc0fac9f" args="(size_t itemsize, const std::vector< int > &lengths)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">gr_stream_mux::gr_stream_mux </td> <td>(</td> <td class="paramtype">size_t </td> <td class="paramname"><em>itemsize</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classstd_1_1vector.html">std::vector</a>< int > & </td> <td class="paramname"><em>lengths</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <a class="anchor" id="aba16e9bd3c58f75ec0e0ac3954ad6adc"></a><!-- doxytag: member="gr_stream_mux::~gr_stream_mux" ref="aba16e9bd3c58f75ec0e0ac3954ad6adc" args="(void)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">gr_stream_mux::~gr_stream_mux </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="aae4b1c50e42e75a5c5a9d6f9e185ff84"></a><!-- doxytag: member="gr_stream_mux::forecast" ref="aae4b1c50e42e75a5c5a9d6f9e185ff84" args="(int noutput_items, gr_vector_int &ninput_items_required)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void gr_stream_mux::forecast </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>noutput_items</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classstd_1_1vector.html">gr_vector_int</a> & </td> <td class="paramname"><em>ninput_items_required</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Estimate input requirements given output request. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">noutput_items</td><td>number of output items to produce </td></tr> <tr><td class="paramname">ninput_items_required</td><td>number of input items required on each input stream</td></tr> </table> </dd> </dl> <p>Given a request to product <code>noutput_items</code>, estimate the number of data items required on each input stream. The estimate doesn't have to be exact, but should be close. </p> <p>Reimplemented from <a class="el" href="classgr__block.html#aa1f2518b5c97126bb015adb9e2027f4a">gr_block</a>.</p> </div> </div> <a class="anchor" id="a9505b30dc6957ad60dc27711573e6835"></a><!-- doxytag: member="gr_stream_mux::general_work" ref="a9505b30dc6957ad60dc27711573e6835" args="(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int gr_stream_mux::general_work </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>noutput_items</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classstd_1_1vector.html">gr_vector_int</a> & </td> <td class="paramname"><em>ninput_items</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classstd_1_1vector.html">gr_vector_const_void_star</a> & </td> <td class="paramname"><em>input_items</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classstd_1_1vector.html">gr_vector_void_star</a> & </td> <td class="paramname"><em>output_items</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>compute output items from input items </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">noutput_items</td><td>number of output items to write on each output stream </td></tr> <tr><td class="paramname">ninput_items</td><td>number of input items available on each input stream </td></tr> <tr><td class="paramname">input_items</td><td>vector of pointers to the input items, one entry per input stream </td></tr> <tr><td class="paramname">output_items</td><td>vector of pointers to the output items, one entry per output stream</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>number of items actually written to each output stream, or -1 on EOF. It is OK to return a value less than noutput_items. -1 <= return value <= noutput_items</dd></dl> <p>general_work must call consume or consume_each to indicate how many items were consumed on each input stream. </p> <p>Implements <a class="el" href="classgr__block.html#a137b93d87dc83bbdb6369d33f4ea8197">gr_block</a>.</p> </div> </div> <hr/><h2>Friends And Related Function Documentation</h2> <a class="anchor" id="a6f3ee7564cc6b2ec763cc9ffffa839a8"></a><!-- doxytag: member="gr_stream_mux::gr_make_stream_mux" ref="a6f3ee7564cc6b2ec763cc9ffffa839a8" args="(size_t itemsize, const std::vector< int > &lengths)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classboost_1_1shared__ptr.html">gr_stream_mux_sptr</a> gr_make_stream_mux </td> <td>(</td> <td class="paramtype">size_t </td> <td class="paramname"><em>itemsize</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classstd_1_1vector.html">std::vector</a>< int > & </td> <td class="paramname"><em>lengths</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [friend]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="gr__stream__mux_8h_source.html">gr_stream_mux.h</a></li> </ul> </div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="classgr__stream__mux.html">gr_stream_mux</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>