delete obsolete blocks
This commit is contained in:
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Bastian Bloessl <bloessl@ccs-labs.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "@NAME_IMPL@.h"
|
||||
#include <gnuradio/io_signature.h>
|
||||
|
||||
namespace gr {
|
||||
namespace ieee802_11 {
|
||||
|
||||
@NAME_IMPL@::@NAME_IMPL@(int length) :
|
||||
sync_block("@NAME@",
|
||||
io_signature::make(1, 1, sizeof(@I_TYPE@)),
|
||||
io_signature::make(1, 1, sizeof(@O_TYPE@))),
|
||||
d_length(length),
|
||||
d_new_length(length),
|
||||
d_updated(false) {
|
||||
set_history(length);
|
||||
}
|
||||
|
||||
void
|
||||
@NAME_IMPL@::set_length(int length) {
|
||||
d_new_length = length;
|
||||
d_updated = true;
|
||||
}
|
||||
|
||||
int
|
||||
@NAME_IMPL@::work(int noutput_items, gr_vector_const_void_star
|
||||
&input_items, gr_vector_void_star &output_items) {
|
||||
|
||||
if(d_updated) {
|
||||
d_length = d_new_length;
|
||||
set_history(d_length);
|
||||
d_updated = false;
|
||||
return 0; // history requirements might have changed
|
||||
}
|
||||
|
||||
const @I_TYPE@ *in = (const @I_TYPE@ *)input_items[0];
|
||||
@O_TYPE@ *out = (@O_TYPE@ *)output_items[0];
|
||||
|
||||
@I_TYPE@ sum = 0;
|
||||
for(int i = 0; i < d_length-1; i++) {
|
||||
sum += in[i];
|
||||
}
|
||||
|
||||
for(int i = 0; i < noutput_items; i++) {
|
||||
sum += in[i + d_length - 1];
|
||||
out[i] = sum;
|
||||
sum -= in[i];
|
||||
}
|
||||
|
||||
return noutput_items;
|
||||
}
|
||||
|
||||
@NAME@::sptr
|
||||
@NAME@::make(int length) {
|
||||
return gnuradio::get_initial_sptr(new @NAME_IMPL@(length));
|
||||
}
|
||||
|
||||
|
||||
} /* namespace blocks */
|
||||
} /* namespace gr */
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Bastian Bloessl <bloessl@ccs-labs.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef @GUARD_NAME_IMPL@
|
||||
#define @GUARD_NAME_IMPL@
|
||||
|
||||
#include <ieee802-11/@NAME@.h>
|
||||
|
||||
namespace gr {
|
||||
namespace ieee802_11 {
|
||||
|
||||
class @NAME_IMPL@ : public @NAME@
|
||||
{
|
||||
private:
|
||||
int d_length;
|
||||
int d_new_length;
|
||||
bool d_updated;
|
||||
|
||||
public:
|
||||
@NAME_IMPL@(int length);
|
||||
|
||||
int length() const { return d_new_length; }
|
||||
void set_length(int length);
|
||||
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
};
|
||||
|
||||
} /* namespace blocks */
|
||||
} /* namespace gr */
|
||||
|
||||
#endif /* @GUARD_NAME_IMPL@ */
|
||||
Reference in New Issue
Block a user