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

Q: Support for POD structs #11

Closed
eserg opened this issue May 20, 2020 · 3 comments
Closed

Q: Support for POD structs #11

eserg opened this issue May 20, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@eserg
Copy link

eserg commented May 20, 2020

Hello,

If I understand the documentation correctly, and am not making mistakes in my tests, plain struct export is not supported by Scapix.

Could you please elaborate technical reasons to this decision?

Example:

struct MyData { 
  int a; 
  double b; 
};
class MyExportedClass : public scapix::bridge::object<MyExportedClass> {
public:
  MyData someData() const;
};

will result in a missing wrapper: //-(!UNKNOWN!)someData;

Thank you!

Best regards,
Sergey

@Boris-Rasin
Copy link
Member

I plan to add support for POD structs. The technical difficulty is related to separate compilation - deciding where to generate code for such structs. At least structs declared in the same header with one of scapix::bridge::object should not be a problem. I will add such support soon.

@eserg
Copy link
Author

eserg commented May 25, 2020

Thank you, Boris.

structs declared in the same header with one of scapix::bridge::object should not be a problem

Even this support would be a very useful addition.

@Boris-Rasin Boris-Rasin added the enhancement New feature or request label May 25, 2020
@Boris-Rasin
Copy link
Member

Struct support was added 2021-05-10 (cmodule v1.0.29).

This includes structs with members of all supported types, not only POD structs. At this time, only struct defined in the same header where it is used as a parameter or return value is supported. This limitation will be lifted in a future version.

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

No branches or pull requests

2 participants