You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And the Parameter class is a templated wrapper with getter and setter methods, used also to perform some other logic (e.g. validation, value change notification and so on...).
A complete example of (unfortunately) not working code can be found here: https://godbolt.org/z/7dfxqdTcj
For Parameter reflection, I defined the Parameter::glaze::value struct as I found in the documentation under the Value Types section, but in this way the wrapped value is directly returned and the getter/setter logic is lost.
I also tried to return the Parameter itself from the Parameter::glaze::value lambda, but this obviously resulted in a application crash due to infinite recursion triggered by glz::seek when I try to access a nested Parameter.
I tried to specify the Parameter::glaze::value as a glz::custom such as in the example I found in json_test.cpp but without any success:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I need to use glz::seek to access values in a configuration using JSON Pointer strings to address parameters.
The configuration objects are something like this:
And the Parameter class is a templated wrapper with getter and setter methods, used also to perform some other logic (e.g. validation, value change notification and so on...).
A complete example of (unfortunately) not working code can be found here: https://godbolt.org/z/7dfxqdTcj
For Parameter reflection, I defined the Parameter::glaze::value struct as I found in the documentation under the Value Types section, but in this way the wrapped value is directly returned and the getter/setter logic is lost.
I also tried to return the Parameter itself from the Parameter::glaze::value lambda, but this obviously resulted in a application crash due to infinite recursion triggered by glz::seek when I try to access a nested Parameter.
I tried to specify the Parameter::glaze::value as a glz::custom such as in the example I found in json_test.cpp but without any success:
glaze/tests/json_test/json_test.cpp
Line 7530 in 4a6b016
Is what I am trying to do possible in any way?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions