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 IDL generation to remove "//@top-level" and use "@nested #493

Closed
emammoser opened this issue Feb 14, 2024 · 16 comments
Closed

Change IDL generation to remove "//@top-level" and use "@nested #493

emammoser opened this issue Feb 14, 2024 · 16 comments
Assignees
Labels
enhancement New feature or request NGC: Approved To Work Label for Northrop Grumman to mark issues that are approved to be worked Priority: Major Priority: major - impacts important work flows

Comments

@emammoser
Copy link
Collaborator

Issue and tracking information

Developer's time Estimated effort to fix (hours):

Developer's Actual time spent on fix (hours)

Issue reporter to provide a detailed description of the issue in the space below

For our generated IDL structure and messages, we have "//@top-level true/false" appended to every definition. While this is valid RTI DDS syntax, it is not valid for all DDS vendors or IDL in general. Instead, we would like this changed to be the equivalent @nested prepended to the structure definition in a similar fashion to the @final/@appendable values (i.e. no prefixed comments). The values also become the opposite. So:

"//@top-level true" becomes "@nested(FALSE)" and
"//@top-level false" becomes "@nested(TRUE)"

We want this change made to the following branches:

  1. streams/v2
  2. streams/v3
@emammoser emammoser added enhancement New feature or request Priority: Major Priority: major - impacts important work flows NGC: Approved To Work Label for Northrop Grumman to mark issues that are approved to be worked labels Feb 14, 2024
@jwillemsen
Copy link
Member

This issue is related with RemedyIT/ciaox11#428, AXCIOMA is moving from @Toplevel/@top-level to @nested which is part of IDL 4.2.

@eposse eposse self-assigned this Feb 15, 2024
@eposse
Copy link
Collaborator

eposse commented Feb 16, 2024

A couple of questions.

  1. If I understand correctly, the following, current pattern:
    @final
    struct TestData_msg {
        // ...
    }; //@top-level true

should become

    @final
    @nested(TRUE)
    struct TestData_msg {
        // ...
    }; 

Is this correct?

  1. Assuming that it is correct, does the order of the annotations (@final/@appendable/@nested) matter?
  2. Do we have to remove the "//@top-level true" comment?

@jwillemsen
Copy link
Member

  1. nested is the inverse of top-level, so it should become
    @final
    @nested(FALSE)
    struct TestData_msg {
        // ...
    }; 
  1. The order of the annotations doesn't matter, IDL4 defines a lot more possible annotations
  2. Yes, //@top-level true should be removed, it is a RTI specific annotation for which we had a hack in AXCIOMA which was causing problems when working on more IDL4 annotation support

@emammoser
Copy link
Collaborator Author

@eposse I agree with Johnny above. Let me know if you have any other questions

@eposse
Copy link
Collaborator

eposse commented Feb 20, 2024

Two more questions:

  1. @nested(TRUE) is the default, correct?
  2. if the answer is yes, is it still required to add @nested(TRUE) or is @nested(FALSE) the only one required (if the struct or message is top-level)?

@emammoser
Copy link
Collaborator Author

@nested(TRUE) is the default, correct?
if the answer is yes, is it still required to add @nested(TRUE) or is @nested(FALSE) the only one required (if the struct or message is top-level)?

I am not sure what you mean by default. We don't have any selectable options for "top-level" at the moment, so I wouldn't expect there to be any for "nested" now. As far as I know, if we have a struct (CXStruct), it should be @nested(TRUE) and if we have a message (DDSMessage) it should be @nested(FALSE)

@eposse
Copy link
Collaborator

eposse commented Feb 20, 2024

By default I meant that any declared CXStruct or DDSMessage was "nested", but your answer clarifies that CXStructs are nested and DDSMessages are not.

But the second question is still relevant. While it is clear that a DDSMessage must have the @nested(FALSE) annotation, should every CXStruct have an explicit @nested(TRUE) annotation?

@emammoser
Copy link
Collaborator Author

Yes, I believe that is how it works currently with top-level, right? At least looking through generated IDL that we have, that is the case.

eposse pushed a commit that referenced this issue Feb 20, 2024
Signed-off-by: Ernesto Posse <eposse.gmail.com>
eposse pushed a commit that referenced this issue Feb 20, 2024
Signed-off-by: Ernesto Posse <eposse.gmail.com>
@eposse
Copy link
Collaborator

eposse commented Feb 20, 2024

I've tested the solution and prepared the builds for you to test:

Let me know if you have any issues.

eposse pushed a commit that referenced this issue Feb 21, 2024
Signed-off-by: Ernesto Posse <eposse.gmail.com>
eposse pushed a commit that referenced this issue Feb 21, 2024
Signed-off-by: Ernesto Posse <eposse.gmail.com>
@eposse
Copy link
Collaborator

eposse commented Feb 21, 2024

Here are the updated builds:

Let me know if you have any further comments.

eposse pushed a commit that referenced this issue Feb 21, 2024
Signed-off-by: Ernesto Posse <eposse.gmail.com>
eposse pushed a commit that referenced this issue Feb 21, 2024
Signed-off-by: Ernesto Posse <eposse.gmail.com>
@eposse
Copy link
Collaborator

eposse commented Feb 21, 2024

And the latest updated build:

@eposse
Copy link
Collaborator

eposse commented Feb 22, 2024

By the way, should I add these changes to the streams/v2.5.x-maintenance branch too?

@emammoser
Copy link
Collaborator Author

No, that streams maintenance branch is meant to work with a specific version of AXCIOMA (which maybe we should document in CX? Not sure) and that version of AXCIOMA does not use @nested, it only uses the top-level annotation

@eposse
Copy link
Collaborator

eposse commented Feb 22, 2024

Ok. Let me know when you have tested to merge it. Thanks.

@emammoser
Copy link
Collaborator Author

I have tested the v2 stream and it worked as expected. So I think you can merge them.

eposse added a commit that referenced this issue Feb 22, 2024
eposse added a commit that referenced this issue Feb 22, 2024
@eposse
Copy link
Collaborator

eposse commented Feb 22, 2024

Closing

@eposse eposse closed this as completed Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request NGC: Approved To Work Label for Northrop Grumman to mark issues that are approved to be worked Priority: Major Priority: major - impacts important work flows
Projects
None yet
Development

No branches or pull requests

3 participants