GNU Radio 3.6.4.2 C++ API
regenerate_bb_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2007,2012-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 #ifndef INCLUDED_GR_REGENERATE_BB_H
24 #define INCLUDED_GR_REGENERATE_BB_IMPL_H
25 
26 #include <blocks/regenerate_bb.h>
27 
28 namespace gr {
29  namespace blocks {
30 
32  {
33  private:
34  int d_period;
35  int d_countdown;
36  unsigned int d_max_regen;
37  unsigned int d_regen_count;
38 
39  public:
40  regenerate_bb_impl(int period, unsigned int max_regen=500);
42 
43  void set_max_regen(unsigned int regen);
44  void set_period(int period);
45 
46  unsigned int max_regen() const { return d_max_regen; };
47  int period() const { return d_period; };
48 
49  int work(int noutput_items,
50  gr_vector_const_void_star &input_items,
51  gr_vector_void_star &output_items);
52  };
53 
54  } /* namespace blocks */
55 } /* namespace gr */
56 
57 #endif /* INCLUDED_GR_REGENERATE_BB_IMPL_H */
void set_period(int period)
Reset the period of regenerations; this will reset the current regen.
regenerate_bb_impl(int period, unsigned int max_regen=500)
void set_max_regen(unsigned int regen)
Reset the maximum regeneration count; this will reset the current regen.
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
just like gr_block::general_work, only this arranges to call consume_each for you ...
Definition: regenerate_bb_impl.h:31
unsigned int max_regen() const
return the maximum regeneration count.
Definition: regenerate_bb_impl.h:46
int period() const
return the regeneration period.
Definition: regenerate_bb_impl.h:47
Detect the peak of a signal and repeat every period samplesIf a peak is detected, this block outputs ...
Definition: regenerate_bb.h:43