GNU Radio 3.6.0 C++ API
howto_square_ff.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2004 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 #ifndef INCLUDED_HOWTO_SQUARE_FF_H
00023 #define INCLUDED_HOWTO_SQUARE_FF_H
00024 
00025 #include <howto_api.h>
00026 #include <gr_block.h>
00027 
00028 class howto_square_ff;
00029 
00030 /*
00031  * We use boost::shared_ptr's instead of raw pointers for all access
00032  * to gr_blocks (and many other data structures).  The shared_ptr gets
00033  * us transparent reference counting, which greatly simplifies storage
00034  * management issues.  This is especially helpful in our hybrid
00035  * C++ / Python system.
00036  *
00037  * See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
00038  *
00039  * As a convention, the _sptr suffix indicates a boost::shared_ptr
00040  */
00041 typedef boost::shared_ptr<howto_square_ff> howto_square_ff_sptr;
00042 
00043 /*!
00044  * \brief Return a shared_ptr to a new instance of howto_square_ff.
00045  *
00046  * To avoid accidental use of raw pointers, howto_square_ff's
00047  * constructor is private.  howto_make_square_ff is the public
00048  * interface for creating new instances.
00049  */
00050 HOWTO_API howto_square_ff_sptr howto_make_square_ff ();
00051 
00052 /*!
00053  * \brief square a stream of floats.
00054  * \ingroup block
00055  *
00056  * \sa howto_square2_ff for a version that subclasses gr_sync_block.
00057  */
00058 class HOWTO_API howto_square_ff : public gr_block
00059 {
00060 private:
00061   // The friend declaration allows howto_make_square_ff to
00062   // access the private constructor.
00063 
00064   friend HOWTO_API howto_square_ff_sptr howto_make_square_ff ();
00065 
00066   /*!
00067    * \brief square a stream of floats.
00068    */
00069   howto_square_ff ();   // private constructor
00070 
00071  public:
00072   ~howto_square_ff ();  // public destructor
00073 
00074   // Where all the action really happens
00075 
00076   int general_work (int noutput_items,
00077                     gr_vector_int &ninput_items,
00078                     gr_vector_const_void_star &input_items,
00079                     gr_vector_void_star &output_items);
00080 };
00081 
00082 #endif /* INCLUDED_HOWTO_SQUARE_FF_H */