gr_hier_block2.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2006,2007 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   void connect(gr_basic_block_sptr block);
00070 
00078   void connect(gr_basic_block_sptr src, int src_port, 
00079                gr_basic_block_sptr dst, int dst_port);
00080 
00088   void disconnect(gr_basic_block_sptr block);
00089 
00097   void disconnect(gr_basic_block_sptr src, int src_port,
00098                   gr_basic_block_sptr dst, int dst_port);
00099 
00106   void disconnect_all();
00107 
00117   virtual void lock();
00118 
00128   virtual void unlock();
00129 
00130   // This is a public method for ease of code organization, but should be
00131   // ignored by the user.
00132   gr_flat_flowgraph_sptr flatten() const;
00133 };
00134 
00135 inline gr_hier_block2_sptr make_hier_block2_sptr(gr_basic_block_sptr block) {
00136   return boost::dynamic_pointer_cast<gr_hier_block2, gr_basic_block>(block);
00137 }
00138 
00139 #endif /* INCLUDED_GR_HIER_BLOCK2_H */

Generated on Mon Oct 6 23:21:37 2008 for GNU Radio 3.1.2 by  doxygen 1.5.7.1