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

get encoding identifier #143

Merged
merged 4 commits into from
Jul 27, 2018
Merged
Changes from 1 commit
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
16 changes: 16 additions & 0 deletions rmw/include/rmw/rmw.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,22 @@ RMW_WARN_UNUSED
const char *
rmw_get_implementation_identifier(void);

/// Get the unique encoding identifier for this middleware.
/**
* The unique encoding identifier states in which encoding the
* serialized data has to be interpreted.
* One middleware can only have one encoding.
* In contrast to the implementation identifier, the encoding identifier can be
* equal between multiple RMW implementations. This means, that the same binary
Copy link
Member

Choose a reason for hiding this comment

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

New sentence, new line.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like this still needs to be addressed in a fixup.

* messages can be deserialized by RMW implementations with the same encoding ID.
* See also rmw_serialize, rmw_deserialize
Copy link
Member

Choose a reason for hiding this comment

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

Could use the doxygen \sa to reference them.

* \return encoding identifier
*/
RMW_PUBLIC
RMW_WARN_UNUSED
const char *
Copy link
Member

Choose a reason for hiding this comment

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

Is it ever going to be a performance problem to compare strings here? Unlike the implementation identifier we cannot just compare pointer values because the same encoding string might be defined in multiple places. Not sure what else we would do, maybe some kind of hash or a "registry" of encodings? Just a thought, not a blocker.

rmw_get_encoding_identifier(void);

RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
Expand Down