gr-baz Package
howto_square_ff.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004 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 #ifndef INCLUDED_HOWTO_SQUARE_FF_H
23 #define INCLUDED_HOWTO_SQUARE_FF_H
24 
25 #include <howto_api.h>
26 #include <gr_block.h>
27 
28 class howto_square_ff;
29 
30 /*
31  * We use boost::shared_ptr's instead of raw pointers for all access
32  * to gr_blocks (and many other data structures). The shared_ptr gets
33  * us transparent reference counting, which greatly simplifies storage
34  * management issues. This is especially helpful in our hybrid
35  * C++ / Python system.
36  *
37  * See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
38  *
39  * As a convention, the _sptr suffix indicates a boost::shared_ptr
40  */
42 
43 /*!
44  * \brief Return a shared_ptr to a new instance of howto_square_ff.
45  *
46  * To avoid accidental use of raw pointers, howto_square_ff's
47  * constructor is private. howto_make_square_ff is the public
48  * interface for creating new instances.
49  */
51 
52 /*!
53  * \brief square a stream of floats.
54  * \ingroup block
55  *
56  * \sa howto_square2_ff for a version that subclasses gr_sync_block.
57  */
59 {
60 private:
61  // The friend declaration allows howto_make_square_ff to
62  // access the private constructor.
63 
65 
66  /*!
67  * \brief square a stream of floats.
68  */
69  howto_square_ff (); // private constructor
70 
71  public:
72  ~howto_square_ff (); // public destructor
73 
74  // Where all the action really happens
75 
76  int general_work (int noutput_items,
77  gr_vector_int &ninput_items,
78  gr_vector_const_void_star &input_items,
79  gr_vector_void_star &output_items);
80 };
81 
82 #endif /* INCLUDED_HOWTO_SQUARE_FF_H */