Skip to content

Decoder generated for a Set does not provide a convenience method to determine if no choices have been set #576

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
JerryShea opened this issue Jul 28, 2018 · 0 comments

Comments

@JerryShea
Copy link
Contributor

JerryShea commented Jul 28, 2018

The decoder generated for a Set does not provide a convenience method to determine if nothing has been set. If we look at sbe_samples and Car's OptionalExtras, the only way to determine if no OptionalExtras
have been set is to call

    notSet = ! (sunRoof() || sportsPack() || cruiseControl());

And this code is fragile and inefficient. This PR modifies SbeTool to generate a new method in OptionalExtrasDecoder

    public boolean isEmpty()
    {
        return 0 == buffer.getByte(offset);
    }

PR here: #575

@mjpt777 mjpt777 closed this as completed Aug 2, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants