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

Some language mappings don't support equality comparison #4154

Merged
merged 1 commit into from Jun 9, 2023

Conversation

jrw972
Copy link
Contributor

@jrw972 jrw972 commented May 25, 2023

Problem

The type support for C++11 does not include equality operators (== and !=). The operators make the IDL defined types easier to use with generic programming techniques.

Solution

Implement support for == and !=.

Copy link
Member

@iguessthislldo iguessthislldo left a comment

Choose a reason for hiding this comment

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

There's also an error in the multi topic test. I think I converted that test to use the C++11 mapping at some point and probably implemented my own operators that now should probably be removed.

tools/dds/rtpsrelaylib/Relay.idl Outdated Show resolved Hide resolved
dds/idl/langmap_generator.cpp Outdated Show resolved Hide resolved
@jwillemsen
Copy link
Member

Does this work with valuetypes? The IDL to C++11 language mapping doesn’t define these operators as not all IDL types are comparable, but very likely the subset currently used by OpenDDS does by accident

@jrw972
Copy link
Contributor Author

jrw972 commented Jun 5, 2023

Does this work with valuetypes? The IDL to C++11 language mapping doesn’t define these operators as not all IDL types are comparable, but very likely the subset currently used by OpenDDS does by accident

No; opendds_idl is unaware of valuetypes. Support for valuetypes will be necessary when tao_idl is phased out.

dds/idl/be_global.cpp Outdated Show resolved Hide resolved
@jwillemsen
Copy link
Member

Any documentation extension needed (including warning that the generation of the operator is non-portable and has certain restrictions)?

@jrw972 jrw972 force-pushed the cxx11-equality branch 2 times, most recently from a431549 to ab721c3 Compare June 8, 2023 16:13
@jrw972 jrw972 changed the title C++11 mapping doesn't support equality comparison Some language mappings don't support equality comparison Jun 8, 2023
Problem
-------

The type support for C++11 does not include equality operators (`==`
and `!=`).  These operators make the IDL defined types easier to use
with generic programming techniques.

Solution
--------

Implement support for `==` and `!=`.  Currently, this support is
enabled by passed `-Gequality` to `opendds_idl`.
@jrw972 jrw972 merged commit 0324543 into OpenDDS:master Jun 9, 2023
119 of 124 checks passed
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.

None yet

3 participants