-
Notifications
You must be signed in to change notification settings - Fork 333
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
Added support of (smart) pointers as members and added support for "T& getter()" getters #166
Added support of (smart) pointers as members and added support for "T& getter()" getters #166
Conversation
First of all, thanks a lot for the PR, it's very much appreciated. I love the fact that we can retrieve generic types from getters, and also follow (smart) pointers. I'm certain it will be very helpful for many users. There also seems to be some limitations here if I understand it properly. Currently, pointers do not automatically work within Arrays and Scalars. To make them work we would have to add special support for each of them. We should also add support for What I'm thinking about now is that we add some mapping/pointer wrapper which can be registered, whose sole purpose is to dereference whatever gets passed to it. Internally, we should provide support for raw pointers, shared pointers, and unique pointers. If that works out as intended, then they will automatically be available for Scalars, Arrays and Structs without any special support. Hopefully. I have previously been playing around with implementing getter and setter functions for types instead of variables, which would fit nicely into this. With these changes, we should be able to remove the Anyway, what you have here is a great start. I think I want to play with it on a separate branch for now, and see if I can work out something I like. Or it might not work out, and we'll instead continue along this approach and extend it to other cases and clean up the interface a bit. |
I get the Arrays part, but what do you mean by mentioning Scalars? You can have pointers to scalars and they will work automatically with my changes :) |
Not right now, but that's how I'd like it to work yes :) |
Hey Mike, |
Very cool! That is very close to what I was thinking about. It would be nice if you could merge it in here. I haven't had time to work on this myself yet, but I'm happy to have this to start with, thanks a lot! |
Thank you! |
Added support of (smart) pointers as members and added "T& getter()" getters.
Newly supported member types:
Getters supported (not limited to, might be more I didn't think of/test):