#include <gr_block.h>
Inheritance diagram for gr_block:
[legend]Collaboration diagram for gr_block:
[legend]List of all members.
Detailed Description
The abstract base class for all signal processing blocks.
Blocks have a set of input streams and output streams. The input_signature and output_signature define the number of input streams and output streams respectively, and the type of the data items in each stream.
Although blocks may consume data on each input stream at a different rate, all outputs streams must produce data at the same rate. That rate may be different from any of the input rates.
User derived blocks override two methods, forecast and general_work, to implement their signal processing behavior. forecast is called by the system scheduler to determine how many items are required on each input stream in order to produce a given number of output items.
general_work is called to perform the signal processing in the block. It reads the input items and writes the output items.
Constructor & Destructor Documentation
Member Function Documentation
void gr_block::consume |
( |
int |
which_input, |
|
|
int |
how_many_items |
|
) |
|
|
|
Tell the scheduler how_many_items of input stream which_input were consumed.
|
void gr_block::consume_each |
( |
int |
how_many_items |
) |
|
|
|
Tell the scheduler how_many_items were consumed on each input stream.
|
|
Estimate input requirements given output request.
Given a request to product noutput_items, estimate the number of data items required on each input stream. The estimate doesn't have to be exact, but should be close.
Reimplemented in gr_sync_block, gr_sync_decimator, and gr_sync_interpolator. |
|
compute output items from input items
- Parameters:
-
noutput_items | number of output items to write on each output stream |
ninput_items | number of input items available on each input stream |
input_items | vector of pointers to the input items, one entry per input stream |
output_items | vector of pointers to the output items, one entry per output stream |
- Returns:
- number of items actually written to each output stream, or -1 on EOF. It is OK to return a value less than noutput_items. -1 <= return value <= noutput_items
general_work must call consume or consume_each to indicate how many items were consumed on each input stream.
Implemented in gr_nop, gr_sync_block, gr_sync_decimator, and gr_sync_interpolator. |
std::string gr_block::name |
( |
|
) |
const [inline] |
|
int gr_block::output_multiple |
( |
|
) |
const [inline] |
|
double gr_block::relative_rate |
( |
|
) |
const [inline] |
|
|
return the approximate output rate / input rate
|
void gr_block::set_output_multiple |
( |
int |
multiple |
) |
|
|
|
Constrain the noutput_items argument passed to forecast and general_work.
set_output_multiple causes the scheduler to ensure that the noutput_items argument passed to forecast and general_work will be an integer multiple of - Parameters:
-
multiple | The default value of output multiple is 1. |
|
void gr_block::set_relative_rate |
( |
double |
relative_rate |
) |
|
|
long gr_block::unique_id |
( |
|
) |
const [inline] |
|
The documentation for this class was generated from the following files:
Generated on Mon Jul 12 15:02:05 2004 for GNU Radio 2.x by
1.3.3