GNU Radio 3.6.4 C++ API
|
synchronous 1:1 input to output with historyOverride work to provide the signal processing implementation. More...
#include <gr_sync_block.h>
Public Member Functions | |
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 | |
int | fixed_rate_ninput_to_noutput (int ninput) |
Given ninput samples, return number of output samples that will be produced. N.B. this is only defined if fixed_rate returns true. Generally speaking, you don't need to override this. | |
int | fixed_rate_noutput_to_ninput (int noutput) |
Given noutput samples, return number of input samples required to produce noutput. N.B. this is only defined if fixed_rate returns true. Generally speaking, you don't need to override this. | |
![]() | |
virtual | ~gr_block () |
unsigned | history () const |
void | set_history (unsigned history) |
bool | fixed_rate () const |
Return true if this block has a fixed input to output rate. | |
virtual bool | start () |
Called to enable drivers, etc for i/o devices. | |
virtual bool | stop () |
Called to disable drivers, etc for i/o devices. | |
void | set_output_multiple (int multiple) |
Constrain the noutput_items argument passed to forecast and general_work. | |
int | output_multiple () const |
bool | output_multiple_set () const |
void | set_alignment (int multiple) |
Constrains buffers to work on a set item alignment (for SIMD) | |
int | alignment () const |
void | set_unaligned (int na) |
int | unaligned () const |
void | set_is_unaligned (bool u) |
bool | is_unaligned () const |
void | consume (int which_input, int how_many_items) |
Tell the scheduler how_many_items of input stream which_input were consumed. | |
void | consume_each (int how_many_items) |
Tell the scheduler how_many_items were consumed on each input stream. | |
void | produce (int which_output, int how_many_items) |
Tell the scheduler how_many_items were produced on output stream which_output . | |
void | set_relative_rate (double relative_rate) |
Set the approximate output rate / input rate. | |
double | relative_rate () const |
return the approximate output rate / input rate | |
uint64_t | nitems_read (unsigned int which_input) |
Return the number of items read on input stream which_input. | |
uint64_t | nitems_written (unsigned int which_output) |
Return the number of items written on output stream which_output. | |
tag_propagation_policy_t | tag_propagation_policy () |
Asks for the policy used by the scheduler to moved tags downstream. | |
void | set_tag_propagation_policy (tag_propagation_policy_t p) |
Set the policy by the scheduler to determine how tags are moved downstream. | |
int | min_noutput_items () const |
Return the minimum number of output items this block can produce during a call to work. | |
void | set_min_noutput_items (int m) |
Set the minimum number of output items this block can produce during a call to work. | |
int | max_noutput_items () |
Return the maximum number of output items this block will handle during a call to work. | |
void | set_max_noutput_items (int m) |
Set the maximum number of output items this block will handle during a call to work. | |
void | unset_max_noutput_items () |
Clear the switch for using the max_noutput_items value of this block. | |
bool | is_set_max_noutput_items () |
Ask the block if the flag is or is not set to use the internal value of max_noutput_items during a call to work. | |
void | expand_minmax_buffer (int port) |
long | max_output_buffer (size_t i) |
Returns max buffer size on output port i . | |
void | set_max_output_buffer (long max_output_buffer) |
Sets max buffer size on all output ports. | |
void | set_max_output_buffer (int port, long max_output_buffer) |
Sets max buffer size on output port port . | |
long | min_output_buffer (size_t i) |
Returns min buffer size on output port i . | |
void | set_min_output_buffer (long min_output_buffer) |
Sets min buffer size on all output ports. | |
void | set_min_output_buffer (int port, long min_output_buffer) |
Sets min buffer size on output port port . | |
float | pc_noutput_items () |
Gets average noutput_items performance counter. | |
float | pc_noutput_items_var () |
Gets variance of noutput_items performance counter. | |
float | pc_nproduced () |
Gets average num items produced performance counter. | |
float | pc_nproduced_var () |
Gets variance of num items produced performance counter. | |
float | pc_input_buffers_full (int which) |
Gets average fullness of which input buffer. | |
float | pc_input_buffers_full_var (int which) |
Gets variance of fullness of which input buffer. | |
std::vector< float > | pc_input_buffers_full () |
Gets average fullness of all input buffers. | |
std::vector< float > | pc_input_buffers_full_var () |
Gets variance of fullness of all input buffers. | |
float | pc_output_buffers_full (int which) |
Gets average fullness of which input buffer. | |
float | pc_output_buffers_full_var (int which) |
Gets variance of fullness of which input buffer. | |
std::vector< float > | pc_output_buffers_full () |
Gets average fullness of all output buffers. | |
std::vector< float > | pc_output_buffers_full_var () |
Gets variance of fullness of all output buffers. | |
float | pc_work_time () |
Gets average clock cycles spent in work. | |
float | pc_work_time_var () |
Gets average clock cycles spent in work. | |
void | reset_perf_counters () |
Resets the performance counters. | |
void | set_processor_affinity (const std::vector< unsigned int > &mask) |
Set the thread's affinity to processor core n . | |
void | unset_processor_affinity () |
Remove processor affinity to a specific core. | |
std::vector< unsigned int > | processor_affinity () |
Get the current processor affinity. | |
gr_block_detail_sptr | detail () const |
void | set_detail (gr_block_detail_sptr detail) |
![]() | |
virtual | ~gr_basic_block () |
long | unique_id () const |
long | symbolic_id () const |
std::string | name () const |
std::string | symbol_name () const |
gr_io_signature_sptr | input_signature () const |
gr_io_signature_sptr | output_signature () const |
gr_basic_block_sptr | to_basic_block () |
bool | alias_set () |
std::string | alias () |
pmt::pmt_t | alias_pmt () |
void | set_block_alias (std::string name) |
void | message_port_register_in (pmt::pmt_t port_id) |
void | message_port_register_out (pmt::pmt_t port_id) |
void | message_port_pub (pmt::pmt_t port_id, pmt::pmt_t msg) |
void | message_port_sub (pmt::pmt_t port_id, pmt::pmt_t target) |
void | message_port_unsub (pmt::pmt_t port_id, pmt::pmt_t target) |
virtual bool | message_port_is_hier (pmt::pmt_t port_id) |
virtual bool | message_port_is_hier_in (pmt::pmt_t port_id) |
virtual bool | message_port_is_hier_out (pmt::pmt_t port_id) |
pmt::pmt_t | message_ports_in () |
Get input message port names. | |
pmt::pmt_t | message_ports_out () |
Get output message port names. | |
void | _post (pmt::pmt_t which_port, pmt::pmt_t msg) |
bool | empty_p (pmt::pmt_t which_port) |
is the queue empty? | |
bool | empty_p () |
void | insert_tail (pmt::pmt_t which_port, pmt::pmt_t msg) |
pmt::pmt_t | delete_head_nowait (pmt::pmt_t which_port) |
pmt::pmt_t | delete_head_blocking (pmt::pmt_t which_port) |
msg_queue_t::iterator | get_iterator (pmt::pmt_t which_port) |
void | erase_msg (pmt::pmt_t which_port, msg_queue_t::iterator it) |
virtual bool | has_msg_port (pmt::pmt_t which_port) |
virtual bool | check_topology (int ninputs, int noutputs) |
Confirm that ninputs and noutputs is an acceptable combination. | |
template<typename T > | |
void | set_msg_handler (pmt::pmt_t which_port, T msg_handler) |
Set the callback that is fired when messages are available. | |
![]() | |
gr_msg_accepter () | |
~gr_msg_accepter () | |
void | post (pmt::pmt_t which_port, pmt::pmt_t msg) |
send msg to msg_accepter on port which_port | |
![]() | |
msg_accepter () | |
virtual | ~msg_accepter () |
Protected Member Functions | |
gr_sync_block (void) | |
gr_sync_block (const std::string &name, gr_io_signature_sptr input_signature, gr_io_signature_sptr output_signature) | |
![]() | |
gr_block (void) | |
gr_block (const std::string &name, gr_io_signature_sptr input_signature, gr_io_signature_sptr output_signature) | |
void | set_fixed_rate (bool fixed_rate) |
void | add_item_tag (unsigned int which_output, uint64_t abs_offset, const pmt::pmt_t &key, const pmt::pmt_t &value, const pmt::pmt_t &srcid=pmt::PMT_F) |
Adds a new tag onto the given output buffer. | |
void | add_item_tag (unsigned int which_output, const gr_tag_t &tag) |
Adds a new tag onto the given output buffer. | |
void | remove_item_tag (unsigned int which_input, uint64_t abs_offset, const pmt::pmt_t &key, const pmt::pmt_t &value, const pmt::pmt_t &srcid=pmt::PMT_F) |
Removes a tag from the given input buffer. | |
void | remove_item_tag (unsigned int which_input, const gr_tag_t &tag) |
Removes a tag from the given input buffer. | |
void | get_tags_in_range (std::vector< gr_tag_t > &v, unsigned int which_input, uint64_t abs_start, uint64_t abs_end) |
Given a [start,end), returns a vector of all tags in the range. | |
void | get_tags_in_range (std::vector< gr_tag_t > &v, unsigned int which_input, uint64_t abs_start, uint64_t abs_end, const pmt::pmt_t &key) |
Given a [start,end), returns a vector of all tags in the range with a given key. | |
![]() | |
gr_basic_block (void) | |
gr_basic_block (const std::string &name, gr_io_signature_sptr input_signature, gr_io_signature_sptr output_signature) | |
Protected constructor prevents instantiation by non-derived classes. | |
void | set_input_signature (gr_io_signature_sptr iosig) |
may only be called during constructor | |
void | set_output_signature (gr_io_signature_sptr iosig) |
may only be called during constructor | |
void | set_color (vcolor color) |
Allow the flowgraph to set for sorting and partitioning. | |
vcolor | color () const |
virtual void | dispatch_msg (pmt::pmt_t which_port, pmt::pmt_t msg) |
Additional Inherited Members | |
![]() | |
enum | { WORK_CALLED_PRODUCE = -2, WORK_DONE = -1 } |
Magic return values from general_work. More... | |
enum | tag_propagation_policy_t { TPP_DONT = 0, TPP_ALL_TO_ALL = 1, TPP_ONE_TO_ONE = 2 } |
![]() | |
enum | vcolor { WHITE, GREY, BLACK } |
![]() | |
std::vector< long > | d_max_output_buffer |
std::vector< long > | d_min_output_buffer |
gruel::mutex | d_setlock |
synchronous 1:1 input to output with history
Override work to provide the signal processing implementation.
|
inlineprotected |
|
protected |
|
virtual |
Given ninput samples, return number of output samples that will be produced. N.B. this is only defined if fixed_rate returns true. Generally speaking, you don't need to override this.
Reimplemented from gr_block.
Reimplemented in gr_sync_interpolator, and gr_sync_decimator.
|
virtual |
Given noutput samples, return number of input samples required to produce noutput. N.B. this is only defined if fixed_rate returns true. Generally speaking, you don't need to override this.
Reimplemented from gr_block.
Reimplemented in gr_sync_interpolator, and gr_sync_decimator.
|
virtual |
Estimate input requirements given output request.
noutput_items | number of output items to produce |
ninput_items_required | number of input items required on each input stream |
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_interpolator, gr_sync_decimator, atsc_equalizer, atsc_field_sync_mux, and atsc_pad.
|
virtual |
compute output items from input items
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 |
general_work must call consume or consume_each to indicate how many items were consumed on each input stream.
Reimplemented from gr_block.
Reimplemented in gr_sync_interpolator, and gr_sync_decimator.
|
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 digital_fll_band_edge_cc, vocoder_cvsd_encode_sb, vocoder_cvsd_decode_bs, gr_complex_to_arg, gr_pfb_decimator_ccf, gr_pfb_synthesizer_ccf, gr_complex_to_mag_squared, gr_wavfile_sink, gr_pfb_interpolator_ccf, digital_ofdm_frame_sink, gr_complex_to_mag, digital_packet_sink, gr_ofdm_frame_sink2, digital_costas_loop_cc, gr_dc_blocker_ff, gr_udp_sink, gr_dc_blocker_cc, gr_udp_source, gr_framer_sink_1, gr_peak_detector2_fb, digital_framer_sink_1, gr_complex_to_imag, gr_packet_sink, qtgui_time_sink_c, gr_iir_filter_ffd, gr_bin_statistics_f, qtgui_time_sink_f, gr_check_lfsr_32k_s, digital_mpsk_snr_est_cc, gr::blocks::file_meta_sink_impl, digital_probe_mpsk_snr_est_c, gr_fake_channel_decoder_pp, video_sdl_sink_s, video_sdl_sink_uc, comedi_source_s, comedi_sink_s, gr_fft_filter_ccc, gr_fft_filter_fff, gr_single_pole_iir_filter_cc, gr_check_counting_s, audio_alsa_source, gr_single_pole_iir_filter_ff, gr_complex_to_real, digital_ofdm_mapper_bcv, audio_portaudio_sink, gr::blocks::file_meta_source_impl, tag_source_demo, gr_file_source, audio_alsa_sink, audio_osx_source, audio_portaudio_source, digital_correlate_access_code_tag_bb, gr::filter::pfb_synthesizer_ccf_impl, gr_correlate_access_code_tag_bb, gr_vector_map, audio_jack_sink, audio_jack_source, digital_correlate_access_code_bb, gr_decode_ccsds_27_fb, gr_wavfile_source, noaa_hrpt_decoder, gr_regenerate_bb, gr_vco_f, digital_glfsr_source_b, digital_glfsr_source_f, digital_probe_density_b, gr_probe_density_b, gr_tagged_stream_to_pdu, gr::analog::pll_carriertracking_cc_impl, audio_windows_sink, digital_additive_scrambler_bb, gr::filter::dc_blocker_cc_impl, gr::filter::dc_blocker_ff_impl, audio_osx_sink, gr_message_burst_source, gr_tagged_file_sink, gr_fft_vfc, digital_pn_correlator_cc, gr_char_to_float, gr_complex_to_float, gr_float_to_char, gr_float_to_int, gr_int_to_float, gr_short_to_float, gr_message_source, gr_additive_scrambler_bb, gr_float_to_short, gr_file_descriptor_source, gr_probe_avg_mag_sqrd_cf, gr::analog::pll_freqdet_cf_impl, gr_fft_vcc_fftw, gr::analog::pll_refout_cc_impl, gr_probe_avg_mag_sqrd_c, gr_probe_avg_mag_sqrd_f, gr_filter_delay_fc, gr_burst_tagger, gr_cpfsk_bc, gr_encode_ccsds_27_bb, gr_histo_sink_f, gr_glfsr_source_b, gr_glfsr_source_f, gr_pa_2x2_phase_combiner, gr_message_sink, gr_adaptive_fir_ccc, gr_pdu_to_tagged_stream, atsc_fpll, digital_bytes_to_syms, digital_descrambler_bb, digital_map_bb, digital_scrambler_bb, gr_bytes_to_syms, gr::blocks::peak_detector2_fb_impl, trellis_permutation, gr_descrambler_bb, gr_lfsr_32k_source_s, gr_pn_correlator_cc, gr_scrambler_bb, gr_stretch_ff, gr_oscope_sink_f, atsc_equalizer, gr_adaptive_fir_ccf, gr_annotator_alltoall, gr_fake_channel_encoder_pp, gr_frequency_modulator_fc, gr_multiply_const_cc, gr_multiply_const_ff, gr_threshold_ff, gr::analog::fmdet_cf_impl, digital_diff_phasor_cc, gr_hilbert_fc, gr_annotator_1to1, gr_dpll_bb, gr_simple_squelch_cc, gr_file_descriptor_sink, gr_file_sink, gr::filter::adaptive_fir_ccc_impl, gr::filter::adaptive_fir_ccf_impl, gr::filter::fft_filter_ccc_impl, gr::filter::fft_filter_fff_impl, wavelet_squash_ff_impl, gr_goertzel_fc, gr_char_to_short, gr_feedforward_agc_cc, gr_rail_ff, gr_repeat, gr_rms_cf, gr_rms_ff, gr_short_to_char, gr::analog::probe_avg_mag_sqrd_c_impl, gr::analog::probe_avg_mag_sqrd_cf_impl, gr::analog::probe_avg_mag_sqrd_f_impl, audio_oss_source, audio_windows_source, gr::blocks::file_source_impl, digital_diff_encoder_bb, gr::fft::fft_vcc_fftw, gr_agc2_cc, gr_endian_swap, gr_kludge_copy, gr_multiply_conjugate_cc, gr_pack_k_bits_bb, gr_phase_modulator_fc, gr_quadrature_demod_cf, gr_stream_to_streams, gr_streams_to_stream, gr_unpack_k_bits_bb, gr::analog::simple_squelch_cc_impl, atsc_randomizer, digital_diff_decoder_bb, digital_ofdm_cyclic_prefixer, gr::fft::fft_vfc_fftw, gr::fft::goertzel_fc_impl, vocoder_alaw_decode_bs, vocoder_ulaw_decode_bs, gr_add_ff, gr_agc_cc, gr_agc_ff, gr_annotator_raw, gr_iqcomp_cc, gr_multiply_cc, gr_multiply_ff, gr_nlog10_ff, gr::analog::dpll_bb_impl, audio_oss_sink, pager_flex_deinterleave, pager_slicer_fb, vocoder_alaw_encode_sb, vocoder_ulaw_encode_sb, wavelet_wavelet_ff_impl, gr_agc2_ff, gr_deinterleave, gr_diff_encoder_bb, gr_float_to_complex, gr_head, gr_interleave, gr_stream_to_vector, gr_streams_to_vector, gr_vector_to_stream, gr_vector_to_streams, gr::analog::rail_ff_impl, atsc_deinterleaver, atsc_derandomizer, atsc_fs_checker, atsc_rs_decoder, atsc_rs_encoder, atsc_trellis_encoder, atsc_viterbi_decoder, gr::blocks::regenerate_bb_impl, gr::blocks::threshold_ff_impl, vocoder_gsm_fr_encode_sp, gr_diff_decoder_bb, gr_diff_phasor_cc, gr_stream_pdu_base, atsc_field_sync_mux, atsc_interleaver, atsc_pad, digital_binary_slicer_fb, gr::filter::filter_delay_fc_impl, gr::filter::iir_filter_ffd_impl, gr_complex_to_interleaved_short, gr_conjugate_cc, gr_interleaved_short_to_complex, gr_map_bb, gr_null_sink, gr::analog::phase_modulator_fc_impl, atsc_ds_to_softds, gr::blocks::rms_cf_impl, gr::blocks::rms_ff_impl, gr::filter::single_pole_iir_filter_cc_impl, noaa_hrpt_pll_cf, vocoder_gsm_fr_decode_ps, gr_float_to_uchar, gr_null_source, gr_uchar_to_float, gr::analog::cpfsk_bc_impl, atsc_depad, gr::blocks::throttle_impl, gr::filter::single_pole_iir_filter_ff_impl, vocoder_codec2_decode_ps, vocoder_codec2_encode_sp, gr::blocks::stretch_ff_impl, gr::analog::frequency_modulator_fc_impl, gr::blocks::multiply_const_cc_impl, gr::blocks::multiply_const_ff_impl, gr::filter::hilbert_fc_impl, tag_sink_demo, gr::analog::quadrature_demod_cf_impl, gr::blocks::transcendental_impl, gr::blocks::char_to_float_impl, gr::blocks::float_to_char_impl, gr::blocks::float_to_int_impl, gr::blocks::float_to_short_impl, gr::blocks::int_to_float_impl, gr::blocks::short_to_float_impl, gr::analog::feedforward_agc_cc_impl, gr::blocks::deinterleave_impl, gr::blocks::interleave_impl, gr::blocks::nlog10_ff_impl, gr::blocks::repeat_impl, wavelet_wvps_ff_impl, gr::blocks::add_ff_impl, gr::blocks::char_to_short_impl, gr::blocks::complex_to_arg_impl, gr::blocks::complex_to_float_impl, gr::blocks::complex_to_imag_impl, gr::blocks::complex_to_mag_impl, gr::blocks::complex_to_mag_squared_impl, gr::blocks::complex_to_real_impl, gr::blocks::float_to_complex_impl, gr::blocks::multiply_cc_impl, gr::blocks::multiply_conjugate_cc_impl, gr::blocks::multiply_ff_impl, gr::blocks::short_to_char_impl, gr::blocks::complex_to_interleaved_short_impl, gr::blocks::conjugate_cc_impl, gr::blocks::float_to_uchar_impl, gr::blocks::interleaved_short_to_complex_impl, gr::blocks::stream_to_streams_impl, gr::blocks::stream_to_vector_impl, gr::blocks::streams_to_stream_impl, gr::blocks::streams_to_vector_impl, gr::blocks::uchar_to_float_impl, gr::blocks::vector_to_stream_impl, and gr::blocks::vector_to_streams_impl.