GNU Radio 3.6.4.2 C++ API
gr_sync_block Struct Reference

#include <gr_sync_block.h>

Inheritance diagram for gr_sync_block:
gr_block comedi_sink_s comedi_source_s gr::blocks::add_ff gr::blocks::char_to_float gr::blocks::char_to_short gr::blocks::complex_to_arg gr::blocks::complex_to_float gr::blocks::complex_to_imag gr::blocks::complex_to_mag gr::blocks::complex_to_mag_squared gr::blocks::complex_to_real gr::blocks::conjugate_cc gr::blocks::file_meta_sink gr::blocks::file_meta_source gr::blocks::file_source gr::blocks::float_to_char gr::blocks::float_to_complex gr::blocks::float_to_int gr::blocks::float_to_short gr::blocks::float_to_uchar gr::blocks::int_to_float gr::blocks::multiply_cc gr::blocks::multiply_conjugate_cc gr::blocks::multiply_const_cc gr::blocks::multiply_const_ff gr::blocks::multiply_ff gr::blocks::nlog10_ff gr::blocks::peak_detector2_fb gr::blocks::regenerate_bb gr::blocks::rms_cf gr::blocks::rms_ff gr::blocks::short_to_char gr::blocks::short_to_float gr::blocks::streams_to_vector gr::blocks::stretch_ff gr::blocks::threshold_ff gr::blocks::throttle gr::blocks::transcendental gr::blocks::uchar_to_float gr::blocks::vector_to_streams gr::fft::fft_vcc gr::fft::fft_vfc gr::filter::dc_blocker_cc gr::filter::dc_blocker_ff gr::filter::filter_delay_fc gr::filter::hilbert_fc gr::filter::iir_filter_ffd gr::filter::pfb_decimator_ccf gr::filter::single_pole_iir_filter_cc gr::filter::single_pole_iir_filter_ff gr_add_cc gr_add_const_bb gr_add_const_cc gr_add_const_ff gr_add_const_ii gr_add_const_sf gr_add_const_ss gr_add_const_vcc gr_add_const_vff gr_add_const_vii gr_add_const_vss gr_add_ff gr_add_ii gr_add_ss gr_additive_scrambler_bb gr_agc2_cc gr_agc2_ff gr_agc_cc gr_agc_ff gr_annotator_1to1 gr_annotator_alltoall gr_annotator_raw gr_bin_statistics_f gr_burst_tagger gr_char_to_float gr_char_to_short gr_check_counting_s gr_check_lfsr_32k_s gr_complex_to_arg gr_complex_to_float gr_complex_to_imag gr_complex_to_mag gr_complex_to_mag_squared gr_complex_to_real gr_conjugate_cc gr_correlate_access_code_tag_bb gr_dc_blocker_cc gr_dc_blocker_ff gr_descrambler_bb gr_diff_decoder_bb gr_diff_encoder_bb gr_diff_phasor_cc gr_divide_cc gr_divide_ff gr_divide_ii gr_divide_ss gr_dpll_bb gr_endian_swap gr_fake_channel_decoder_pp gr_fake_channel_encoder_pp gr_fastnoise_source_c gr_fastnoise_source_f gr_fastnoise_source_i gr_fastnoise_source_s gr_feedforward_agc_cc gr_fft_vcc gr_fft_vfc gr_file_descriptor_sink gr_file_descriptor_source gr_file_sink gr_file_source gr_filter_delay_fc gr_float_to_char gr_float_to_complex gr_float_to_int gr_float_to_short gr_float_to_uchar gr_fmdet_cf gr_framer_sink_1 gr_frequency_modulator_fc gr_glfsr_source_b gr_glfsr_source_f gr_head gr_hilbert_fc gr_histo_sink_f gr_iir_filter_ffd gr_int_to_float gr_iqcomp_cc gr_kludge_copy gr_lfsr_32k_source_s gr_map_bb gr_message_burst_source gr_message_sink gr_message_source gr_multiply_cc gr_multiply_conjugate_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_mute_cc gr_mute_ff gr_mute_ii gr_mute_ss gr_nlog10_ff gr_noise_source_c gr_noise_source_f gr_noise_source_i gr_noise_source_s gr_null_sink gr_null_source gr_ofdm_frame_sink2 gr_oscope_sink_x gr_pa_2x2_phase_combiner gr_packet_sink gr_pdu_to_tagged_stream gr_peak_detector2_fb gr_pfb_decimator_ccf gr_phase_modulator_fc gr_pll_carriertracking_cc gr_pll_freqdet_cf gr_pll_refout_cc gr_probe_avg_mag_sqrd_c gr_probe_avg_mag_sqrd_cf gr_probe_avg_mag_sqrd_f gr_probe_density_b gr_probe_signal_b gr_probe_signal_c gr_probe_signal_f gr_probe_signal_i gr_probe_signal_s gr_probe_signal_vb gr_probe_signal_vc gr_probe_signal_vf gr_probe_signal_vi gr_probe_signal_vs gr_quadrature_demod_cf gr_rail_ff gr_regenerate_bb gr_rms_cf gr_rms_ff gr_scrambler_bb gr_short_to_char gr_short_to_float gr_sig_source_c gr_sig_source_f gr_sig_source_i gr_sig_source_s gr_simple_squelch_cc gr_single_pole_iir_filter_cc gr_single_pole_iir_filter_ff gr_stream_pdu_base gr_streams_to_vector gr_stretch_ff gr_sub_cc gr_sub_ff gr_sub_ii gr_sub_ss gr_sync_decimator gr_sync_interpolator gr_tagged_file_sink gr_tagged_stream_to_pdu gr_threshold_ff gr_throttle gr_transcendental gr_uchar_to_float gr_udp_sink gr_udp_source gr_vco_f gr_vector_map 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_vector_to_streams gr_wavfile_sink gr_wavfile_source qtgui_time_sink_c qtgui_time_sink_f

Public 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)
 
virtual ~gr_sync_block (void)
 
int general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 implements work -> calls work More...
 
virtual int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 just like gr_block::general_work, only this arranges to call consume_each for you More...
 
- Public Member Functions inherited from gr_block
 gr_block (void)
 
 gr_block (const std::string &name, gr_io_signature_sptr input_signature, gr_io_signature_sptr output_signature)
 
long unique_id (void) const
 
std::string name (void) const
 
virtual ~gr_block (void)
 
gr_io_signature_sptr input_signature (void) const
 
gr_io_signature_sptr output_signature (void) const
 
void set_input_signature (gr_io_signature_sptr sig)
 
void set_output_signature (gr_io_signature_sptr sig)
 
virtual bool check_topology (int ninputs, int noutputs)
 
virtual void forecast (int, std::vector< int > &)
 Overload me! I am the forecast. More...
 
virtual bool start (void)
 
virtual bool stop (void)
 
void consume_each (const int how_many_items)
 Call during work to consume items. More...
 
void consume (const size_t i, const int how_many_items)
 
void produce (const size_t o, const int how_many_items)
 
uint64_t nitems_read (const size_t which_input=0)
 Get absolute count of all items consumed on the given input port. More...
 
uint64_t nitems_written (const size_t which_output=0)
 Get absolute count of all items produced on the given output port. More...
 
void add_item_tag (const size_t which_output, const gr_tag_t &tag)
 
void add_item_tag (const size_t which_output, uint64_t abs_offset, const pmt::pmt_t &key, const pmt::pmt_t &value, const pmt::pmt_t &srcid=pmt::PMT_F)
 
void get_tags_in_range (std::vector< gr_tag_t > &tags, const size_t which_input, uint64_t abs_start, uint64_t abs_end, const pmt::pmt_t &key=pmt::pmt_t())
 
void set_alignment (const size_t alignment)
 
bool is_unaligned (void)
 
size_t fixed_rate_noutput_to_ninput (const size_t noutput_items)
 
size_t interpolation (void) const
 
void set_interpolation (const size_t)
 
size_t decimation (void) const
 
void set_decimation (const size_t)
 
int max_noutput_items (void) const
 
void set_max_noutput_items (int)
 
void unset_max_noutput_items (void)
 
bool is_set_max_noutput_items (void) const
 
unsigned history (void) const
 
void set_history (unsigned history)
 
void set_fixed_rate (const bool fixed_rate)
 
bool fixed_rate (void) const
 Get the fixed rate setting. More...
 
void set_relative_rate (const double relative_rate)
 
double relative_rate (void) const
 Get the relative rate setting. More...
 
void set_output_multiple (const size_t multiple)
 
size_t output_multiple (void) const
 Get the output multiple setting. More...
 
tag_propagation_policy_t tag_propagation_policy (void)
 
void set_tag_propagation_policy (tag_propagation_policy_t p)
 
void set_max_output_buffer (long)
 
void set_max_output_buffer (int, long)
 
long max_output_buffer (size_t)
 
void set_min_output_buffer (long)
 
void set_min_output_buffer (int, long)
 
long min_output_buffer (size_t)
 
std::string symbol_name () const
 
bool alias_set ()
 
std::string alias ()
 
pmt::pmt_t alias_pmt ()
 
void set_block_alias (std::string name)
 
template<typename T >
void set_msg_handler (pmt::pmt_t which_port, T msg_handler)
 
void message_port_register_in (pmt::pmt_t)
 
void message_port_register_out (pmt::pmt_t)
 
void message_port_pub (pmt::pmt_t, pmt::pmt_t)
 
void message_port_sub (pmt::pmt_t, pmt::pmt_t)
 
void message_port_unsub (pmt::pmt_t, pmt::pmt_t)
 
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. More...
 
pmt::pmt_t message_ports_out ()
 Get output message port names. More...
 
bool empty_p (pmt::pmt_t which_port)
 is the queue empty? More...
 
bool empty_p ()
 
void insert_tail (pmt::pmt_t, pmt::pmt_t)
 
pmt::pmt_t delete_head_nowait (pmt::pmt_t)
 
pmt::pmt_t delete_head_blocking (pmt::pmt_t)
 
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)
 
bool has_msg_handler (pmt::pmt_t which_port)
 Tests if there is a handler attached to port which_port. More...
 
virtual void dispatch_msg (pmt::pmt_t which_port, pmt::pmt_t msg)
 
void set_processor_affinity (const std::vector< int > &mask)
 Set the thread's affinity to processor core n. More...
 
void unset_processor_affinity ()
 Remove processor affinity to a specific core. More...
 
std::vector< int > processor_affinity ()
 Get the current processor affinity. More...
 
void work (const InputItems &, const OutputItems &)
 implements work -> calls general work More...
 
void notify_topology (const size_t, const size_t)
 notifications of new topological commits More...
 
void notify_active (void)
 start notification More...
 
void notify_inactive (void)
 stop notification More...
 
virtual void propagate_tags (const size_t, const gras::TagIter &)
 implements tag_propagation_policy() More...
 
void _update_input_reserve (void)
 
gras::BufferQueueSptr input_buffer_allocator (const size_t, const gras::SBufferConfig &)
 
gras::BufferQueueSptr output_buffer_allocator (const size_t, const gras::SBufferConfig &)
 

Additional Inherited Members

- Public Types inherited from gr_block
enum  { WORK_CALLED_PRODUCE = -2, WORK_DONE = -1 }
 Return options for the work call. More...
 
enum  tag_propagation_policy_t { TPP_DONT = 0, TPP_ALL_TO_ALL = 1, TPP_ONE_TO_ONE = 2 }
 
typedef std::deque< pmt::pmt_tmsg_queue_t
 
typedef std::map< pmt::pmt_t,
msg_queue_t,
pmt::pmt_comperator
msg_queue_map_t
 
typedef std::map< pmt::pmt_t,
msg_queue_t,
pmt::pmt_comperator >
::iterator 
msg_queue_map_itr
 
typedef boost::function< void(pmt::pmt_t)> msg_handler_t
 
typedef std::map< pmt::pmt_t,
msg_handler_t,
pmt::pmt_comperator
d_msg_handlers_t
 
- Public Attributes inherited from gr_block
long _unique_id
 
std::string _name
 
std::string d_symbol_alias
 
std::string d_symbol_name
 
msg_queue_map_t msg_queue
 
pmt::pmt_t message_subscribers
 
d_msg_handlers_t d_msg_handlers
 
gruel::mutex d_setlock
 
std::vector< int > d_affinity
 
gr_vector_int _work_ninput_items
 
gr_vector_int _fcast_ninput_items
 
size_t _num_outputs
 
ptrdiff_t _work_io_ptr_mask
 
size_t _output_multiple_items
 
double _relative_rate
 
bool _enable_fixed_rate
 
size_t _input_history_items
 
tag_propagation_policy_t _tag_prop_policy
 
size_t _interp
 
size_t _decim
 
gr_io_signature_sptr _in_sig
 
gr_io_signature_sptr _out_sig
 

Constructor & Destructor Documentation

gr_sync_block::gr_sync_block ( void  )
gr_sync_block::gr_sync_block ( const std::string &  name,
gr_io_signature_sptr  input_signature,
gr_io_signature_sptr  output_signature 
)
virtual gr_sync_block::~gr_sync_block ( void  )
virtual

Member Function Documentation

GRAS_FORCE_INLINE 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

implements work -> calls work

Reimplemented from gr_block.

References gr_block::consume_each(), gr_block::decimation(), gr_block::interpolation(), and work().

virtual int gr_sync_block::work ( int  noutput_items,
gr_vector_const_void_star &  input_items,
gr_vector_void_star &  output_items 
)
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

Reimplemented in gr_complex_to_arg, gr_pfb_decimator_ccf, gr_pfb_synthesizer_ccf, gr_complex_to_mag_squared, gr_wavfile_sink, gr_pfb_interpolator_ccf, gr_complex_to_mag, gr_ofdm_frame_sink2, gr_dc_blocker_ff, gr_udp_sink, gr_dc_blocker_cc, gr_udp_source, gr_framer_sink_1, gr_peak_detector2_fb, 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, gr::blocks::file_meta_sink_impl, gr_fake_channel_decoder_pp, comedi_source_s, comedi_sink_s, gr_fft_filter_ccc, gr_fft_filter_fff, gr_single_pole_iir_filter_cc, gr_check_counting_s, gr_single_pole_iir_filter_ff, gr_complex_to_real, gr::blocks::file_meta_source_impl, gr_fastnoise_source_c, gr_fastnoise_source_f, gr_fastnoise_source_i, gr_fastnoise_source_s, gr_file_source, gr::filter::pfb_synthesizer_ccf_impl, gr_noise_source_c, gr_noise_source_f, gr_noise_source_i, gr_noise_source_s, gr_correlate_access_code_tag_bb, gr_vector_map, gr_decode_ccsds_27_fb, gr_wavfile_source, 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_regenerate_bb, gr_vco_f, gr_probe_density_b, gr_tagged_stream_to_pdu, gr::filter::dc_blocker_cc_impl, gr::filter::dc_blocker_ff_impl, gr_message_burst_source, gr_tagged_file_sink, gr_fft_vfc, 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_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_fir_filter_ccc, gr_fir_filter_ccf, gr_fir_filter_fcc, gr_fir_filter_fff, gr_fir_filter_fsf, gr_fir_filter_scc, gr_additive_scrambler_bb, gr_float_to_short, gr_file_descriptor_source, gr_probe_avg_mag_sqrd_cf, gr_fft_vcc_fftw, 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_sig_source_c, gr_sig_source_f, gr_sig_source_i, gr_sig_source_s, gr_adaptive_fir_ccc, gr_pdu_to_tagged_stream, gr::filter::pfb_decimator_ccf_impl, gr_bytes_to_syms, gr::blocks::peak_detector2_fb_impl, gr_descrambler_bb, gr_lfsr_32k_source_s, gr_pn_correlator_cc, gr_scrambler_bb, gr_stretch_ff, gr_oscope_sink_f, 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_probe_signal_vb, gr_probe_signal_vc, gr_probe_signal_vf, gr_probe_signal_vi, gr_probe_signal_vs, 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, gr::filter::pfb_interpolator_ccf_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::blocks::file_source_impl, gr::fft::fft_vcc_fftw, gr_add_cc, gr_add_ii, gr_add_ss, gr_divide_cc, gr_divide_ff, gr_divide_ii, gr_divide_ss, gr_multiply_ii, gr_multiply_ss, gr_sub_cc, gr_sub_ff, gr_sub_ii, gr_sub_ss, gr_vector_source_b, gr_vector_source_c, gr_vector_source_f, gr_vector_source_i, gr_vector_source_s, 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::fft::fft_vfc_fftw, gr::fft::goertzel_fc_impl, gr_add_const_bb, gr_add_const_cc, gr_add_const_ff, gr_add_const_ii, gr_add_const_sf, gr_add_const_ss, gr_add_const_vcc, gr_add_const_vff, gr_add_const_vii, gr_add_const_vss, gr_multiply_const_ii, gr_multiply_const_ss, gr_mute_cc, gr_mute_ff, gr_mute_ii, gr_mute_ss, 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_probe_signal_b, gr_probe_signal_c, gr_probe_signal_f, gr_probe_signal_i, gr_probe_signal_s, gr_vector_sink_b, gr_vector_sink_c, gr_vector_sink_f, gr_vector_sink_i, gr_vector_sink_s, 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::blocks::regenerate_bb_impl, gr::blocks::threshold_ff_impl, gr_diff_decoder_bb, gr_diff_phasor_cc, gr_stream_pdu_base, 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::blocks::rms_cf_impl, gr::blocks::rms_ff_impl, gr::blocks::throttle_impl, gr::filter::single_pole_iir_filter_cc_impl, gr_float_to_uchar, gr_null_source, gr_uchar_to_float, gr::filter::single_pole_iir_filter_ff_impl, gr::blocks::stretch_ff_impl, gr::blocks::multiply_const_cc_impl, gr::blocks::multiply_const_ff_impl, gr::filter::hilbert_fc_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::blocks::deinterleave_impl, gr::blocks::interleave_impl, gr::blocks::nlog10_ff_impl, gr::blocks::repeat_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.

Referenced by general_work().


The documentation for this struct was generated from the following file: