We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Enums are not propagated to Java code.
The C++ code
class adapter: public scapix::bridge::object<adapter> { public: enum class AdapterEnum : std::uint32_t { One = 1, Two }; void adapter_test(AdapterEnum evt) {}; };
is translated by the scapix generator to the following Java code:
public class Adapter extends com.scapix.Bridge { public Adapter() { super(nop); _init(); } public native void adapterTest(int evt); }
To address this issue, the scapix generator should generate the following code:
public class Adapter extends com.scapix.Bridge { public Adapter() { super(nop); _init(); } public static enum AdapterEnum { One(1), Two(2); private final int value; AdapterEnum(final int val) { value = val; } public int getValue() { return value; } } public native void adapterTest(AdapterEnum evt);
The nested enum AdapterEnum must be public to allow it to be used from external code.
Another option is to get the integer values from the native library but this causes more overhead.
Thank you.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Enums are not propagated to Java code.
The C++ code
is translated by the scapix generator to the following Java code:
To address this issue, the scapix generator should generate the following code:
The nested enum AdapterEnum must be public to allow it to be used from external code.
Another option is to get the integer values from the native library but this causes more overhead.
Thank you.
The text was updated successfully, but these errors were encountered: