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

change generators to IDL-based pipeline #14

Merged
merged 20 commits into from
Mar 12, 2019
Merged

change generators to IDL-based pipeline #14

merged 20 commits into from
Mar 12, 2019

Conversation

dirk-thomas
Copy link
Member

@dirk-thomas dirk-thomas commented Nov 21, 2018

Connected to ros2/rosidl#334.

@dirk-thomas dirk-thomas added the in progress Actively being worked on (Kanban column) label Nov 21, 2018
@dirk-thomas dirk-thomas self-assigned this Nov 21, 2018
@dirk-thomas dirk-thomas added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Nov 26, 2018
@dirk-thomas dirk-thomas changed the title update includes and type mapping update includes and type mapping, update C and C++ ts to use idl-based pipeline Nov 30, 2018
@[ else]@
if (!@(field.type.pkg_name)__msg__@(field.type.type)__callbacks->cdr_serialize(
&ros_message->@(field.name), cdr))
if (!callbacks->cdr_serialize(
Copy link
Contributor

Choose a reason for hiding this comment

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

what if member.type is a WString instance?

Copy link
Member Author

Choose a reason for hiding this comment

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

WString is not yet supported throughout all generators.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does that mean that member.type won't ever be a WString instance? If so, disregard my comment. Otherwise an informative error would be nice.

cdr.serializeArray(array_ptr, size);
@[ else]@
for (size_t i = 0; i < size; ++i) {
if (!@(field.type.pkg_name)__msg__@(field.type.type)__callbacks->cdr_serialize(
if (!callbacks->cdr_serialize(
Copy link
Contributor

Choose a reason for hiding this comment

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

what if member.type.basetype is a WString instance?

Copy link
Contributor

Choose a reason for hiding this comment

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

Still applies, it'll try to use callbacks which will be undefined.

(void)array_ptr;
size_t item_size = sizeof(array_ptr[0]);
current_alignment += array_size * item_size +
eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
@[ else]
for (size_t index = 0; index < array_size; ++index) {
current_alignment += get_serialized_size_@(field.type.pkg_name)__msg__@(field.type.type)(
current_alignment += get_serialized_size_@('__'.join(member.type.basetype.namespaces + [member.type.basetype.name]))(
Copy link
Contributor

Choose a reason for hiding this comment

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

what if member.type.basetype is a WString instance?

current_alignment += item_size +
eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
}
@[ else]
current_alignment += get_serialized_size_@(field.type.pkg_name)__msg__@(field.type.type)(
&(ros_message->@(field.name)), current_alignment);
current_alignment += get_serialized_size_@('__'.join(member.type.namespaces + [member.type.name]))(
Copy link
Contributor

Choose a reason for hiding this comment

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

what if member.type is a WString instance?

if isinstance(type_, NestedType):
type_ = type_.basetype
}@
@[ if isinstance(type_, String)]@
Copy link
Contributor

Choose a reason for hiding this comment

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

same question about WString

"${_srv_include_dir}"
"${_action_include_dir}"
)
# TODO(sloretz) parent_folder/dds_fastrtps in template instead of here
Copy link
Contributor

Choose a reason for hiding this comment

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

should we do something about this TODO? do we have to?

Copy link
Member Author

Choose a reason for hiding this comment

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

@sloretz Can you clarify what this is about?

Copy link
Contributor

Choose a reason for hiding this comment

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

@dirk-thomas I don't remember. If I had to guess, I'd assume this was to make the template includes look like #include <msg/dds_fastrtps/something.hpp> instead of adding msg/dds_fastrtps to the target's include directories. If that's what this means, then I have no idea which template or includes this is talking about.

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 removed the comment in ef4fe78.

}
@[ end if]@
}
@[ else]@
@[ if field.type.type == 'string']@
@[ if isinstance(member.type, String)]@
Copy link
Contributor

Choose a reason for hiding this comment

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

same questions about WString (maybe use an assert?)

if isinstance(type_, NestedType):
type_ = type_.basetype
}@
@[ if isinstance(type_, String)]@
Copy link
Contributor

Choose a reason for hiding this comment

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

same question about WString

@dirk-thomas dirk-thomas mentioned this pull request Feb 12, 2019
8 tasks
@dirk-thomas dirk-thomas added in progress Actively being worked on (Kanban column) and removed in review Waiting for review (Kanban column) labels Feb 15, 2019
@dirk-thomas dirk-thomas changed the title update includes and type mapping, update C and C++ ts to use idl-based pipeline change generators to IDL-based pipeline Feb 19, 2019
@dirk-thomas dirk-thomas added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Feb 21, 2019
@dirk-thomas dirk-thomas requested a review from hidmic February 21, 2019 23:21
Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

LGTM overall, but I'm a bit wary about WString as it's handled in some places but not all.

I understand that we're not looking forward to support it in the near term, but then IMHO an explanatory error message sounds better than an obscure C++ compilation error coming from generated code. Just my 2 cents.

@dirk-thomas dirk-thomas merged commit 7313c57 into master Mar 12, 2019
@dirk-thomas dirk-thomas deleted the idl-stage-7 branch March 12, 2019 04:12
@dirk-thomas dirk-thomas removed the in review Waiting for review (Kanban column) label Mar 12, 2019
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