SWIG_JAVA: C++ Interfaces to Java interfaces, Modified one Java Example

This commit translates C++ interfaces to Java interfaces, previously C++ Interfaces implemented java classes.

    * Added java swig interface files for all C++ interfaces to simplify swig
    javaupm_iADC.i
    javaupm_iCO2Sensor.i
    javaupm_iHumiditySensor.i
    javaupm_iLightController.i
    javaupm_iLightSensor.i
    javaupm_iModuleStatus.i
    javaupm_interfaces.i
    javaupm_iPressureSensor.i
    javaupm_iTemperatureSensor.i

    <example Usage>
        %include"../interfaces/javaupm_iADC.i"

    * Modified swig interface files for few sensors that implements interfaces
    ads1x15
    bmp280
    bmpx8x
    ds1808lc
    hlg150h
    lp8860
    max44009
    ms5611
    si1132
    si7005
    t6713

    * Removed few methods that were mentioned Protected and made them public, so that menthods can be overridden

    * Made IModuleStatus virtual to avoid ambiguity in multiple inheritance
    For example
    class A {};
    class B : public A {};
    class C : public A {};
    class D : public B, public C {};

    This can be solved as
    class A {};
    class B : virtual public A {};
    class C : virtual public A {};
    class D : public B, public C {};

    * Modified java interface files to support multiple swig versions

    * Modified javaupm interface file to support standard auto load library code

    * Fixed autoloadlibrary tests for interfaces

    * Created one interface example separately <BME280_InterfaceExample.java>,
    <example Usage>
        BME280_InterfaceExample.java
    since we cann't define swig versions inside java example file.
    So, instaed added swig versions in Cmake.
    <example Usage>
         if (SWIG_VERSION VERSION_GREATER 3.0.8)
           add_example_with_path(BME280_InterfaceExample bmp280 bmp280)
         endif()

Signed-off-by: sisinty sasmita patra <sisinty.s.patra@intel.com>
This commit is contained in:
sisinty sasmita patra
2017-02-06 14:59:00 -08:00
committed by Sasmita Patra
parent f8663c90f3
commit 1f18369fbe
43 changed files with 215 additions and 82 deletions

View File

@ -172,6 +172,11 @@ add_example_with_path(Lcm1602_parallelSample lcd i2clcd)
add_example_with_path(SSD1308_oledSample lcd i2clcd)
add_example_with_path(SSD1327_oledSample lcd i2clcd)
add_example_with_path(BME280_Example bmp280 bmp280)
if(SWIG_VERSION VERSION_GREATER 3.0.8)
add_example_with_path(BME280_InterfaceExample bmp280 bmp280)
endif()
add_example_with_path(BMA250E_Example bmx055 bmx055)
add_example_with_path(BMG160_Example bmx055 bmx055)
add_example_with_path(BMM150_Example bmx055 bmx055)