gr::tagged_stream_block
gr::block
gr::blocks::repack_bits_bb
gr::blocks::tagged_stream_mux
gr::blocks::tsb_vector_sink< T >
gr::digital::crc32_bb
gr::digital::ofdm_carrier_allocator_cvc
gr::digital::ofdm_cyclic_prefixer
gr::digital::ofdm_frame_equalizer_vcvc
gr::digital::ofdm_serializer_vcc
gr::digital::packet_headergenerator_bb
gr::digital::protocol_formatter_bb
gr::fec::tagged_decoder
gr::fec::tagged_encoder
gr::pdu::pdu_to_tagged_stream
gr::pdu::tagged_stream_to_pdu
gnuradio/tagged_stream_block.h
pmt::pmt_t pmt::pmt_t gr::tagged_stream_block::d_length_tag_key d_length_tag_key gr::tagged_stream_block::d_length_tag_key

This is the key for the tag that stores the PDU length.

gr_vector_int gr_vector_int gr::tagged_stream_block::d_n_input_items_reqd d_n_input_items_reqd gr::tagged_stream_block::d_n_input_items_reqd

How many input items do I need to process the next PDU?

std::string std::string gr::tagged_stream_block::d_length_tag_key_str d_length_tag_key_str gr::tagged_stream_block::d_length_tag_key_str
gr::tagged_stream_block::tagged_stream_block
(void)
tagged_stream_block
gr::tagged_stream_block::tagged_stream_block
void
gr::tagged_stream_block::tagged_stream_block
(const std::string &name, gr::io_signature::sptr input_signature, gr::io_signature::sptr output_signature, const std::string &length_tag_key)
tagged_stream_block
gr::tagged_stream_block::tagged_stream_block
const std::string & name
gr::io_signature::sptr input_signature
gr::io_signature::sptr output_signature
const std::string & length_tag_key
void virtual void gr::tagged_stream_block::parse_length_tags (const std::vector< std::vector< tag_t > > &tags, gr_vector_int &n_input_items_reqd) parse_length_tags gr::tagged_stream_block::parse_length_tags const std::vector< std::vector< tag_t > > & tags gr_vector_int & n_input_items_reqd

Parse all tags on the first sample of a PDU, return the number of items per input and prune the length tags.

In most cases, you don't need to override this, unless the number of items read is not directly coded in one single tag.

Default behaviour:

- Go through all input ports

- On every input port, search for the tag with the key specified in `length_tag_key`

- Copy that value as an int to the corresponding position in `n_input_items_reqd`

- Remove the length tag.

tags

All the tags found on the first item of every input port.

n_input_items_reqd

Number of items which will be read from every input

int virtual int gr::tagged_stream_block::calculate_output_stream_length (const gr_vector_int &ninput_items) calculate_output_stream_length gr::tagged_stream_block::calculate_output_stream_length calculate_output_stream_length calculate_output_stream_length const gr_vector_int & ninput_items

Calculate the number of output items.

This is basically the inverse function to forecast(): Given a number of input items, it returns the maximum number of output items.

You most likely need to override this function, unless your block is a sync block or integer interpolator/decimator.

void virtual void gr::tagged_stream_block::update_length_tags (int n_produced, int n_ports) update_length_tags gr::tagged_stream_block::update_length_tags int n_produced int n_ports

Set the new length tags on the output stream.

Default behaviour: Set a tag with key `length_tag_key` and the number of produced items on every output port.

For anything else, override this.

n_produced

Length of the new PDU

n_ports

Number of output ports

void void gr::tagged_stream_block::forecast (int noutput_items, gr_vector_int &ninput_items_required) override forecast gr::tagged_stream_block::forecast forecast int noutput_items gr_vector_int & ninput_items_required

Don't override this.

bool bool gr::tagged_stream_block::check_topology (int ninputs, int) override check_topology gr::tagged_stream_block::check_topology check_topology int ninputs int noutputs

Confirm that ninputs and noutputs is an acceptable combination.

ninputs

number of input streams connected

noutputs

number of output streams connected

true if this is a valid configuration for this block.

This function is called by the runtime system whenever the topology changes. Most classes do not need to override this. This check is in addition to the constraints specified by the input and output gr::io_signatures.
int int gr::tagged_stream_block::general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override general_work gr::tagged_stream_block::general_work general_work int noutput_items gr_vector_int & ninput_items gr_vector_const_void_star & input_items gr_vector_void_star & output_items

- Reads the number of input items from the tags using parse_length_tags()

- Checks there's enough data on the input and output buffers

- If not, inform the scheduler and do nothing

- Calls work() with the exact number of items per PDU

- Updates the tags using update_length_tags()

int virtual int gr::tagged_stream_block::work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)=0 work gr::tagged_stream_block::work work work int noutput_items gr_vector_int & ninput_items gr_vector_const_void_star & input_items gr_vector_void_star & output_items

Just like gr::block::general_work, but makes sure the input is valid.

The user must override work to define the signal processing code. Check the documentation for general_work() to see what happens here.

Like gr::sync_block, this calls consume() for you (it consumes ninput_items[i] items from the i-th port).

A note on tag propagation: The PDU length tags are handled by other functions, but all other tags are handled just as in any other `gr::block`. So, most likely, you either set the tag propagation policy to TPP_DONT and handle the tag propagation manually, or you propagate tags through the scheduler and don't do anything here.

noutput_items

The size of the writable output buffer

ninput_items

The exact size of the items on every input for this particular PDU. These will be consumed if a length tag key is provided!

input_items

See gr::block

output_items

See gr::block

Block that operates on PDUs in form of tagged streams.

Override work to provide the signal processing implementation.

gr::basic_block
gr::block
gr::blocks::repack_bits_bb
gr::blocks::tagged_stream_mux
gr::blocks::tsb_vector_sink< T >
gr::digital::crc32_bb
gr::digital::ofdm_carrier_allocator_cvc
gr::digital::ofdm_cyclic_prefixer
gr::digital::ofdm_frame_equalizer_vcvc
gr::digital::ofdm_serializer_vcc
gr::digital::packet_headergenerator_bb
gr::digital::protocol_formatter_bb
gr::fec::tagged_decoder
gr::fec::tagged_encoder
gr::messages::msg_accepter
gr::msg_accepter
gr::pdu::pdu_to_tagged_stream
gr::pdu::tagged_stream_to_pdu
gr::tagged_stream_block
std::enable_shared_from_this< basic_block >
T
gr::basic_block
d_name
d_symbol_alias
d_symbol_name
d_input_signature
d_output_signature
d_debug_logger
d_logger
msg_queue
d_rpc_vars
d_message_subscribers
gr::block
d_max_output_buffer
d_min_output_buffer
d_pmt_done
d_system_port
gr::io_signature
gr::messages::msg_accepter
gr::msg_accepter
gr::tagged_stream_block
d_length_tag_key_str
std::basic_string< Char >
std::deque< T >
elements
std::enable_shared_from_this< basic_block >
std::map< pmt::pmt_t, msg_queue_t, msg_queue_comparator >
keys
elements
std::shared_ptr< T >
ptr
std::shared_ptr< io_signature >
ptr
std::shared_ptr< logger >
std::shared_ptr< pmt_base >
std::string
std::vector< long >
std::vector< rpcbasic_sptr >
elements
p
- gr::tagged_stream_block
  _post
- gr::tagged_stream_block
  active_thread_priority
- gr::tagged_stream_block
  add_item_tag
- gr::tagged_stream_block
  add_item_tag
- gr::tagged_stream_block
  alias
- gr::tagged_stream_block
  alias_pmt
- gr::tagged_stream_block
  alias_set
- gr::tagged_stream_block
  alignment
- gr::tagged_stream_block
  allocate_buffer
- gr::tagged_stream_block
  allocate_detail
- gr::tagged_stream_block
  basic_block
- gr::tagged_stream_block
  basic_block
- gr::tagged_stream_block
  BLACK
- gr::tagged_stream_block
  blkd_input_timer_value
- gr::tagged_stream_block
  block
- gr::tagged_stream_block
  block
- gr::tagged_stream_block
  calculate_output_stream_length
- gr::tagged_stream_block
  check_topology
- gr::tagged_stream_block
  clear_finished
- gr::tagged_stream_block
  color
- gr::tagged_stream_block
  consume
- gr::tagged_stream_block
  consume_each
- gr::tagged_stream_block
  d_blkd_input_timer_value
- gr::tagged_stream_block
  d_color
- gr::tagged_stream_block
  d_debug_logger
- gr::tagged_stream_block
  d_input_signature
- gr::tagged_stream_block
  d_length_tag_key
- gr::tagged_stream_block
  d_length_tag_key_str
- gr::tagged_stream_block
  d_logger
- gr::tagged_stream_block
  d_max_output_buffer
- gr::tagged_stream_block
  d_message_subscribers
- gr::tagged_stream_block
  d_min_output_buffer
- gr::tagged_stream_block
  d_n_input_items_reqd
- gr::tagged_stream_block
  d_name
- gr::tagged_stream_block
  d_output_signature
- gr::tagged_stream_block
  d_pmt_done
- gr::tagged_stream_block
  d_rpc_set
- gr::tagged_stream_block
  d_rpc_vars
- gr::tagged_stream_block
  d_setlock
- gr::tagged_stream_block
  d_symbol_alias
- gr::tagged_stream_block
  d_symbol_name
- gr::tagged_stream_block
  d_symbolic_id
- gr::tagged_stream_block
  d_system_port
- gr::tagged_stream_block
  d_unique_id
- gr::tagged_stream_block
  declare_sample_delay
- gr::tagged_stream_block
  declare_sample_delay
- gr::tagged_stream_block
  delete_head_nowait
- gr::tagged_stream_block
  detail
- gr::tagged_stream_block
  dispatch_msg
- gr::tagged_stream_block
  empty_handled_p
- gr::tagged_stream_block
  empty_handled_p
- gr::tagged_stream_block
  empty_p
- gr::tagged_stream_block
  empty_p
- gr::tagged_stream_block
  enable_update_rate
- gr::tagged_stream_block
  erase_msg
- gr::tagged_stream_block
  expand_minmax_buffer
- gr::tagged_stream_block
  finished
- gr::tagged_stream_block
  fixed_rate
- gr::tagged_stream_block
  fixed_rate_ninput_to_noutput
- gr::tagged_stream_block
  fixed_rate_noutput_to_ninput
- gr::tagged_stream_block
  forecast
- gr::tagged_stream_block
  general_work
- gr::tagged_stream_block
  get_iterator
- gr::tagged_stream_block
  get_msg_map
- gr::tagged_stream_block
  get_tags_in_range
- gr::tagged_stream_block
  get_tags_in_range
- gr::tagged_stream_block
  get_tags_in_window
- gr::tagged_stream_block
  get_tags_in_window
- gr::tagged_stream_block
  GREY
- gr::tagged_stream_block
  has_msg_handler
- gr::tagged_stream_block
  has_msg_port
- gr::tagged_stream_block
  history
- gr::tagged_stream_block
  identifier
- gr::tagged_stream_block
  input_signature
- gr::tagged_stream_block
  insert_tail
- gr::tagged_stream_block
  is_pc_rpc_set
- gr::tagged_stream_block
  is_rpc_set
- gr::tagged_stream_block
  is_set_max_noutput_items
- gr::tagged_stream_block
  is_unaligned
- gr::tagged_stream_block
  log_level
- gr::tagged_stream_block
  max_noutput_items
- gr::tagged_stream_block
  max_output_buffer
- gr::tagged_stream_block
  message_port_is_hier
- gr::tagged_stream_block
  message_port_is_hier_in
- gr::tagged_stream_block
  message_port_is_hier_out
- gr::tagged_stream_block
  message_port_pub
- gr::tagged_stream_block
  message_port_register_in
- gr::tagged_stream_block
  message_port_register_out
- gr::tagged_stream_block
  message_port_sub
- gr::tagged_stream_block
  message_port_unsub
- gr::tagged_stream_block
  message_ports_in
- gr::tagged_stream_block
  message_ports_out
- gr::tagged_stream_block
  message_subscribers
- gr::tagged_stream_block
  min_noutput_items
- gr::tagged_stream_block
  min_output_buffer
- gr::tagged_stream_block
  mp_relative_rate
- gr::tagged_stream_block
  msg_accepter
- gr::tagged_stream_block
  msg_queue
- gr::tagged_stream_block
  name
- gr::tagged_stream_block
  nitems_read
- gr::tagged_stream_block
  nitems_written
- gr::tagged_stream_block
  nmsgs
- gr::tagged_stream_block
  no_pc_rpc
- gr::tagged_stream_block
  notify_msg_neighbors
- gr::tagged_stream_block
  output_multiple
- gr::tagged_stream_block
  output_multiple_set
- gr::tagged_stream_block
  output_signature
- gr::tagged_stream_block
  parse_length_tags
- gr::tagged_stream_block
  pc_input_buffers_full
- gr::tagged_stream_block
  pc_input_buffers_full
- gr::tagged_stream_block
  pc_input_buffers_full_avg
- gr::tagged_stream_block
  pc_input_buffers_full_avg
- gr::tagged_stream_block
  pc_input_buffers_full_var
- gr::tagged_stream_block
  pc_input_buffers_full_var
- gr::tagged_stream_block
  pc_noutput_items
- gr::tagged_stream_block
  pc_noutput_items_avg
- gr::tagged_stream_block
  pc_noutput_items_var
- gr::tagged_stream_block
  pc_nproduced
- gr::tagged_stream_block
  pc_nproduced_avg
- gr::tagged_stream_block
  pc_nproduced_var
- gr::tagged_stream_block
  pc_output_buffers_full
- gr::tagged_stream_block
  pc_output_buffers_full
- gr::tagged_stream_block
  pc_output_buffers_full_avg
- gr::tagged_stream_block
  pc_output_buffers_full_avg
- gr::tagged_stream_block
  pc_output_buffers_full_var
- gr::tagged_stream_block
  pc_output_buffers_full_var
- gr::tagged_stream_block
  pc_throughput_avg
- gr::tagged_stream_block
  pc_work_time
- gr::tagged_stream_block
  pc_work_time_avg
- gr::tagged_stream_block
  pc_work_time_total
- gr::tagged_stream_block
  pc_work_time_var
- gr::tagged_stream_block
  post
- gr::tagged_stream_block
  processor_affinity
- gr::tagged_stream_block
  produce
- gr::tagged_stream_block
  relative_rate
- gr::tagged_stream_block
  relative_rate_d
- gr::tagged_stream_block
  relative_rate_i
- gr::tagged_stream_block
  remove_item_tag
- gr::tagged_stream_block
  remove_item_tag
- gr::tagged_stream_block
  replace_buffer
- gr::tagged_stream_block
  reset_perf_counters
- gr::tagged_stream_block
  rpc_set
- gr::tagged_stream_block
  sample_delay
- gr::tagged_stream_block
  set_alignment
- gr::tagged_stream_block
  set_blkd_input_timer_value
- gr::tagged_stream_block
  set_block_alias
- gr::tagged_stream_block
  set_color
- gr::tagged_stream_block
  set_detail
- gr::tagged_stream_block
  set_fixed_rate
- gr::tagged_stream_block
  set_history
- gr::tagged_stream_block
  set_input_signature
- gr::tagged_stream_block
  set_inverse_relative_rate
- gr::tagged_stream_block
  set_is_unaligned
- gr::tagged_stream_block
  set_log_level
- gr::tagged_stream_block
  set_max_noutput_items
- gr::tagged_stream_block
  set_max_output_buffer
- gr::tagged_stream_block
  set_max_output_buffer
- gr::tagged_stream_block
  set_min_noutput_items
- gr::tagged_stream_block
  set_min_output_buffer
- gr::tagged_stream_block
  set_min_output_buffer
- gr::tagged_stream_block
  set_msg_handler
- gr::tagged_stream_block
  set_output_multiple
- gr::tagged_stream_block
  set_output_signature
- gr::tagged_stream_block
  set_processor_affinity
- gr::tagged_stream_block
  set_relative_rate
- gr::tagged_stream_block
  set_relative_rate
- gr::tagged_stream_block
  set_tag_propagation_policy
- gr::tagged_stream_block
  set_thread_priority
- gr::tagged_stream_block
  set_unaligned
- gr::tagged_stream_block
  setup_pc_rpc
- gr::tagged_stream_block
  setup_rpc
- gr::tagged_stream_block
  shared_from_base
- gr::tagged_stream_block
  start
- gr::tagged_stream_block
  stop
- gr::tagged_stream_block
  symbol_name
- gr::tagged_stream_block
  symbolic_id
- gr::tagged_stream_block
  system_handler
- gr::tagged_stream_block
  tag_propagation_policy
- gr::tagged_stream_block
  tag_propagation_policy_t
- gr::tagged_stream_block
  tagged_stream_block
- gr::tagged_stream_block
  tagged_stream_block
- gr::tagged_stream_block
  thread_priority
- gr::tagged_stream_block
  to_basic_block
- gr::tagged_stream_block
  TPP_ALL_TO_ALL
- gr::tagged_stream_block
  TPP_CUSTOM
- gr::tagged_stream_block
  TPP_DONT
- gr::tagged_stream_block
  TPP_ONE_TO_ONE
- gr::tagged_stream_block
  unaligned
- gr::tagged_stream_block
  unique_id
- gr::tagged_stream_block
  unset_max_noutput_items
- gr::tagged_stream_block
  unset_processor_affinity
- gr::tagged_stream_block
  update_length_tags
- gr::tagged_stream_block
  update_rate
- gr::tagged_stream_block
  vcolor
- gr::tagged_stream_block
  WHITE
- gr::tagged_stream_block
  work
- gr::tagged_stream_block
  WORK_CALLED_PRODUCE
- gr::tagged_stream_block
  WORK_DONE
- gr::tagged_stream_block
  work_return_t
- gr::tagged_stream_block
  ~basic_block
- gr::tagged_stream_block
  ~block
- gr::tagged_stream_block
  ~msg_accepter