Skip to content

References inside messageHeader not working #435

Closed

Description

@ksergey

Hello Devs,

Example:

        <set name="UpdateFlags" encodingType="uint8">
            <choice name="Begin">0</choice>
            <choice name="End">1</choice>
        </set>
        <composite name="messageHeader" description="Template ID and length of message root">
            <type name="blockLength" primitiveType="uint16"/>
            <type name="templateId" primitiveType="uint16"/>
            <type name="schemaId" primitiveType="uint16"/>
            <type name="version" primitiveType="uint16"/>
            <ref name="flags" type="UpdateFlags"/>
        </composite>

Generated C++ code looks like:


private:                                                                                        
    Flags m_flags;

public:

    Flags &flags()
    {   
        m_flags.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength);
        return m_flags;
    }   

But class Flags not generated and I believe class name should be UpdateFlags (not Flags)

Thanks

Activity

  1. mjpt777 commented on Feb 15, 2017

    @mjpt777
    Contributor

    @billsegall Worth tracking this one to see the changes that need to be applied to the Golang version.

  2. tmontgomery commented on Feb 15, 2017

    @tmontgomery
    Contributor

    C++ has been changed to follow Java (as of commit 323ece0). Might be good to check and see if that addresses the issue.

  3. tmontgomery commented on Feb 15, 2017

    @tmontgomery
    Contributor

    now it should be working, I think.

  4. ksergey commented on Feb 16, 2017

    @ksergey
    ContributorAuthor

    @tmontgomery not fully resolved - MessageHeader.h do not include required headers.
    Example above should include "UpdateFlags.h"

  5. tmontgomery commented on Feb 16, 2017

    @tmontgomery
    Contributor

    MessageHeader.h is only designed to include the MessageHeader type itself. It doesn't include any others.

  6. mjpt777 commented on Feb 16, 2017

    @mjpt777
    Contributor

    @tmontgomery I think a message header should support the minimum four fields and it is OK to add on additional fields at the end. The Java implementation now allows this. The spec does not say it must only be these four fields.

  7. tmontgomery commented on Feb 16, 2017

    @tmontgomery
    Contributor

    @mjpt777 true. The spec does not forbid it. But the IR HeaderStructure class only picks up those 4 token names. So, the IR itself doesn't contain anything else for the header structure.

  8. tmontgomery commented on Feb 16, 2017

    @tmontgomery
    Contributor

    I believe this would effect the OTF as well, for example.

  9. mjpt777 commented on Feb 16, 2017

    @mjpt777
    Contributor

    There is a default header with a minimum set of requirements. An OTF implementation could use its own extended header decoder.

  10. tmontgomery commented on Feb 16, 2017

    @tmontgomery
    Contributor

    It could, yes. But the header structure that is used for generating the codec MessageHeader seems to ignore all other fields than the named ones. And that header structure is also used for OTF, IIRC.

  11. tmontgomery commented on Feb 16, 2017

    @tmontgomery
    Contributor

    It's in the Ir class. Which creates the HeaderStructure which when capturing tokens, seems to ignore everything but the named fields. So, it would effect Java OTF and the generators.

    For C++, I tried looking at this. A ref won't be seen in the generated MessageHeader because it isn't in the header structure at that point. Or it seems that way.

  12. mjpt777 commented on Feb 16, 2017

    @mjpt777
    Contributor

    I'm pretty certain I tried this today in the Java version and it worked.

  13. tmontgomery commented on Feb 16, 2017

    @tmontgomery
    Contributor

    Actually, I think it is more subtle.

    Update: 2 wrongs don't make a right. Looking in the wrong place and looking at wrong methods.

  14. tmontgomery commented on Feb 16, 2017

    @tmontgomery
    Contributor

    Should work now.

  15. ksergey commented on Feb 17, 2017

    @ksergey
    ContributorAuthor

    Resolved! Thanks

  16. added a commit that references this issue on Feb 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions