gr_hier_block2.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2006,2007,2008 Free Software Foundation, Inc.
00004  * 
00005  * This file is part of GNU Radio
00006  * 
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  * 
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 #ifndef INCLUDED_GR_HIER_BLOCK2_H
00023 #define INCLUDED_GR_HIER_BLOCK2_H
00024 
00025 #include <gr_basic_block.h>
00026 
00031 gr_hier_block2_sptr gr_make_hier_block2(const std::string &name,
00032                                         gr_io_signature_sptr input_signature,
00033                                         gr_io_signature_sptr output_signature);
00034 
00035 class gr_hier_block2_detail;
00036 
00042 class gr_hier_block2 : public gr_basic_block
00043 {
00044 private:
00045   friend class gr_hier_block2_detail;
00046   friend gr_hier_block2_sptr gr_make_hier_block2(const std::string &name,
00047                                                  gr_io_signature_sptr input_signature,
00048                                                  gr_io_signature_sptr output_signature);
00049   
00053   gr_hier_block2_detail *d_detail;
00054     
00055 protected: 
00056   gr_hier_block2(const std::string &name,
00057                  gr_io_signature_sptr input_signature,
00058                  gr_io_signature_sptr output_signature);
00059   
00060 public:
00061   virtual ~gr_hier_block2();
00062   
00069   typedef gr_basic_block_sptr   opaque_self;
00070 
00077   opaque_self self();
00078 
00085   void connect(gr_basic_block_sptr block);
00086 
00094   void connect(gr_basic_block_sptr src, int src_port, 
00095                gr_basic_block_sptr dst, int dst_port);
00096 
00104   void disconnect(gr_basic_block_sptr block);
00105 
00113   void disconnect(gr_basic_block_sptr src, int src_port,
00114                   gr_basic_block_sptr dst, int dst_port);
00115 
00122   void disconnect_all();
00123 
00133   virtual void lock();
00134 
00144   virtual void unlock();
00145 
00146   // This is a public method for ease of code organization, but should be
00147   // ignored by the user.
00148   gr_flat_flowgraph_sptr flatten() const;
00149 };
00150 
00151 inline gr_hier_block2_sptr cast_to_hier_block2_sptr(gr_basic_block_sptr block) {
00152   return boost::dynamic_pointer_cast<gr_hier_block2, gr_basic_block>(block);
00153 }
00154 
00155 #endif /* INCLUDED_GR_HIER_BLOCK2_H */

Generated on Thu Mar 5 09:01:11 2009 for GNU Radio 3.1.3 by  doxygen 1.5.8