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

added get_type_name and to_string to ParameterVariant #42

Merged
merged 1 commit into from
Jun 19, 2015

Conversation

wjwwood
Copy link
Member

@wjwwood wjwwood commented Jun 18, 2015

This was done to enable more concise parameter examples.

I'm open to suggestion on a more elegant way to do the bytes to_string within a switch statement.

Connects to ros2/examples#4

@wjwwood wjwwood added the in progress Actively being worked on (Kanban column) label Jun 18, 2015
switch (get_type()) {
case rclcpp::parameter::ParameterType::PARAMETER_BOOL:
return "bool";
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These break statements are unreachable and should be removed.

Same below.

@esteve
Copy link
Member

esteve commented Jun 18, 2015

+1

@wjwwood wjwwood force-pushed the refactor_examples_and_interfaces branch from c7e930a to f8d5f4a Compare June 18, 2015 18:51
@wjwwood
Copy link
Member Author

wjwwood commented Jun 18, 2015

Ok, I addressed the comments and squashed.

case rclcpp::parameter::ParameterType::PARAMETER_NOT_SET:
return "not set";
default:
throw std::runtime_error("Unexpected type from ParameterVariant");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the error string include the actual numeric value of get_type()?

Same below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that's very useful, but I'll include it.

@wjwwood wjwwood force-pushed the refactor_examples_and_interfaces branch from f8d5f4a to 40aa065 Compare June 18, 2015 18:56
this was done to enable a more concise example
@wjwwood wjwwood force-pushed the refactor_examples_and_interfaces branch from 40aa065 to e75c1d0 Compare June 18, 2015 18:57
@dirk-thomas
Copy link
Member

+1

wjwwood added a commit that referenced this pull request Jun 19, 2015
added get_type_name and to_string to ParameterVariant
@wjwwood wjwwood merged commit cab273c into master Jun 19, 2015
@wjwwood wjwwood removed the in progress Actively being worked on (Kanban column) label Jun 19, 2015
@wjwwood wjwwood deleted the refactor_examples_and_interfaces branch June 19, 2015 01:36
bool first_byte = true;
bytes << "[" << std::hex;
for (auto & byte : as_bytes())
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style error: 3a4f147

mauropasse pushed a commit to mauropasse/rclcpp that referenced this pull request Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants