Skip to content

Commit

Permalink
Type cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Feb 26, 2015
1 parent 89bcd31 commit 92e5534
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 34 deletions.

This file was deleted.

75 changes: 75 additions & 0 deletions src/com/frostwire/jlibtorrent/swig/high_resolution_clock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.5
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */

package com.frostwire.jlibtorrent.swig;

public class high_resolution_clock {
private long swigCPtr;
protected boolean swigCMemOwn;

protected high_resolution_clock(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}

protected static long getCPtr(high_resolution_clock obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}

protected void finalize() {
delete();
}

public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
libtorrent_jni.delete_high_resolution_clock(swigCPtr);
}
swigCPtr = 0;
}
}

static public class time_point {
private long swigCPtr;
protected boolean swigCMemOwn;

protected time_point(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}

protected static long getCPtr(time_point obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}

protected void finalize() {
delete();
}

public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
libtorrent_jni.delete_high_resolution_clock_time_point(swigCPtr);
}
swigCPtr = 0;
}
}

public time_point() {
this(libtorrent_jni.new_high_resolution_clock_time_point(), true);
}

}

public high_resolution_clock() {
this(libtorrent_jni.new_high_resolution_clock(), true);
}

}
16 changes: 8 additions & 8 deletions src/com/frostwire/jlibtorrent/swig/libtorrent.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,20 +161,20 @@ public static String log_time() {
return libtorrent_jni.log_time();
}

public static SWIGTYPE_p_boost__chrono__high_resolution_clock__time_point time_now() {
return new SWIGTYPE_p_boost__chrono__high_resolution_clock__time_point(libtorrent_jni.time_now(), false);
public static high_resolution_clock.time_point time_now() {
return new high_resolution_clock.time_point(libtorrent_jni.time_now(), false);
}

public static SWIGTYPE_p_boost__chrono__high_resolution_clock__time_point time_now_hires() {
return new SWIGTYPE_p_boost__chrono__high_resolution_clock__time_point(libtorrent_jni.time_now_hires(), true);
public static high_resolution_clock.time_point time_now_hires() {
return new high_resolution_clock.time_point(libtorrent_jni.time_now_hires(), true);
}

public static SWIGTYPE_p_boost__chrono__high_resolution_clock__time_point min_time() {
return new SWIGTYPE_p_boost__chrono__high_resolution_clock__time_point(libtorrent_jni.min_time(), true);
public static high_resolution_clock.time_point min_time() {
return new high_resolution_clock.time_point(libtorrent_jni.min_time(), true);
}

public static SWIGTYPE_p_boost__chrono__high_resolution_clock__time_point max_time() {
return new SWIGTYPE_p_boost__chrono__high_resolution_clock__time_point(libtorrent_jni.max_time(), true);
public static high_resolution_clock.time_point max_time() {
return new high_resolution_clock.time_point(libtorrent_jni.max_time(), true);
}

public static String unescape_string(String s, error_code ec) {
Expand Down
4 changes: 4 additions & 0 deletions src/com/frostwire/jlibtorrent/swig/libtorrent_jni.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public class libtorrent_jni {
public final static native boolean address_v6_is_multicast_org_local(long jarg1, address_v6 jarg1_);
public final static native boolean address_v6_is_multicast_site_local(long jarg1, address_v6 jarg1_);
public final static native void delete_address_v6(long jarg1);
public final static native long new_high_resolution_clock_time_point();
public final static native void delete_high_resolution_clock_time_point(long jarg1);
public final static native long new_high_resolution_clock();
public final static native void delete_high_resolution_clock(long jarg1);
public final static native int tcp_endpoint_port(long jarg1, tcp_endpoint jarg1_);
public final static native String tcp_endpoint_address(long jarg1, tcp_endpoint jarg1_);
public final static native long new_tcp_endpoint();
Expand Down
11 changes: 11 additions & 0 deletions swig/boost.i
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,17 @@ namespace boost {
};
}
}

namespace chrono {

class high_resolution_clock {
public:

class time_point {
public:
};
};
}
}

%rename(tcp_endpoint) tcp::endpoint;
Expand Down
72 changes: 72 additions & 0 deletions swig/libtorrent_jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3025,6 +3025,78 @@ SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_dele
}


SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_new_1high_1resolution_1clock_1time_1point(JNIEnv *jenv, jclass jcls) {
jlong jresult = 0 ;
boost::chrono::high_resolution_clock::time_point *result = 0 ;

(void)jenv;
(void)jcls;
{
try {
result = (boost::chrono::high_resolution_clock::time_point *)new boost::chrono::high_resolution_clock::time_point();
} catch (...) {
translate_cpp_exception(jenv);
return 0;
}
}
*(boost::chrono::high_resolution_clock::time_point **)&jresult = result;
return jresult;
}


SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_delete_1high_1resolution_1clock_1time_1point(JNIEnv *jenv, jclass jcls, jlong jarg1) {
boost::chrono::high_resolution_clock::time_point *arg1 = (boost::chrono::high_resolution_clock::time_point *) 0 ;

(void)jenv;
(void)jcls;
arg1 = *(boost::chrono::high_resolution_clock::time_point **)&jarg1;
{
try {
delete arg1;
} catch (...) {
translate_cpp_exception(jenv);
return ;
}
}
}


SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_new_1high_1resolution_1clock(JNIEnv *jenv, jclass jcls) {
jlong jresult = 0 ;
boost::chrono::high_resolution_clock *result = 0 ;

(void)jenv;
(void)jcls;
{
try {
result = (boost::chrono::high_resolution_clock *)new boost::chrono::high_resolution_clock();
} catch (...) {
translate_cpp_exception(jenv);
return 0;
}
}
*(boost::chrono::high_resolution_clock **)&jresult = result;
return jresult;
}


SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_delete_1high_1resolution_1clock(JNIEnv *jenv, jclass jcls, jlong jarg1) {
boost::chrono::high_resolution_clock *arg1 = (boost::chrono::high_resolution_clock *) 0 ;

(void)jenv;
(void)jcls;
arg1 = *(boost::chrono::high_resolution_clock **)&jarg1;
{
try {
delete arg1;
} catch (...) {
translate_cpp_exception(jenv);
return ;
}
}
}


SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_tcp_1endpoint_1port(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jint jresult = 0 ;
tcp::endpoint *arg1 = (tcp::endpoint *) 0 ;
Expand Down

0 comments on commit 92e5534

Please sign in to comment.