|
gr-baz Package
|
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 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_POW_CC_H 00029 #define INCLUDED_BAZ_POW_CC_H 00030 00031 #include <gr_sync_block.h> 00032 00033 class BAZ_API baz_pow_cc; 00034 00035 /* 00036 * We use boost::shared_ptr's instead of raw pointers for all access 00037 * to gr_blocks (and many other data structures). The shared_ptr gets 00038 * us transparent reference counting, which greatly simplifies storage 00039 * management issues. This is especially helpful in our hybrid 00040 * C++ / Python system. 00041 * 00042 * See http://www.boost.org/libs/smart_ptr/smart_ptr.htm 00043 * 00044 * As a convention, the _sptr suffix indicates a boost::shared_ptr 00045 */ 00046 typedef boost::shared_ptr<baz_pow_cc> baz_pow_cc_sptr; 00047 00048 /*! 00049 * \brief Return a shared_ptr to a new instance of baz_pow_cc. 00050 * 00051 * To avoid accidental use of raw pointers, baz_pow_cc's 00052 * constructor is private. howto_make_square2_ff is the public 00053 * interface for creating new instances. 00054 */ 00055 BAZ_API baz_pow_cc_sptr baz_make_pow_cc (float exponent, float div_exp = 0.0); 00056 00057 /*! 00058 * \brief square2 a stream of floats. 00059 * \ingroup block 00060 * 00061 * This uses the preferred technique: subclassing gr_sync_block. 00062 */ 00063 class BAZ_API baz_pow_cc : public gr_sync_block 00064 { 00065 private: 00066 // The friend declaration allows howto_make_square2_ff to 00067 // access the private constructor. 00068 00069 friend BAZ_API baz_pow_cc_sptr baz_make_pow_cc (float exponent, float div_exp); 00070 00071 baz_pow_cc (float exponent, float div_exp = 0.0); // private constructor 00072 00073 float d_exponent; 00074 float d_div_exp; 00075 00076 public: 00077 ~baz_pow_cc (); // public destructor 00078 00079 void set_exponent(float exponent); 00080 void set_division_exponent(float div_exp); 00081 00082 inline float exponent() const 00083 { return d_exponent; } 00084 inline float division_exponent() const 00085 { return d_div_exp; } 00086 00087 int work (int noutput_items, 00088 gr_vector_const_void_star &input_items, 00089 gr_vector_void_star &output_items); 00090 }; 00091 00092 #endif /* INCLUDED_BAZ_POW_CC_H */