#4 Using callbacks with the java swig lib

closed
nobody
None
5
2010-02-17
2010-02-16
kaouete
No

Hello,

Is there any way to use yarp callbacks when using the java swig library?

I am not very confident that the answer is yes, but who knows…

Thank you.

Discussion

  • Paul Fitzpatrick

    Hi kaouete. Yes, some yarp callbacks are usable via java swig. Since supporting callbacks requires some overhead, we've been "turning on" support for callbacks selectively. If you let me know which callback you are interested in, I can check whether it has been enabled, and turn it on if needed. You can read about callbacks in swig (supported by a feature called "directors") here: http://www.swig.org/Doc1.3/Java.html#java_directors
    To control what callbacks are supported requires modifying $YARP_ROOT/example/swig/yarp.i (search for director).

     
  • kaouete

    kaouete - 2010-02-16

    Ok, I am happy to have asked !

    I will play with this and see if it is sufficient or if I need something else (and why).

    Thank you for your answer, I will close this request when all is ok.

     
  • kaouete

    kaouete - 2010-02-16

    So, it looks like what I am interested in is not yet enabled with directors.

    What I would like is to be able to use callbacks on BufferedPortBottle. Tell me if I missed something :)

    Thank you

     
  • Paul Fitzpatrick

    For BufferedPortBottle, don't try to use the onRead method directly. Instead make an instance of the BottleCallback class, and call port.useCallback(the_callback_instance). See the second method described in this thread:

    http://n2.nabble.com/Yarp-callbacks-in-Python-td3796634.html

    Hope this helps, P

     
  • kaouete

    kaouete - 2010-02-17

    Hello,

    It works perfectly, thank you for your support.

     
  • kaouete

    kaouete - 2010-02-17
    • status: open --> closed