diff options
author | Terry May <terrydmay@gmail.com> | 2019-09-09 19:45:41 -0400 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2020-02-18 22:04:15 -0800 |
commit | 64ee803068269fe3b9563fd415c420fb513a1c9b (patch) | |
tree | d27e9b5560b5bb4377f964e39772cd1395a7bff0 /gr-blocks | |
parent | 012870af22ae873b3b998691de8e81752179d266 (diff) |
grc: Fix C++ code generation
- Added support for C++ std::map<> from python dict
- Fixed default initialization of parameters in main()
- Added missing include for realtime scheduling
- Added default CMake option for std=c++11 as this is required for
gnuradio >= 3.8
- Fixed mako template to add initialization to parameter declarations in
main()
- Fixed C++ constructor initialization list generation
- Fixed parameter type determination when an lvalue is used in an rvalue
expression
- Improved determining type of C++ variables
- Added C++ support for gr_complex parameters
- Fixed C++ generation of nested container types
- Added C++ support for virtual source/sink
- Moved cmake CMAKE_CXX_STANDARD 11 option from options.yml to
CMakeLists.txt.mako
- Fixed qtqui_sink to allow multiple instances
- Revised virtual connection processing in cpp_top_block.py
Reviewed-By: HÃ¥kon Vagsether <hauk142@gmail.com>
Diffstat (limited to 'gr-blocks')
-rw-r--r-- | gr-blocks/grc/blocks_socket_pdu.block.yml | 2 | ||||
-rw-r--r-- | gr-blocks/grc/blocks_wavfile_sink.block.yml | 6 | ||||
-rw-r--r-- | gr-blocks/grc/blocks_wavfile_source.block.yml | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/gr-blocks/grc/blocks_socket_pdu.block.yml b/gr-blocks/grc/blocks_socket_pdu.block.yml index 13d4d3b7a4..74108accb5 100644 --- a/gr-blocks/grc/blocks_socket_pdu.block.yml +++ b/gr-blocks/grc/blocks_socket_pdu.block.yml @@ -45,7 +45,7 @@ templates: cpp_templates: includes: ['#include <gnuradio/blocks/socket_pdu.h>'] declarations: 'blocks::socket_pdu::sptr ${id};' - make: 'this->${id} = blocks::socket_pdu::make(${type}, ${host}, ${port}, ${mtu}, ${tcp_no_delay});' + make: 'this->${id} = blocks::socket_pdu::make("${type}", ${host}, ${port}, ${mtu}, ${tcp_no_delay});' translations: 'True': 'true' 'False': 'false' diff --git a/gr-blocks/grc/blocks_wavfile_sink.block.yml b/gr-blocks/grc/blocks_wavfile_sink.block.yml index 20d956faaf..5139a17244 100644 --- a/gr-blocks/grc/blocks_wavfile_sink.block.yml +++ b/gr-blocks/grc/blocks_wavfile_sink.block.yml @@ -37,8 +37,10 @@ templates: cpp_templates: includes: ['#include <gnuradio/blocks/wavfile_sink.h>'] declarations: 'blocks::wavfile_sink::sptr ${id};' - make: 'this->${id} = blocks::wavfile_sink::make(${file}, ${nchan}, ${samp_rate}, ${bits_per_sample});' + make: |- + this->${id} = blocks::wavfile_sink::make(${file}${'.c_str()' if str(file)[0] != "'" and str(file)[0] != "\"" else ''}, ${nchan}, ${samp_rate}, ${bits_per_sample}); callbacks: - - open(${file}) + ## TODO Handle std::string type when const char* argument is needed + - this->${id}->open(${file}) file_format: 1 diff --git a/gr-blocks/grc/blocks_wavfile_source.block.yml b/gr-blocks/grc/blocks_wavfile_source.block.yml index 387bef3afb..04db7b87db 100644 --- a/gr-blocks/grc/blocks_wavfile_source.block.yml +++ b/gr-blocks/grc/blocks_wavfile_source.block.yml @@ -33,7 +33,8 @@ templates: cpp_templates: includes: ['#include <gnuradio/blocks/wavfile_source.h>'] declarations: 'blocks::wavfile_source::sptr ${id};' - make: 'this->${id} = blocks::wavfile_source::make(${file}, ${repeat});' + make: |- + this->${id} = blocks::wavfile_source::make(${file}${'.c_str()' if str(file)[0] != "'" and str(file)[0] != "\"" else ''}, ${repeat}); translations: 'True': 'true' 'False': 'false' |