NativeObjectType1 o1 = (NativeObjectType1 ) NativeLookup.create(NativeObjectType1 .class);
NativeObjectType1 o2 = (NativeObjectType1 ) NativeLookup.create(NativeObjectType1 .class);NativeObjectType2 o3 = (NativeObjectType2) NativeLookup.create(NativeObjectType2 .class);NativeObjectType1 object (so to do something like o3.amethod(o1)) as this method would depends on multiple parametters stored nativelly in NativeObjectType1 objects.It should be feasible in theory as CN1 keep a mapping between a CN1 java object and its matching native object (to bind the calls of a NativeInterface) so if I pass a CN1 object that extends NativeInterface, it should be able to use this mapping to retrieve the matching native object and pass the pointer to it when transforming the java call into a native one...--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/04ecf3a6-ad0d-4ebe-b14b-07b187ead623%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
If you can provide more information about your use case, I may be able to suggest a way to achieve it. While you can't just pass a NativeInterface instance as a NativeInterface parameters, there are a few crafty techniques that you can use to pass "native" objects back and forth. E.g., on iOS, "native" objects are just pointers, which can be cast to and from longs and passed back and forth. On java-native platforms (e.g. simulator and Android), I generally use a static lookup table, then pass ids of this lookup table back and forth.Steve
On Thu, Oct 18, 2018 at 10:20 PM Thomas <tomber...@gmail.com> wrote:
--OK Thanks.As for the ByteBuffer I completely agree yes ;) (It is the basis of the binary messages solution chosen by Flutter to communicate between flutter dart code and native one and it is SO convenient and powerfull to work with that I also regret not having such an easy solution in CN1 too)
On Friday, October 19, 2018 at 7:07:52 AM UTC+2, Shai Almog wrote:It hasn't been implemented, it would have been nice but it's a lot of work since every change in this part of the code needs to be done for every port. It also needs to be replicated in the code generation and the backend generation logic. There are multiple points of failure and pain so we try to avoid changing those things. The only thing I really miss in native interfaces is a proper ByteBuffer to provide high performance shared memory although it isn't crucial as we don't have the JNI overhead and can use callbacks to map data directly.In other words, it's technically possible but such a pain to implement we probably won't do it.
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/04ecf3a6-ad0d-4ebe-b14b-07b187ead623%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.