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

THRIFT-5773: Strong UUID for C++ #2958

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

CJCombrink
Copy link
Contributor

@CJCombrink CJCombrink commented Apr 8, 2024

THRIFT-5773: UUID wrapper for C++

Adds a strong UUID wrapper for C++.
The use of a std::string can be misleading and since C++ is a strong typed language, this makes the most sense.

  • Did you create an Apache Jira ticket? (Request account here, not required for trivial changes)
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

@Jens-G Jens-G added the c++ label Apr 11, 2024
@CJCombrink CJCombrink force-pushed the feature/THRIFT-5773_strong_uuid branch from 803bc86 to 45e11bb Compare April 16, 2024 04:56
* This function will throw an exception if the string is not
* a valid UUID.
*/
TUuid& operator=(const std::string& str) noexcept(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any comment on this function?
I am still very much in two minds if this function should ever exist.
Perhaps not since there is an explicit constructor taking a string.
I am concerned about the porting issue for people that already used a string like object (byte[16]) but wants to upgrade to using the strong UUID.

- The public data member is probably not convention, but this should be a light wrapper for added utility.
- Stick with uint8_t[16] as discussed on ticket
- Cleanup and unit tests added
- And fix begin() and end()
- More unit test
- Test for network order
@CJCombrink CJCombrink force-pushed the feature/THRIFT-5773_strong_uuid branch from 45e11bb to 5e16321 Compare April 28, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants