diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2016-01-28 09:40:47 +0100 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2016-02-03 09:40:28 -0800 |
commit | 86b4f7f14b22c29c1eae69994ea2f71d6731740b (patch) | |
tree | 2d931147c8cbe3b4d4d5309569b0a3c9e516e129 /gnuradio-runtime/lib/hier_block2_detail.h | |
parent | 9a37b65a7b8ba2728dccf161703d3a6a53faed9a (diff) |
gnuradio-runtime/hier_block2: Allow changing of IO sig in the constructor
Fixes #719
The issue is that the hier_block2 detail creates some vectors for the
in/out ports to hold where to connect them to during the flatten and
what the min/max output buffer size are.
But subclasses are allowed to change the io signature in their constructor
so before actually using those vectors, we recheck if we should update
their size.
If there is a new io signature with more port, they're initialized to
default values (i.e. not connected). And if the new signature has less
ports, we just drop the connection (which is fine since it's all in the
subclass constructor, before they've been used for anything).
In both cases, just using .resize() on the vector is enough.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'gnuradio-runtime/lib/hier_block2_detail.h')
-rw-r--r-- | gnuradio-runtime/lib/hier_block2_detail.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gnuradio-runtime/lib/hier_block2_detail.h b/gnuradio-runtime/lib/hier_block2_detail.h index 8c38c3754a..a5584fe92a 100644 --- a/gnuradio-runtime/lib/hier_block2_detail.h +++ b/gnuradio-runtime/lib/hier_block2_detail.h @@ -71,6 +71,7 @@ namespace gr { endpoint_vector_t d_outputs; // Single internal endpoint per external output basic_block_vector_t d_blocks; + void refresh_io_signature(); void connect_input(int my_port, int port, basic_block_sptr block); void connect_output(int my_port, int port, basic_block_sptr block); void disconnect_input(int my_port, int port, basic_block_sptr block); |