In lip there are three main data structures: LIP_Schedule, LIP_Datamap and LIP_IOBufmap that can naturally be represented as distinct Java classes. Janet introduces special utilities for creating classes from such structures. They are implemented in the DataEncapsulator class which stores the handle to the original structure and that handle can be passed to and modified by Java routines.
Many lip routines take as a parameter a pointer to data or an index array, that may refer to some portion of such an array. Since Java lacks pointers, Janet provides an utility called virtual array that represents Java array or a portion of one. It may be passed to a native function that converts it easily into a pointer and uses it as an argument for a native library call.
As all lip routines return status (i.e. error) values, the Java bindings can easily detect such errors and raise proper Java exceptions. The LipException class implements all possible errors generated by the lip library.
Next: Sample function wrapper in
Up: General Concepts
Previous: Introduction to Janet
  Contents
Created by Katarzyna Zając