Class DynCallback



  • public class DynCallback
    extends java.lang.Object
    Native bindings to \"dyncall_callback.h\".

    The dyncallback dyncall library has an interface to create callback objects, that can be passed to functions as callback arguments. In other words, a pointer to the callback object can be "called", directly. The callback handler then allows iterating dynamically over the arguments once called back.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static boolean dcbArgBool(long args)
      Returns the next bool argument.
      static byte dcbArgChar(long args)
      Returns the next char argument.
      static double dcbArgDouble(long args)
      Returns the next double argument.
      static float dcbArgFloat(long args)
      Returns the next float argument.
      static int dcbArgInt(long args)
      Returns the next int argument.
      static int dcbArgLong(long args)
      Returns the next long argument.
      static long dcbArgLongLong(long args)
      Returns the next long long argument.
      static long dcbArgPointer(long args)
      Returns the next pointer argument.
      static short dcbArgShort(long args)
      Returns the next short argument.
      static byte dcbArgUChar(long args)
      Returns the next unsigned char argument.
      static int dcbArgUInt(long args)
      Returns the next unsigned int argument.
      static int dcbArgULong(long args)
      Returns the next unsigned long argument.
      static long dcbArgULongLong(long args)
      Returns the next unsigned long long argument.
      static short dcbArgUShort(long args)
      Returns the next unsigned short argument.
      static void dcbFreeCallback(long pcb)
      Destroys and frees the callback object.
      static long dcbGetUserData(long pcb)
      Returns a pointer to the userdata passed to the callback object on creation or initialization.
      static void dcbInitCallback(long pcb, java.nio.ByteBuffer signature, long handler, long userdata)
      (Re)initializes a callback object.
      static void dcbInitCallback(long pcb, java.lang.CharSequence signature, long handler, long userdata)
      (Re)initializes a callback object.
      static long dcbNewCallback(java.nio.ByteBuffer signature, long funcptr, long userdata)
      Creates and initializes a new Callback object.
      static long dcbNewCallback(java.lang.CharSequence signature, long funcptr, long userdata)
      Creates and initializes a new Callback object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • dcbNewCallback

        public static long dcbNewCallback(java.nio.ByteBuffer signature,
                                          long funcptr,
                                          long userdata)
        
        public static long dcbNewCallback(java.lang.CharSequence signature,
                                          long funcptr,
                                          long userdata)
        
        Creates and initializes a new Callback object.

        Use FreeCallback to destroy the Callback object.

        Parameters:
        signature - the function signature of the function to mimic
        funcptr - a pointer to a callback handler
        userdata - a pointer to custom data that might be useful in the handler
      • dcbInitCallback

        public static void dcbInitCallback(long pcb,
                                           java.nio.ByteBuffer signature,
                                           long handler,
                                           long userdata)
        
        public static void dcbInitCallback(long pcb,
                                           java.lang.CharSequence signature,
                                           long handler,
                                           long userdata)
        
        (Re)initializes a callback object.
        Parameters:
        pcb - the callback object
        signature - the function signature of the function to mimic
        handler - a pointer to a callback handler
        userdata - a pointer to custom data that might be useful in the handler
      • dcbFreeCallback

        public static void dcbFreeCallback(long pcb)
        Destroys and frees the callback object.
        Parameters:
        pcb - the callback object
      • dcbGetUserData

        public static long dcbGetUserData(long pcb)
        Returns a pointer to the userdata passed to the callback object on creation or initialization.
        Parameters:
        pcb - the callback object
      • dcbArgBool

        public static boolean dcbArgBool(long args)
        Returns the next bool argument.
        Parameters:
        args - the function arguments
      • dcbArgChar

        public static byte dcbArgChar(long args)
        Returns the next char argument.
        Parameters:
        args - the function arguments
      • dcbArgShort

        public static short dcbArgShort(long args)
        Returns the next short argument.
        Parameters:
        args - the function arguments
      • dcbArgInt

        public static int dcbArgInt(long args)
        Returns the next int argument.
        Parameters:
        args - the function arguments
      • dcbArgLong

        public static int dcbArgLong(long args)
        Returns the next long argument.
        Parameters:
        args - the function arguments
      • dcbArgLongLong

        public static long dcbArgLongLong(long args)
        Returns the next long long argument.
        Parameters:
        args - the function arguments
      • dcbArgUChar

        public static byte dcbArgUChar(long args)
        Returns the next unsigned char argument.
        Parameters:
        args - the function arguments
      • dcbArgUShort

        public static short dcbArgUShort(long args)
        Returns the next unsigned short argument.
        Parameters:
        args - the function arguments
      • dcbArgUInt

        public static int dcbArgUInt(long args)
        Returns the next unsigned int argument.
        Parameters:
        args - the function arguments
      • dcbArgULong

        public static int dcbArgULong(long args)
        Returns the next unsigned long argument.
        Parameters:
        args - the function arguments
      • dcbArgULongLong

        public static long dcbArgULongLong(long args)
        Returns the next unsigned long long argument.
        Parameters:
        args - the function arguments
      • dcbArgFloat

        public static float dcbArgFloat(long args)
        Returns the next float argument.
        Parameters:
        args - the function arguments
      • dcbArgDouble

        public static double dcbArgDouble(long args)
        Returns the next double argument.
        Parameters:
        args - the function arguments
      • dcbArgPointer

        public static long dcbArgPointer(long args)
        Returns the next pointer argument.
        Parameters:
        args - the function arguments