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

Ability to remap pointer types #111

Open
RandyPasion opened this issue Oct 20, 2022 · 2 comments
Open

Ability to remap pointer types #111

RandyPasion opened this issue Oct 20, 2022 · 2 comments

Comments

@RandyPasion
Copy link

Currently remapping is only evaluated on element types (e.g. remapping someType will apply the same remapping to someType*)

Allow defining remapping of pointer types separately from element type.

This can be particularly useful for safe pointer management in C#. A common use case would be to remap someType* to a class inheriting SafeHandle (e.g. SomeTypeHandle : SafeHandle) that the user defines for managing the pointer.

Secondary improvement here - prioritize user remappings to defaults. Some types are default remapped ((char* to CString for example). If a user defines a different remapping from this, it should prefer the user's remapping.

@lithiumtoast
Copy link
Member

Makes sense; sounds like this would go well with the idea of trying to work on right now: C# plugin. Use a C# library to control generating C# code rather than a config file. This would help with automating custom wrappers as custom C# code can be written to help transform the bindings into a desired wrapper.

@lithiumtoast
Copy link
Member

I found a way forward to implement this. It requires some major refactoring however... I'll be working on it when I can.

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

No branches or pull requests

2 participants