{"action":"created","issue":{"url":"https://api.github.com/repos/bytedeco/javacpp/issues/50","labels_url":"https://api.github.com/repos/bytedeco/javacpp/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/bytedeco/javacpp/issues/50/comments","events_url":"https://api.github.com/repos/bytedeco/javacpp/issues/50/events","html_url":"https://github.com/bytedeco/javacpp/issues/50","id":119841923,"number":50,"title":"Enums not replaced while templates are instantiated","user":{"login":"jpsacha","id":1205408,"avatar_url":"https://avatars.githubusercontent.com/u/1205408?v=3","gravatar_id":"","url":"https://api.github.com/users/jpsacha","html_url":"https://github.com/jpsacha","followers_url":"https://api.github.com/users/jpsacha/followers","following_url":"https://api.github.com/users/jpsacha/following{/other_user}","gists_url":"https://api.github.com/users/jpsacha/gists{/gist_id}","starred_url":"https://api.github.com/users/jpsacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpsacha/subscriptions","organizations_url":"https://api.github.com/users/jpsacha/orgs","repos_url":"https://api.github.com/users/jpsacha/repos","events_url":"https://api.github.com/users/jpsacha/events{/privacy}","received_events_url":"https://api.github.com/users/jpsacha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-02T00:44:29Z","updated_at":"2015-12-02T13:48:05Z","closed_at":null,"body":"Consider example from wrappers for Pylon library. Here is a snippet of the C++ code that defines an `enum` then uses it as a template parameter.\r\n\r\n```\r\nenum SequencerModeEnums\r\n{\r\n    SequencerMode_Off,  //!<Disables the sequencer for image acquisition.\r\n    SequencerMode_On   //!<Enables the sequencer for image acquisition.\r\n        \r\n};\r\n...\r\nGenApi::IEnumerationT<SequencerModeEnums > &SequencerMode;\r\n```\r\n\r\nTo instantiated the template I added to presets:\r\n\r\n```java\r\nnew Info(\"GenApi_3_0_Basler_pylon_v5_0::IEnumerationT<Basler_UsbCameraParams::SequencerModeEnums>\").pointerTypes(\"IEnumerationT_SequencerModeEnums\").define()\r\n```\r\n\r\nThis results in the `enum` converted to set of constant values (as expected), and in creation of a class for instantiated template `IEnumerationT_SequencerModeEnums`. But within the `IEnumerationT_SequencerModeEnums` the enum is still referred to by its original C++ type `SequencerModeEnums`, see last line of the snippet below. This results in the compilation error of the Java wrapper.\r\n\r\n```java\r\n/** enum Basler_UsbCameraParams::SequencerModeEnums */\r\npublic static final int\r\n    /**Disables the sequencer for image acquisition. */\r\n    SequencerMode_Off = 0,\r\n    /**Enables the sequencer for image acquisition. */\r\n    SequencerMode_On = 1;\r\n\r\n...\r\n@Name(\"GenApi_3_0_Basler_pylon_v5_0::IEnumerationT<Basler_UsbCameraParams::SequencerModeEnums>\") \r\npublic static class IEnumerationT_SequencerModeEnums extends IEnumeration {\r\n...\r\n  public native void SetValue(@ByVal SequencerModeEnums Value, @Cast(\"bool\") boolean Verify/*=true*/);\r\n```\r\n\r\nComplete code illustrating the issue is at commit [f35d4c48](https://github.com/jpsacha/javacpp-presets/commit/f35d4c48ae034dcd7a36eb09514938ada2918825).\r\n"},"comment":{"url":"https://api.github.com/repos/bytedeco/javacpp/issues/comments/161295480","html_url":"https://github.com/bytedeco/javacpp/issues/50#issuecomment-161295480","issue_url":"https://api.github.com/repos/bytedeco/javacpp/issues/50","id":161295480,"user":{"login":"saudet","id":3328023,"avatar_url":"https://avatars.githubusercontent.com/u/3328023?v=3","gravatar_id":"","url":"https://api.github.com/users/saudet","html_url":"https://github.com/saudet","followers_url":"https://api.github.com/users/saudet/followers","following_url":"https://api.github.com/users/saudet/following{/other_user}","gists_url":"https://api.github.com/users/saudet/gists{/gist_id}","starred_url":"https://api.github.com/users/saudet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saudet/subscriptions","organizations_url":"https://api.github.com/users/saudet/orgs","repos_url":"https://api.github.com/users/saudet/repos","events_url":"https://api.github.com/users/saudet/events{/privacy}","received_events_url":"https://api.github.com/users/saudet/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T13:48:05Z","updated_at":"2015-12-02T13:48:05Z","body":"If we include \"pylon/usb/_BaslerUsbCameraParams.h\" before \"GenApi/IEnumerationT.h\", that should fix this issue.\r\n\r\nBTW, this is a normal Java source file. We don't need to repeat 200 times\r\n ```java\r\n.put(new Info(\"GenApi_3_0_Basler_pylon_v5_0::IEnumerationT<Basler_UsbCameraParams::xxx\").pointerTypes(\"IEnumerationT_xxx\").define())\r\n```\r\nJust use a `for` loop for that. :)"}}