GNU Radio 3.6.4.2 C++ API
gr_top_block.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2012-2013 Free Software Foundation, Inc.
00003  *
00004  * This file is part of GNU Radio
00005  *
00006  * GNU Radio is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 3, or (at your option)
00009  * any later version.
00010  *
00011  * GNU Radio is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with GNU Radio; see the file COPYING.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef INCLUDED_GNURADIO_GR_TOP_BLOCK_H
00023 #define INCLUDED_GNURADIO_GR_TOP_BLOCK_H
00024 
00025 #include <gr_core_api.h>
00026 #include <gras/top_block.hpp>
00027 #include <gr_hier_block2.h>
00028 
00029 struct GR_CORE_API gr_top_block : gras::TopBlock
00030 {
00031 
00032     gr_top_block(void);
00033 
00034     gr_top_block(const std::string &name);
00035 
00036     long unique_id(void) const{return _unique_id;}
00037     std::string name(void) const{return _name;}
00038     long _unique_id;
00039     std::string _name;
00040 
00041     void start(const size_t max_items);
00042 
00043     void run(const size_t max_items);
00044 
00045     int max_noutput_items(void) const;
00046 
00047     void set_max_noutput_items(int max_items);
00048 
00049     void run(void);
00050 
00051     virtual void start(void);
00052 
00053     virtual void stop(void);
00054 
00055     virtual void wait(void);
00056 
00057     inline void lock(void){}
00058 
00059     inline void unlock(void){this->commit();}
00060 
00061 };
00062 
00063 typedef boost::shared_ptr<gr_top_block> gr_top_block_sptr;
00064 
00065 GR_CORE_API gr_top_block_sptr gr_make_top_block(const std::string &name);
00066 
00067 #endif /*INCLUDED_GNURADIO_GR_TOP_BLOCK_H*/