Open HGuillemet opened 1 year ago
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.
No, I meant the possibility of defining std::vector<std::shared_ptr<M>>
without having to add Info("std::shared_ptr<M>").pointerTypes("M")
.
So you're talking about containers(). For that, we'd need to delay the instantiation until their first use.
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 ?
No one just never had a reason to do it like that. If you want to give it a try, feel free to experiment!
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 infonew Info("std::shared_ptr<M>").pointerTypes("M")
. While this is not needed ifstd::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()
totype()
?