Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for returning array / std::vector in EVerest interfaces #79

Merged
merged 4 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ev-dev-tools/src/ev_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""EVerest command line utility."""
__version__ = '0.0.23'
__version__ = '0.0.24'
2 changes: 2 additions & 0 deletions ev-dev-tools/src/ev_cli/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def primitive_to_sample_value(type):
return '"everest"'
elif type == 'object':
return '{}'
elif type == 'array':
return '{}'
else:
raise Exception(f'This json type "{type}" is not known or not implemented')

Expand Down
2 changes: 2 additions & 0 deletions ev-dev-tools/src/ev_cli/templates/interface-Exports.hpp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public:
{% elif 'object_type' in cmd.result %}
json retval_json = result.value();
{{ result_type(cmd.result) }} retval = retval_json;
{% elif 'array_type' in cmd.result %}
{{ result_type(cmd.result) }} retval (result.value().begin(), result.value().end());
{% else %}
auto retval = {{ var_to_cpp(cmd.result) }}(result.value());
{% endif %}
Expand Down