Hi all:
I want to know something about the forecast().
I have already known that forcast() can tell scheduler how many input items are required for each output item.
1.But now i have read two example:
The first one:
void your_block::forecast(int noutput_items,gr_vector_int &ninput_items_required){
ninput_items_required[0]=100 * noutput_items;
ninput_items_required[1]=100 * noutput_items; }
I have already understand it.
But the second one:
void forecast (int noutput_items, gr_vector_int &ninput_items_required)
{
unsigned ninputs = ninput_items_required.size ();
for (unsigned i = 0; i < ninputs; i++)
ninput_items_required[i] = 1;}
I can't understand since we can't know how many input items we required,why use ninput_items_required.size ().Can someone help me?
2.I want to know if we use the general_work().Is it means that we must use the forcast()?Thanks.
Best regards