GNU Radio 3.6.4.2 C++ API
gr_hier_block2.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_HIER_BLOCK2_H
00023 #define INCLUDED_GNURADIO_GR_HIER_BLOCK2_H
00024 
00025 #include <gr_core_api.h>
00026 #include <gras/hier_block.hpp>
00027 #include <gr_io_signature.h>
00028 
00029 struct GR_CORE_API gr_hier_block2 : gras::HierBlock
00030 {
00031 
00032     gr_hier_block2(void);
00033 
00034     gr_hier_block2(
00035         const std::string &name,
00036         gr_io_signature_sptr input_signature,
00037         gr_io_signature_sptr output_signature
00038     );
00039 
00040     long unique_id(void) const{return _unique_id;}
00041     std::string name(void) const{return _name;}
00042     long _unique_id;
00043     std::string _name;
00044 
00045     const gr_hier_block2 &self(void) const
00046     {
00047         return *this;
00048     }
00049 
00050     gr_io_signature_sptr input_signature(void) const;
00051     gr_io_signature_sptr output_signature(void) const;
00052 
00053     void set_input_signature(gr_io_signature_sptr sig);
00054     void set_output_signature(gr_io_signature_sptr sig);
00055 
00056     inline void lock(void){}
00057 
00058     inline void unlock(void){this->commit();}
00059 
00060     gr_io_signature_sptr _in_sig, _out_sig;
00061 };
00062 
00063 typedef boost::shared_ptr<gr_hier_block2> gr_hier_block2_sptr;
00064 
00065 GR_CORE_API gr_hier_block2_sptr gr_make_hier_block2(
00066     const std::string &name,
00067     gr_io_signature_sptr input_signature,
00068     gr_io_signature_sptr output_signature
00069 );
00070 
00071 #endif /*INCLUDED_GNURADIO_GR_HIER_BLOCK2_H*/