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 00023 #ifndef INCLUDED_GR_FLAT_FLOWGRAPH_H 00024 #define INCLUDED_GR_FLAT_FLOWGRAPH_H 00025 00026 #include <gr_flowgraph.h> 00027 #include <gr_block.h> 00028 00029 // 32Kbyte buffer size between blocks 00030 #define GR_FIXED_BUFFER_SIZE (32*(1L<<10)) 00031 00032 // Create a shared pointer to a heap allocated gr_flat_flowgraph 00033 // (types defined in gr_runtime_types.h) 00034 gr_flat_flowgraph_sptr gr_make_flat_flowgraph(); 00035 00041 class gr_flat_flowgraph : public gr_flowgraph 00042 { 00043 public: 00044 friend gr_flat_flowgraph_sptr gr_make_flat_flowgraph(); 00045 00046 // Destruct an arbitrary gr_flat_flowgraph 00047 ~gr_flat_flowgraph(); 00048 00049 // Wire gr_blocks together in new flat_flowgraph 00050 void setup_connections(); 00051 00052 // Merge applicable connections from existing flat flowgraph 00053 void merge_connections(gr_flat_flowgraph_sptr sfg); 00054 00055 private: 00056 gr_flat_flowgraph(); 00057 00058 static const unsigned int s_fixed_buffer_size = GR_FIXED_BUFFER_SIZE; 00059 gr_block_detail_sptr allocate_block_detail(gr_basic_block_sptr block, 00060 gr_block_detail_sptr old_detail=gr_block_detail_sptr()); 00061 gr_buffer_sptr allocate_buffer(gr_basic_block_sptr block, int port); 00062 void connect_block_inputs(gr_basic_block_sptr block); 00063 }; 00064 00065 #endif /* INCLUDED_GR_FLAT_FLOWGRAPH_H */