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

Add and use a strong type for program ID #272

Closed
Tracked by #257
PatrickKa opened this issue Apr 5, 2024 · 1 comment · Fixed by #277
Closed
Tracked by #257

Add and use a strong type for program ID #272

PatrickKa opened this issue Apr 5, 2024 · 1 comment · Fixed by #277

Comments

@PatrickKa
Copy link
Contributor

Description

Something like using ProgramId = fluent::NamedType<std::uint16_t, struct ProgramIdTag>; should do the trick. This type makes interfaces safer, as in easier to use correctly and more difficult to use incorrectly. Since the program ID shows up in a lot of files and also gets serialized, this refactoring is probably quite some work, but the longer we wait, the worse it gets. We also have to think about where we actually define the type. It will be used at least in the modules for the EDU, the file system and the RF command handling, so it should be in a separate component, but I am not sure what to call it yet since I don't know if and which other types might join later. We could use something like Sts1CobcSw/StrongTypedefs/StrongTypedefs.hpp or .../CommonTypes/CommonTypes.hpp or we think about the umbrella term later and just use .../ProgramId/ProgramId.hpp. I really don't know.

@PatrickKa
Copy link
Contributor Author

Fixed by #277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants