|
gr-baz Package
|
00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2004,2013 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 /* 00024 * gr-baz by Balint Seeber (http://spench.net/contact) 00025 * Information, documentation & samples: http://wiki.spench.net/wiki/gr-baz 00026 */ 00027 00028 #ifndef INCLUDED_BAZ_PRINT_CHAR_H 00029 #define INCLUDED_BAZ_PRINT_CHAR_H 00030 00031 #include <gr_sync_block.h> 00032 00033 class BAZ_API baz_print_char; 00034 00035 /* 00036 * See http://www.boost.org/libs/smart_ptr/smart_ptr.htm 00037 */ 00038 typedef boost::shared_ptr<baz_print_char> baz_print_char_sptr; 00039 00040 /*! 00041 * \brief Return a shared_ptr to a new instance of baz_print_char. 00042 * 00043 * To avoid accidental use of raw pointers, baz_print_char's 00044 * constructor is private. howto_make_square_ff is the public 00045 * interface for creating new instances. 00046 */ 00047 BAZ_API baz_print_char_sptr baz_make_print_char (float threshold = 0.0, int limit = -1, const char* file = NULL); 00048 00049 /*! 00050 * \brief square a stream of floats. 00051 * \ingroup block 00052 * 00053 * \sa howto_square2_ff for a version that subclasses gr_sync_block. 00054 */ 00055 class BAZ_API baz_print_char : public gr_sync_block 00056 { 00057 private: 00058 friend BAZ_API baz_print_char_sptr baz_make_print_char (float threshold, int limit, const char* file); 00059 baz_print_char (float threshold, int limit, const char* file); // private constructor 00060 private: 00061 float d_threshold; 00062 int d_limit; 00063 int d_length; 00064 FILE* d_file; 00065 public: 00066 ~baz_print_char (); // public destructor 00067 //int general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); 00068 int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); 00069 }; 00070 00071 #endif /* INCLUDED_BAZ_PRINT_CHAR_H */