Changeset 7718

Show
Ignore:
Timestamp:
02/16/08 11:10:29
Author:
jcorgan
Message:

Improve hierarchical block documentation.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_hier_block2.h

    r7504 r7718  
    6161  virtual ~gr_hier_block2(); 
    6262   
     63  /*! 
     64   * \brief Add a stand-alone (possibly hierarchical) block to internal graph 
     65   * 
     66   * This adds a gr-block or hierarchical block to the internal graph 
     67   * without wiring it to anything else. 
     68   */ 
    6369  void connect(gr_basic_block_sptr block); 
    6470 
     71  /*! 
     72   * \brief Add gr-blocks or hierarchical blocks to internal graph and wire together 
     73   * 
     74   * This adds (if not done earlier by another connect) a pair of gr-blocks or  
     75   * hierarchical blocks to the internal flowgraph, and wires the specified output  
     76   * port to the specified input port. 
     77   */ 
    6578  void connect(gr_basic_block_sptr src, int src_port,  
    6679               gr_basic_block_sptr dst, int dst_port); 
    6780 
     81  /*! 
     82   * \brief Remove a gr-block or hierarchical block from the internal flowgraph. 
     83   * 
     84   * This removes a gr-block or hierarchical block from the internal flowgraph, 
     85   * disconnecting it from other blocks as needed. 
     86   * 
     87   */ 
    6888  void disconnect(gr_basic_block_sptr block); 
    6989 
     90  /*! 
     91   * \brief Disconnect a pair of gr-blocks or hierarchical blocks in internal 
     92   *        flowgraph. 
     93   * 
     94   * This disconnects the specified input port from the specified output port 
     95   * of a pair of gr-blocks or hierarchical blocks. 
     96   */ 
    7097  void disconnect(gr_basic_block_sptr src, int src_port, 
    7198                  gr_basic_block_sptr dst, int dst_port); 
    7299 
     100  /*! 
     101   * \brief Disconnect all connections in the internal flowgraph. 
     102   * 
     103   * This call removes all output port to input port connections in the internal 
     104   * flowgraph. 
     105   */ 
    73106  void disconnect_all(); 
     107 
     108  /*! 
     109   * Lock a flowgraph in preparation for reconfiguration.  When an equal 
     110   * number of calls to lock() and unlock() have occurred, the flowgraph 
     111   * will be restarted automatically. 
     112   * 
     113   * N.B. lock() and unlock() cannot be called from a flowgraph thread 
     114   * (E.g., gr_block::work method) or deadlock will occur when 
     115   * reconfiguration happens. 
     116   */ 
    74117  virtual void lock(); 
     118 
     119  /*! 
     120   * Unlock a flowgraph in preparation for reconfiguration.  When an equal 
     121   * number of calls to lock() and unlock() have occurred, the flowgraph 
     122   * will be restarted automatically. 
     123   * 
     124   * N.B. lock() and unlock() cannot be called from a flowgraph thread 
     125   * (E.g., gr_block::work method) or deadlock will occur when 
     126   * reconfiguration happens. 
     127   */ 
    75128  virtual void unlock(); 
    76129 
     130  // This is a public method for ease of code organization, but should be 
     131  // ignored by the user. 
    77132  gr_flat_flowgraph_sptr flatten() const; 
    78133}; 
  • gnuradio/trunk/gnuradio-core/src/lib/runtime/gr_top_block.h

    r7504 r7718  
    9090 
    9191  /*! 
    92    * Lock a flowgraph in preparation for reconfiguration.  When an equal 
     92   * Unlock a flowgraph in preparation for reconfiguration.  When an equal 
    9393   * number of calls to lock() and unlock() have occurred, the flowgraph 
    9494   * will be restarted automatically. 
  • gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/hier_block2.py

    r6466 r7718  
    3131# 
    3232class hier_block2(object): 
     33    """ 
     34    Python wrapper around the C++ hierarchical block implementation. 
     35    Provides convenience functions and allows proper Python subclassing. 
     36    """ 
     37 
    3338    def __init__(self, name, input_signature, output_signature): 
     39        """ 
     40        Create a hierarchical block with a given name and I/O signatures. 
     41        """ 
    3442        self._hb = hier_block2_swig(name, input_signature, output_signature) 
    3543 
    3644    def __getattr__(self, name): 
     45        """ 
     46        Pass-through member requests to the C++ object. 
     47        """ 
    3748        return getattr(self._hb, name) 
    3849 
    3950    def connect(self, *points): 
    40         '''connect requires one or more arguments that can be coerced to endpoints. 
    41         If more than two arguments are provided, they are connected together successively. 
    42         ''' 
     51        """ 
     52        Connect two or more block endpoints.  An endpoint is either a (block, port) 
     53        tuple, or just a block type.  In the latter case, the port number is assumed 
     54        to be zero. 
     55 
     56        To connect the hierarchical block external inputs or outputs to internal block 
     57        inputs or outputs, use 'self' in the connect call. 
     58 
     59        If multiple arguments are provided, connect will attempt to wire them in series, 
     60        interpreting the endpoints as inputs or outputs as appropriate. 
     61        """ 
     62 
    4363        if len (points) < 1: 
    4464            raise ValueError, ("connect requires at least one endpoint; %d provided." % (len (points),)) 
     
    6686 
    6787    def disconnect(self, *points): 
    68         '''connect requires one or more arguments that can be coerced to endpoints. 
     88        """ 
     89        Disconnect two endpoints in the flowgraph. 
     90 
     91        To disconnect the hierarchical block external inputs or outputs to internal block 
     92        inputs or outputs, use 'self' in the connect call. 
     93 
    6994        If more than two arguments are provided, they are disconnected successively. 
    70         ''' 
     95        """ 
     96         
    7197        if len (points) < 1: 
    7298            raise ValueError, ("disconnect requires at least two endpoints; %d provided." % (len (points),))