<!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: mb_mblock 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('classmb__mblock.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>mb_mblock Class Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="mb_mblock" --> <p>Parent class for all message passing blocks. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="mblock_8h_source.html">mblock.h</a>></code></p> <p><a href="classmb__mblock-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">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#acabcfc92899739d510f65755fcebbf87">initial_transition</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Called by the runtime system to execute the initial transition of the finite state machine. <a href="#acabcfc92899739d510f65755fcebbf87"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a6f2b3e251032173579d5138b72290abc">~mb_mblock</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a62019844e24c535f0803318b1c1d7005">instance_name</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return instance name of this block. <a href="#a62019844e24c535f0803318b1c1d7005"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a1344b9a214c84b1e968f77ee098046ef">class_name</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the class name of this block. <a href="#a1344b9a214c84b1e968f77ee098046ef"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#affe51c6b003e08eb672934ff687daaca">set_instance_name</a> (const std::string &name)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the instance name of this block. <a href="#affe51c6b003e08eb672934ff687daaca"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmb__mblock.html">mb_mblock</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#aee14050f3be0aaf4c844702b0e6e294c">parent</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the parent of this mblock, or 0 if we're the top-level block. <a href="#aee14050f3be0aaf4c844702b0e6e294c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a5a39284aefb6c9216968bc1e057a504e">schedule_one_shot_timeout</a> (const <a class="el" href="structomni__time.html">mb_time</a> &abs_time, <a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> user_data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Schedule a "one shot" timeout. <a href="#a5a39284aefb6c9216968bc1e057a504e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a2a025f508180403844eb3a4e6a122fc9">schedule_periodic_timeout</a> (const <a class="el" href="structomni__time.html">mb_time</a> &first_abs_time, const <a class="el" href="structomni__time.html">mb_time</a> &delta_time, <a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> user_data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Schedule a periodic timeout. <a href="#a2a025f508180403844eb3a4e6a122fc9"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a70031b0b32a186763187892987f1798e">cancel_timeout</a> (<a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> handle)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Attempt to cancel a pending timeout. <a href="#a70031b0b32a186763187892987f1798e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="gc__types_8h.html#a0f2b5d454b7e4dda3861032cfce91085">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#ad6b767c539ecd52fd843e01638c75379">walk_tree</a> (<a class="el" href="classmb__visitor.html">mb_visitor</a> *visitor)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Perform a pre-order depth-first traversal of the hierarchy. <a href="#ad6b767c539ecd52fd843e01638c75379"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classboost_1_1shared__ptr.html">mb_mblock_impl_sptr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a6db8b3246c9d2d862bd20876ffe9a16d">impl</a> () const </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="classmb__mblock.html#a83c87a06b23082a4d076eaf8f437434c">mb_mblock</a> (<a class="el" href="classmb__runtime.html">mb_runtime</a> *runtime, const std::string &instance_name, <a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> user_arg)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">mblock constructor. <a href="#a83c87a06b23082a4d076eaf8f437434c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a5f96d36f950607b82a12b1b1b8d82a87">handle_message</a> (<a class="el" href="classboost_1_1shared__ptr.html">mb_message_sptr</a> msg)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Called by the runtime system when there's a message to handle. <a href="#a5f96d36f950607b82a12b1b1b8d82a87"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classboost_1_1shared__ptr.html">mb_port_sptr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a47b1aa472fa25822b169a1a780706cc9">define_port</a> (const std::string &port_name, const std::string &protocol_class_name, <a class="el" href="gc__types_8h.html#a0f2b5d454b7e4dda3861032cfce91085">bool</a> conjugated, <a class="el" href="classmb__port.html#ab7f3f63c496d0de66461f09320bbaaa7">mb_port::port_type_t</a> port_type)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Define a port. <a href="#a47b1aa472fa25822b169a1a780706cc9"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#ac560e9e981bc13874c57fe753870e3a1">define_component</a> (const std::string &component_name, const std::string &class_name, <a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> user_arg=<a class="el" href="pmt_8h.html#aba0945ac11683535c229c6047c21c523">PMT_NIL</a>)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Define a subcomponent by name. <a href="#ac560e9e981bc13874c57fe753870e3a1"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a0800477701715dd006d87f3d807f55c1">connect</a> (const std::string &comp_name1, const std::string &port_name1, const std::string &comp_name2, const std::string &port_name2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">connect endpoint_1 to endpoint_2 <a href="#a0800477701715dd006d87f3d807f55c1"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a500f577145bd9a5afc33203ba0a61cd6">disconnect</a> (const std::string &comp_name1, const std::string &port_name1, const std::string &comp_name2, const std::string &port_name2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">disconnect endpoint_1 from endpoint_2 <a href="#a500f577145bd9a5afc33203ba0a61cd6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a2f4ca20b58c89386d6f6ac2c276646d0">disconnect_component</a> (const std::string &component_name)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">disconnect all connections to specified component <a href="#a2f4ca20b58c89386d6f6ac2c276646d0"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#afbfe3e2601f9a92823690ce0a013ef9d">disconnect_all</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">disconnect all connections to all components <a href="#afbfe3e2601f9a92823690ce0a013ef9d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#aeb61577b8eab6672f87cf66a88814e26">nconnections</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return number of connections (QA mostly) <a href="#aeb61577b8eab6672f87cf66a88814e26"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a10653b3e3b5f39272d028f54b96878ca">set_class_name</a> (const std::string &name)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the class name. <a href="#a10653b3e3b5f39272d028f54b96878ca"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a6be918a924c59e55996d9e9ce1e6b4ec">exit</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Tell runtime that we are done. <a href="#a6be918a924c59e55996d9e9ce1e6b4ec"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a1d9ccf70a91a04e23580408053f2fa2c">shutdown_all</a> (<a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> result)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Ask runtime to execute the shutdown procedure for all blocks. <a href="#a1d9ccf70a91a04e23580408053f2fa2c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#aa9d454e5c35e31613d44dd75505064a3">main_loop</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">main event dispatching loop <a href="#aa9d454e5c35e31613d44dd75505064a3"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="friends"></a> Friends</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#aad09a593a1585ff8851fe55811bf88fe">mb_runtime</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#ac7e9d347deac80b4fe67cc2ddf33d707">mb_mblock_impl</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classmb__mblock.html#a639baa2ef8eae99412296b2dbbef71a9">mb_worker</a></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Parent class for all message passing blocks. </p> <p>Subclass this to define your mblocks. </p> </div><hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a83c87a06b23082a4d076eaf8f437434c"></a><!-- doxytag: member="mb_mblock::mb_mblock" ref="a83c87a06b23082a4d076eaf8f437434c" args="(mb_runtime *runtime, const std::string &instance_name, pmt_t user_arg)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">mb_mblock::mb_mblock </td> <td>(</td> <td class="paramtype"><a class="el" href="classmb__runtime.html">mb_runtime</a> * </td> <td class="paramname"><em>runtime</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>instance_name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> </td> <td class="paramname"><em>user_arg</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>mblock constructor. </p> <p>Initializing all mblocks in the system is a 3 step procedure.</p> <p>The top level mblock's constructor is run. That constructor (a) registers all of its ports using define_port, (b) registers any subcomponents it may have via the define_component method, and then (c) issues connect calls to wire its subcomponents together.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">runtime</td><td>the runtime associated with this mblock </td></tr> <tr><td class="paramname">instance_name</td><td>specify the name of this instance (for debugging, NUMA mapping, etc) </td></tr> <tr><td class="paramname">user_arg</td><td>argument passed by user to constructor (ignored by the <a class="el" href="classmb__mblock.html" title="Parent class for all message passing blocks.">mb_mblock</a> base class) </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a6f2b3e251032173579d5138b72290abc"></a><!-- doxytag: member="mb_mblock::~mb_mblock" ref="a6f2b3e251032173579d5138b72290abc" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual mb_mblock::~mb_mblock </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a70031b0b32a186763187892987f1798e"></a><!-- doxytag: member="mb_mblock::cancel_timeout" ref="a70031b0b32a186763187892987f1798e" args="(pmt_t handle)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mb_mblock::cancel_timeout </td> <td>(</td> <td class="paramtype"><a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> </td> <td class="paramname"><em>handle</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Attempt to cancel a pending timeout. </p> <p>Note that this only stops a future timeout from firing. It is possible that a timeout may have already fired and enqueued a timeout message, but that that message has not yet been seen by handle_message.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">handle</td><td>returned from schedule_one_shot_timeout or schedule_periodic_timeout. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a1344b9a214c84b1e968f77ee098046ef"></a><!-- doxytag: member="mb_mblock::class_name" ref="a1344b9a214c84b1e968f77ee098046ef" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string mb_mblock::class_name </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Return the class name of this block. </p> </div> </div> <a class="anchor" id="a0800477701715dd006d87f3d807f55c1"></a><!-- doxytag: member="mb_mblock::connect" ref="a0800477701715dd006d87f3d807f55c1" args="(const std::string &comp_name1, const std::string &port_name1, const std::string &comp_name2, const std::string &port_name2)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mb_mblock::connect </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>comp_name1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>port_name1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>comp_name2</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>port_name2</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>connect endpoint_1 to endpoint_2 </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">comp_name1</td><td>component on one end of the connection </td></tr> <tr><td class="paramname">port_name1</td><td>the name of the port on comp1 </td></tr> <tr><td class="paramname">comp_name2</td><td>component on the other end of the connection </td></tr> <tr><td class="paramname">port_name2</td><td>the name of the port on comp2</td></tr> </table> </dd> </dl> <p>An endpoint is specified by the component's local name (given as component_name in the call to register_component) and the name of the port on that component.</p> <p>To connect an internal or relay port, use "self" as the component name. </p> </div> </div> <a class="anchor" id="ac560e9e981bc13874c57fe753870e3a1"></a><!-- doxytag: member="mb_mblock::define_component" ref="ac560e9e981bc13874c57fe753870e3a1" args="(const std::string &component_name, const std::string &class_name, pmt_t user_arg=PMT_NIL)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mb_mblock::define_component </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>component_name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>class_name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> </td> <td class="paramname"><em>user_arg</em> = <code><a class="el" href="pmt_8h.html#aba0945ac11683535c229c6047c21c523">PMT_NIL</a></code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Define a subcomponent by name. </p> <p>Called within the constructor to tell the system the names and identities of our sub-component mblocks.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">component_name</td><td>The name of the sub-component (must be unique with this mblock). </td></tr> <tr><td class="paramname">class_name</td><td>The class of the instance that is to be created. </td></tr> <tr><td class="paramname">user_arg</td><td>The argument to pass to the constructor of the component. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a47b1aa472fa25822b169a1a780706cc9"></a><!-- doxytag: member="mb_mblock::define_port" ref="a47b1aa472fa25822b169a1a780706cc9" args="(const std::string &port_name, const std::string &protocol_class_name, bool conjugated, mb_port::port_type_t port_type)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classboost_1_1shared__ptr.html">mb_port_sptr</a> mb_mblock::define_port </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>port_name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>protocol_class_name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="gc__types_8h.html#a0f2b5d454b7e4dda3861032cfce91085">bool</a> </td> <td class="paramname"><em>conjugated</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classmb__port.html#ab7f3f63c496d0de66461f09320bbaaa7">mb_port::port_type_t</a> </td> <td class="paramname"><em>port_type</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Define a port. </p> <p>EXTERNAL and RELAY ports are part of our peer interface. INTERNAL ports are used to talk to sub-components.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">port_name</td><td>The name of the port (must be unique within this mblock). </td></tr> <tr><td class="paramname">protocol_class_name</td><td>The name of the protocol class associated with this port. It must already be defined. </td></tr> <tr><td class="paramname">conjugated</td><td>Are the incoming and outgoing message sets swapped? </td></tr> <tr><td class="paramname">port_type</td><td>INTERNAL, EXTERNAL or RELAY. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a500f577145bd9a5afc33203ba0a61cd6"></a><!-- doxytag: member="mb_mblock::disconnect" ref="a500f577145bd9a5afc33203ba0a61cd6" args="(const std::string &comp_name1, const std::string &port_name1, const std::string &comp_name2, const std::string &port_name2)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mb_mblock::disconnect </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>comp_name1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>port_name1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>comp_name2</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>port_name2</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>disconnect endpoint_1 from endpoint_2 </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">comp_name1</td><td>component on one end of the connection </td></tr> <tr><td class="paramname">port_name1</td><td>the name of the port on comp1 </td></tr> <tr><td class="paramname">comp_name2</td><td>component on the other end of the connection </td></tr> <tr><td class="paramname">port_name2</td><td>the name of the port on comp2</td></tr> </table> </dd> </dl> <p>An endpoint is specified by the component's local name (given as component_name in the call to register_component) and the name of the port on that component.</p> <p>To disconnect an internal or relay port, use "self" as the component name. </p> </div> </div> <a class="anchor" id="afbfe3e2601f9a92823690ce0a013ef9d"></a><!-- doxytag: member="mb_mblock::disconnect_all" ref="afbfe3e2601f9a92823690ce0a013ef9d" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mb_mblock::disconnect_all </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>disconnect all connections to all components </p> </div> </div> <a class="anchor" id="a2f4ca20b58c89386d6f6ac2c276646d0"></a><!-- doxytag: member="mb_mblock::disconnect_component" ref="a2f4ca20b58c89386d6f6ac2c276646d0" args="(const std::string &component_name)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mb_mblock::disconnect_component </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>component_name</em></td><td>)</td> <td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>disconnect all connections to specified component </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">component_name</td><td>component to disconnect </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a6be918a924c59e55996d9e9ce1e6b4ec"></a><!-- doxytag: member="mb_mblock::exit" ref="a6be918a924c59e55996d9e9ce1e6b4ec" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mb_mblock::exit </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Tell runtime that we are done. </p> <p>This method does not return. </p> </div> </div> <a class="anchor" id="a5f96d36f950607b82a12b1b1b8d82a87"></a><!-- doxytag: member="mb_mblock::handle_message" ref="a5f96d36f950607b82a12b1b1b8d82a87" args="(mb_message_sptr msg)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual void mb_mblock::handle_message </td> <td>(</td> <td class="paramtype"><a class="el" href="classboost_1_1shared__ptr.html">mb_message_sptr</a> </td> <td class="paramname"><em>msg</em></td><td>)</td> <td><code> [protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Called by the runtime system when there's a message to handle. </p> <p>Override this to define your behavior.</p> <p>Do not issue any potentially blocking calls in this method. This includes things such reads or writes on sockets, pipes or slow i/o devices. </p> </div> </div> <a class="anchor" id="a6db8b3246c9d2d862bd20876ffe9a16d"></a><!-- doxytag: member="mb_mblock::impl" ref="a6db8b3246c9d2d862bd20876ffe9a16d" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classboost_1_1shared__ptr.html">mb_mblock_impl_sptr</a> mb_mblock::impl </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <a class="anchor" id="acabcfc92899739d510f65755fcebbf87"></a><!-- doxytag: member="mb_mblock::initial_transition" ref="acabcfc92899739d510f65755fcebbf87" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual void mb_mblock::initial_transition </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Called by the runtime system to execute the initial transition of the finite state machine. </p> <p>This method is called by the runtime after all blocks are constructed and before the first message is delivered. Override this to initialize your finite state machine. </p> </div> </div> <a class="anchor" id="a62019844e24c535f0803318b1c1d7005"></a><!-- doxytag: member="mb_mblock::instance_name" ref="a62019844e24c535f0803318b1c1d7005" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string mb_mblock::instance_name </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Return instance name of this block. </p> </div> </div> <a class="anchor" id="aa9d454e5c35e31613d44dd75505064a3"></a><!-- doxytag: member="mb_mblock::main_loop" ref="aa9d454e5c35e31613d44dd75505064a3" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual void mb_mblock::main_loop </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>main event dispatching loop </p> <p>Although it is possible to override this, the default implementation should work for virtually all cases. </p> </div> </div> <a class="anchor" id="aeb61577b8eab6672f87cf66a88814e26"></a><!-- doxytag: member="mb_mblock::nconnections" ref="aeb61577b8eab6672f87cf66a88814e26" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mb_mblock::nconnections </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Return number of connections (QA mostly) </p> </div> </div> <a class="anchor" id="aee14050f3be0aaf4c844702b0e6e294c"></a><!-- doxytag: member="mb_mblock::parent" ref="aee14050f3be0aaf4c844702b0e6e294c" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classmb__mblock.html">mb_mblock</a>* mb_mblock::parent </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Return the parent of this mblock, or 0 if we're the top-level block. </p> </div> </div> <a class="anchor" id="a5a39284aefb6c9216968bc1e057a504e"></a><!-- doxytag: member="mb_mblock::schedule_one_shot_timeout" ref="a5a39284aefb6c9216968bc1e057a504e" args="(const mb_time &abs_time, pmt_t user_data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> mb_mblock::schedule_one_shot_timeout </td> <td>(</td> <td class="paramtype">const <a class="el" href="structomni__time.html">mb_time</a> & </td> <td class="paramname"><em>abs_time</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> </td> <td class="paramname"><em>user_data</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Schedule a "one shot" timeout. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">abs_time</td><td>the absolute time at which the timeout should fire </td></tr> <tr><td class="paramname">user_data</td><td>the data passed in the timeout message.</td></tr> </table> </dd> </dl> <p>When the timeout fires, a message will be sent to the mblock.</p> <p>The message will have port_id = sys-port, signal = timeout, data = user_data, metadata = the handle returned from schedule_one_shot_timeout, pri = MB_PRI_BEST.</p> <dl class="return"><dt><b>Returns:</b></dt><dd>a handle that can be used in cancel_timeout, and is passed as the metadata field of the generated timeout message.</dd></dl> <p>To cancel a pending timeout, call cancel_timeout. </p> </div> </div> <a class="anchor" id="a2a025f508180403844eb3a4e6a122fc9"></a><!-- doxytag: member="mb_mblock::schedule_periodic_timeout" ref="a2a025f508180403844eb3a4e6a122fc9" args="(const mb_time &first_abs_time, const mb_time &delta_time, pmt_t user_data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> mb_mblock::schedule_periodic_timeout </td> <td>(</td> <td class="paramtype">const <a class="el" href="structomni__time.html">mb_time</a> & </td> <td class="paramname"><em>first_abs_time</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="structomni__time.html">mb_time</a> & </td> <td class="paramname"><em>delta_time</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> </td> <td class="paramname"><em>user_data</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Schedule a periodic timeout. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">first_abs_time</td><td>The absolute time at which the first timeout should fire. </td></tr> <tr><td class="paramname">delta_time</td><td>The relative delay between the first and successive timeouts. </td></tr> <tr><td class="paramname">user_data</td><td>the data passed in the timeout message.</td></tr> </table> </dd> </dl> <p>When the timeout fires, a message will be sent to the mblock, and a new timeout will be scheduled for previous absolute time + delta_time.</p> <p>The message will have port_id = sys-port, signal = timeout, data = user_data, metadata = the handle returned from schedule_one_shot_timeout, pri = MB_PRI_BEST.</p> <dl class="return"><dt><b>Returns:</b></dt><dd>a handle that can be used in cancel_timeout, and is passed as the metadata field of the generated timeout message.</dd></dl> <p>To cancel a pending timeout, call cancel_timeout. </p> </div> </div> <a class="anchor" id="a10653b3e3b5f39272d028f54b96878ca"></a><!-- doxytag: member="mb_mblock::set_class_name" ref="a10653b3e3b5f39272d028f54b96878ca" args="(const std::string &name)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mb_mblock::set_class_name </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>name</em></td><td>)</td> <td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Set the class name. </p> </div> </div> <a class="anchor" id="affe51c6b003e08eb672934ff687daaca"></a><!-- doxytag: member="mb_mblock::set_instance_name" ref="affe51c6b003e08eb672934ff687daaca" args="(const std::string &name)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mb_mblock::set_instance_name </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>name</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Set the instance name of this block. </p> </div> </div> <a class="anchor" id="a1d9ccf70a91a04e23580408053f2fa2c"></a><!-- doxytag: member="mb_mblock::shutdown_all" ref="a1d9ccf70a91a04e23580408053f2fa2c" args="(pmt_t result)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mb_mblock::shutdown_all </td> <td>(</td> <td class="paramtype"><a class="el" href="classboost_1_1shared__ptr.html">pmt_t</a> </td> <td class="paramname"><em>result</em></td><td>)</td> <td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Ask runtime to execute the shutdown procedure for all blocks. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">result</td><td>sets value of <code>result</code> output argument of runtime->run(...)</td></tr> </table> </dd> </dl> <p>The runtime first sends a maximum priority shutdown message to all blocks. All blocks should handle the shutdown message, perform whatever clean up is required, and call this-><a class="el" href="classmb__mblock.html#a6be918a924c59e55996d9e9ce1e6b4ec" title="Tell runtime that we are done.">exit()</a>;</p> <p>After a period of time (~100ms), any blocks which haven't yet called this-><a class="el" href="classmb__mblock.html#a6be918a924c59e55996d9e9ce1e6b4ec" title="Tell runtime that we are done.">exit()</a> are sent a maximum priority halt message. halt is detected in main_loop, and this-><a class="el" href="classmb__mblock.html#a6be918a924c59e55996d9e9ce1e6b4ec" title="Tell runtime that we are done.">exit()</a> is called.</p> <p>After an additional period of time (~100ms), any blocks which still haven't yet called this-><a class="el" href="classmb__mblock.html#a6be918a924c59e55996d9e9ce1e6b4ec" title="Tell runtime that we are done.">exit()</a> are sent a SIG<FOO> (TBD) signal, which will blow them out of any blocking system calls and raise an <a class="el" href="classmbe__terminate.html">mbe_terminate</a> exception. The default top-level runtime-provided exception handler will call this-><a class="el" href="classmb__mblock.html#a6be918a924c59e55996d9e9ce1e6b4ec" title="Tell runtime that we are done.">exit()</a> to finish the process.</p> <p>runtime->run(...) returns when all blocks have called exit. </p> </div> </div> <a class="anchor" id="ad6b767c539ecd52fd843e01638c75379"></a><!-- doxytag: member="mb_mblock::walk_tree" ref="ad6b767c539ecd52fd843e01638c75379" args="(mb_visitor *visitor)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="gc__types_8h.html#a0f2b5d454b7e4dda3861032cfce91085">bool</a> mb_mblock::walk_tree </td> <td>(</td> <td class="paramtype"><a class="el" href="classmb__visitor.html">mb_visitor</a> * </td> <td class="paramname"><em>visitor</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Perform a pre-order depth-first traversal of the hierarchy. </p> <p>The traversal stops and returns false if any call to visitor returns false. </p> </div> </div> <hr/><h2>Friends And Related Function Documentation</h2> <a class="anchor" id="ac7e9d347deac80b4fe67cc2ddf33d707"></a><!-- doxytag: member="mb_mblock::mb_mblock_impl" ref="ac7e9d347deac80b4fe67cc2ddf33d707" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">friend class <a class="el" href="classmb__mblock__impl.html">mb_mblock_impl</a><code> [friend]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <a class="anchor" id="aad09a593a1585ff8851fe55811bf88fe"></a><!-- doxytag: member="mb_mblock::mb_runtime" ref="aad09a593a1585ff8851fe55811bf88fe" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">friend class <a class="el" href="classmb__runtime.html">mb_runtime</a><code> [friend]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <a class="anchor" id="a639baa2ef8eae99412296b2dbbef71a9"></a><!-- doxytag: member="mb_mblock::mb_worker" ref="a639baa2ef8eae99412296b2dbbef71a9" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">friend class <a class="el" href="classmb__worker.html">mb_worker</a><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="mblock_8h_source.html">mblock.h</a></li> </ul> </div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="classmb__mblock.html">mb_mblock</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>