GNU Radio 2.x: gr_sync_block class Reference

Main Page | Modules | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members

# gr_sync_block Class Reference
[Signal Processing Blocks]

`#include <gr_sync_block.h>`

Inheritance diagram for gr_sync_block:

[legend]
Collaboration diagram for gr_sync_block:

[legend]
List of all members.

## Detailed Description

synchronous 1:1 input to output with history

Override work to provide the signal processing implementation.

## Public Member Functions
unsigned | history () const
void | set_history (unsigned history)
virtual int | work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)=0
| just like gr_block::general_work, only this arranges to call consume_each for you
void | forecast (int noutput_items, gr_vector_int &ninput_items_required)
| Estimate input requirements given output request.
int | general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
| compute output items from input items
## Protected Member Functions
| gr_sync_block (const std::string &name, gr_io_signature_sptr input_signature, gr_io_signature_sptr output_signature)

## Constructor & Destructor Documentation

gr_sync_block::gr_sync_block | ( | const std::string & | name,
|  | gr_io_signature_sptr | input_signature,
|  | gr_io_signature_sptr | output_signature
| ) | `[protected]`

## Member Function Documentation

void gr_sync_block::forecast | ( | int | noutput_items,
|  | gr_vector_int & | ninput_items_required
| ) | `[virtual]`

| 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 from gr_block. Reimplemented in gr_sync_decimator, and gr_sync_interpolator.

int gr_sync_block::general_work | ( | int | noutput_items,
|  | gr_vector_int & | ninput_items,
|  | gr_vector_const_void_star & | input_items,
|  | gr_vector_void_star & | output_items
| ) | `[virtual]`

  | 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. Implements gr_block. Reimplemented in gr_sync_decimator, and gr_sync_interpolator.

unsigned gr_sync_block::history | ( |  | ) | const`[inline]`

| Assume block computes y_i = f(x_i, x_i-1, x_i-2, x_i-3...) History is the number of x_i's that are examined to produce one y_i. This comes in handy for FIR filters, where we use history to ensure that our input contains the appropriate "history" for the filter. History should be equal to the number of filter taps.

void gr_sync_block::set_history | ( | unsigned | history | ) | `[inline]`

virtual int gr_sync_block::work | ( | int | noutput_items,
|  | gr_vector_const_void_star & | input_items,
|  | gr_vector_void_star & | output_items
| ) | `[pure virtual]`

| just like gr_block::general_work, only this arranges to call consume_each for you The user must override work to define the signal processing code Implemented in gr_fir_filter_ccc, gr_fir_filter_ccf, gr_fir_filter_fcc, gr_fir_filter_fff, gr_fir_filter_fsf, gr_fir_filter_scc, gr_freq_xlating_fir_filter_ccc, gr_freq_xlating_fir_filter_ccf, gr_freq_xlating_fir_filter_fcc, gr_freq_xlating_fir_filter_fcf, gr_freq_xlating_fir_filter_scc, gr_freq_xlating_fir_filter_scf, gr_hilbert_fc, gr_iir_filter_ffd, gr_interp_fir_filter_ccc, gr_interp_fir_filter_ccf, gr_interp_fir_filter_fcc, gr_interp_fir_filter_fff, gr_interp_fir_filter_fsf, gr_interp_fir_filter_scc, gr_add_cc, gr_add_const_cc, gr_add_const_ff, gr_add_const_ii, gr_add_const_sf, gr_add_const_ss, gr_add_ff, gr_add_ii, gr_add_ss, gr_bytes_to_syms, gr_check_counting_s, gr_check_lfsr_32k_s, gr_complex_to_float, gr_complex_to_real, gr_complex_to_imag, gr_complex_to_mag, gr_complex_to_arg, gr_divide_cc, gr_divide_ff, gr_divide_ii, gr_divide_ss, gr_fft_vcc, gr_fft_vfc, gr_float_to_complex, gr_float_to_short, gr_frequency_modulator_fc, gr_head, gr_lfsr_32k_source_s, gr_multiply_cc, gr_multiply_const_cc, gr_multiply_const_ff, gr_multiply_const_ii, gr_multiply_const_ss, gr_multiply_ff, gr_multiply_ii, gr_multiply_ss, gr_noise_source_c, gr_noise_source_f, gr_noise_source_i, gr_noise_source_s, gr_null_sink, gr_null_source, gr_quadrature_demod_cf, gr_serial_to_parallel, gr_short_to_float, gr_sig_source_c, gr_sig_source_f, gr_sig_source_i, gr_sig_source_s, gr_sub_cc, gr_sub_ff, gr_sub_ii, gr_sub_ss, gr_vector_sink_b, gr_vector_sink_c, gr_vector_sink_f, gr_vector_sink_i, gr_vector_sink_s, gr_vector_source_b, gr_vector_source_c, gr_vector_source_f, gr_vector_source_i, gr_vector_source_s, gr_file_descriptor_sink, gr_file_descriptor_source, gr_file_sink, gr_file_source, and gr_oscope_sink_f.

The documentation for this class was generated from the following files:

- gr_sync_block.h
- gr_sync_block.cc