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

Generalize automatic addition of adapter annotations #670

Open
HGuillemet opened this issue Apr 8, 2023 · 5 comments
Open

Generalize automatic addition of adapter annotations #670

HGuillemet opened this issue Apr 8, 2023 · 5 comments

Comments

@HGuillemet
Copy link
Contributor

It would be nice to generalize this logic for, eg, containers or arrays.
Currently, if we must map a std::vector<std::shared_ptr<M>>, we need to add an info new Info("std::shared_ptr<M>").pointerTypes("M"). While this is not needed if std::shared_ptr<M> is the type of a function argument or a return type.
But adding such manual info also cancel the automatic additions of @Cast and possibly others performed by the parser.

Could this logic be moved from declarator() to type() ?

@saudet
Copy link
Member

saudet commented Apr 9, 2023

You mean supporting multiple adapter annotations like @StdVector @SharedPtr? That's not supported at all by the current implementation of adapters in Generator. This needs to be completely rethought, along with other issues like the ones reported by @equeim as per issue #374.

@HGuillemet
Copy link
Contributor Author

No, I meant the possibility of defining std::vector<std::shared_ptr<M>> without having to add Info("std::shared_ptr<M>").pointerTypes("M").

@saudet
Copy link
Member

saudet commented Apr 9, 2023 via email

@HGuillemet
Copy link
Contributor Author

I'm not sure how it would solve this specific issue, but instantiating them when needed seems a good improvement. No need to define() them any more, just like other classes. You must have already though about this: would that be difficult to do ?

@saudet
Copy link
Member

saudet commented Apr 9, 2023

No one just never had a reason to do it like that. If you want to give it a try, feel free to experiment!

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

No branches or pull requests

2 participants