id: blocks_max_xx
label: Max
flags: [ python, cpp ]

parameters:
-   id: type
    label: IO Type
    dtype: enum
    options: [float, int, short]
    option_attributes:
        fcn: [ff, ii, ss]
    hide: part
-   id: num_inputs
    label: Num Inputs
    dtype: int
    default: '1'
    hide: part
-   id: vlen
    label: Input Vector Length
    dtype: int
    default: '1'
    hide: ${ 'part' if vlen == 1 else 'none' }
-   id: vlen_out
    label: Output Vector Length
    dtype: int
    default: '1'
    hide: ${ 'part' if vlen == 1 else 'none' }

inputs:
-   domain: stream
    dtype: ${ type }
    vlen: ${ vlen }
    multiplicity: ${ num_inputs }

outputs:
-   domain: stream
    dtype: ${ type }
    vlen: ${ vlen_out }

asserts:
- ${ num_inputs >= 1 }
- ${ vlen >= 1 }

templates:
    imports: from gnuradio import blocks
    make: blocks.max_${type.fcn}(${vlen}, ${vlen_out})

cpp_templates:
    includes: ['#include <gnuradio/blocks/max_blk.h>']
    declarations: 'blocks::max_${type.fcn}::sptr ${id};'
    make: 'this->${id} = blocks::make_${type.fcn}::make(${vlen}, ${vlen_out});'

documentation: |-
    Compares vectors from multiple streams and determines the maximum value from each vector over all streams.
    Data is passed in as a vector of length from multiple input sources.

    If vlen_out == 1 then it will look through these streams of data items and the output stream will contain the maximum value in the vector.
    If vlen_out == vlen and not equal to 1 then output will be a vector with individual items selected from the maximum corresponding input vector items.

file_format: 1
