gr-baz Package

baz_print_char.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2004,2013 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
10 * any later version.
11 *
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
21 */
22
23/*
24 * gr-baz by Balint Seeber (http://spench.net/contact)
25 * Information, documentation & samples: http://wiki.spench.net/wiki/gr-baz
26 */
27
28#ifndef INCLUDED_BAZ_PRINT_CHAR_H
29#define INCLUDED_BAZ_PRINT_CHAR_H
30
31#include <gnuradio/sync_block.h>
32
33 class BAZ_API baz_print_char;
34
35/*
36 * See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
37 */
38 typedef boost::shared_ptr<baz_print_char> baz_print_char_sptr;
39
40/*!
41 * \brief Return a shared_ptr to a new instance of baz_print_char.
42 *
43 * To avoid accidental use of raw pointers, baz_print_char's
44 * constructor is private. howto_make_square_ff is the public
45 * interface for creating new instances.
46 */
47 BAZ_API baz_print_char_sptr baz_make_print_char (float threshold = 0.0, int limit = -1, const char* file = NULL, int padding = 1, bool fixed_limit = false, bool append = false);
48
49/*!
50 * \brief square a stream of floats.
51 * \ingroup block
52 *
53 * \sa howto_square2_ff for a version that subclasses gr::sync_block.
54 */
55 class BAZ_API baz_print_char : public gr::sync_block
56{
57 private:
58 friend BAZ_API baz_print_char_sptr baz_make_print_char (float threshold, int limit, const char* file, int padding, bool fixed_limit, bool append);
59 baz_print_char (float threshold, int limit, const char* file, int padding, bool fixed_limit, bool append); // private constructor
60 private:
61 float d_threshold;
62 int d_limit;
63 int d_length;
64 FILE* d_file;
65 int d_padding;
66 bool d_fixed_limit;
67 char d_format_string[5];
68 public:
69 ~baz_print_char (); // public destructor
70 int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
71};
72
73#endif /* INCLUDED_BAZ_PRINT_CHAR_H */
BAZ_API
#define BAZ_API
Definition api.h:19
baz_make_print_char
BAZ_API baz_print_char_sptr baz_make_print_char(float threshold=0.0, int limit=-1, const char *file=NULL, int padding=1, bool fixed_limit=false, bool append=false)
Return a shared_ptr to a new instance of baz_print_char.
baz_print_char
class BAZ_API baz_print_char
Definition baz_print_char.h:33
baz_print_char
square a stream of floats.
Definition baz_print_char.h:56
baz_print_char::~baz_print_char
~baz_print_char()
baz_print_char::work
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
baz_print_char::baz_make_print_char
friend BAZ_API baz_print_char_sptr baz_make_print_char(float threshold, int limit, const char *file, int padding, bool fixed_limit, bool append)
Return a shared_ptr to a new instance of baz_print_char.