Donnerstag, 29. Januar 2015

Pointers to Functions with Swig

http://web.mit.edu/svn/src/swig-1.3.25/Examples/java/funcptr/index.html
http://stackoverflow.com/questions/4313004/registering-java-function-as-a-callback-in-c-function

http://stackoverflow.com/questions/12210129/how-should-i-write-the-i-file-to-wrap-callbacks-in-java-or-c-sharp

void* als jobject:
http://stackoverflow.com/questions/26110908/swig-typemap-java-object

Mocking singletons....


 public class LicenseDataLocator {
private static LicenseData licenseData;

    public static synchronized LicenseData getLicenseData() {
        if (licenseData == null) {
            licenseData = new LicenseDataLocator().readLicenseData();
        }
        return licenseData;
    }
   

// here you can insert your mock.
    public static void setLicenseData(LicenseData licenseData) {
        LicenseDataLocator.licenseData = licenseData;
    }