Dear Sir,
Below code will produce compilation error: 'input_sizes' does not name a type.
This is because input_sizes must be assigned inside a context of a function in c++, right ?
My code (which produce error) is below.
[code]
/* -*- c++ -*- */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gr_io_signature.h>
#include <vector>
#include <complex>
#include "sample_and_hold_cc_impl.h"
namespace gr {
namespace howto {
sample_and_hold_cc::sptr
sample_and_hold_cc::make()
{
return gnuradio::get_initial_sptr
(new sample_and_hold_cc_impl());
}
/*
* The private constructor
*/
std::vector <int> xx;
xx.push_back(25);
xx.push_back( sizeof( float ) );
xx.push_back( sizeof( std::complex<float> ) );
sample_and_hold_cc_impl::sample_and_hold_cc_impl()
: gr_sync_block("sample_and_hold_cc",
gr_make_io_signature(<+MIN_IN+>, <+MAX_IN+>, sizeof(<+ITYPE+>)),
gr_make_io_signature(<+MIN_OUT+>, <+MAX_OUT+>, sizeof(<+OTYPE+>)))
{}
/*
* Our virtual destructor.
*/
sample_and_hold_cc_impl::~sample_and_hold_cc_impl()
{
}
int
sample_and_hold_cc_impl::work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const <+ITYPE+> *in = (const <+ITYPE+> *) input_items[0];
<+OTYPE+> *out = (<+OTYPE+> *) output_items[0];
// Do <+signal processing+>
// Tell runtime system how many output items we produced.
return noutput_items;
}
} /* namespace howto */
} /* namespace gr */
[/code]