-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow registration of DefaultConverters for non-standard types #8799
Allow registration of DefaultConverters for non-standard types #8799
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #8799 +/- ##
==========================================
+ Coverage 89.82% 90.05% +0.22%
==========================================
Files 412 420 +8
Lines 11878 12213 +335
Branches 2364 2409 +45
==========================================
+ Hits 10670 10999 +329
+ Misses 681 671 -10
- Partials 527 543 +16 ☔ View full report in Codecov by Sentry. |
Thanks for the PR! @henon I will let you decide on this one, considering that in maybe v8 we will rethink the whole converter system I don't think "global" converters will be a thing. |
To be honest, I don't like the way it ended up, but this way, it didn't require a lot of effort.
|
I thought quite a bit about this. We have a default converter which is already part of our global default value infrastructure. Making it customizable for non-standard types makes sense, otherwise you would have to question the existence of a universal default converter as a whole, right? I mean you have default conversion for standard types but not for other types. And as a user you might even want to override how standard types are converted. I am accepting this PR for v7 but we'll probably change how to register default conversion functions / default converters in v8. Or if we face implementation challenges or find that it introduces too much complexity with our new converter API we might also choose to remove the capability in v8. Let's see. |
Awesome, thanks. |
…azor#8799) Co-authored-by: Rafał Maciąg <rafal.maciag@modelingevolution.com>
This is a tiny change that allows a developer to set up a global default converter that is used in bindings.
With this change, one can setup global default converter for structs such as Point, Vector, etc, especially from 3rd party libraries.
Description
Code was added, not changed. It is backward compatible.
How Has This Been Tested?
--> A UT was added to test this small change. BindingConverterTests->GlobalConverterTests()
--> docs project contains a component that tested new functionality: PointConverterExample
Type of Changes
Checklist
dev
).