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