Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
8701e69d712f4894af721ad94452fa2a5044f9d6
[simgrid.git] / src / bindings / java / org / simgrid / surf / surfJAVA_wrap.cxx
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 2.0.12
4  *
5  * This file is not intended to be easily readable and contains a number of
6  * coding conventions designed to improve portability and efficiency. Do not make
7  * changes to this file unless you know what you are doing--modify the SWIG
8  * interface file instead.
9  * ----------------------------------------------------------------------------- */
10
11 #define SWIGJAVA
12 #define SWIG_DIRECTORS
13
14
15 #ifdef __cplusplus
16 /* SwigValueWrapper is described in swig.swg */
17 template<typename T> class SwigValueWrapper {
18   struct SwigMovePointer {
19     T *ptr;
20     SwigMovePointer(T *p) : ptr(p) { }
21     ~SwigMovePointer() { delete ptr; }
22     SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
23   } pointer;
24   SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
25   SwigValueWrapper(const SwigValueWrapper<T>& rhs);
26 public:
27   SwigValueWrapper() : pointer(0) { }
28   SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
29   operator T&() const { return *pointer.ptr; }
30   T *operator&() { return pointer.ptr; }
31 };
32
33 template <typename T> T SwigValueInit() {
34   return T();
35 }
36 #endif
37
38 /* -----------------------------------------------------------------------------
39  *  This section contains generic SWIG labels for method/variable
40  *  declarations/attributes, and other compiler dependent labels.
41  * ----------------------------------------------------------------------------- */
42
43 /* template workaround for compilers that cannot correctly implement the C++ standard */
44 #ifndef SWIGTEMPLATEDISAMBIGUATOR
45 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
46 #  define SWIGTEMPLATEDISAMBIGUATOR template
47 # elif defined(__HP_aCC)
48 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
49 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
50 #  define SWIGTEMPLATEDISAMBIGUATOR template
51 # else
52 #  define SWIGTEMPLATEDISAMBIGUATOR
53 # endif
54 #endif
55
56 /* inline attribute */
57 #ifndef SWIGINLINE
58 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
59 #   define SWIGINLINE inline
60 # else
61 #   define SWIGINLINE
62 # endif
63 #endif
64
65 /* attribute recognised by some compilers to avoid 'unused' warnings */
66 #ifndef SWIGUNUSED
67 # if defined(__GNUC__)
68 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
69 #     define SWIGUNUSED __attribute__ ((__unused__))
70 #   else
71 #     define SWIGUNUSED
72 #   endif
73 # elif defined(__ICC)
74 #   define SWIGUNUSED __attribute__ ((__unused__))
75 # else
76 #   define SWIGUNUSED
77 # endif
78 #endif
79
80 #ifndef SWIG_MSC_UNSUPPRESS_4505
81 # if defined(_MSC_VER)
82 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
83 # endif
84 #endif
85
86 #ifndef SWIGUNUSEDPARM
87 # ifdef __cplusplus
88 #   define SWIGUNUSEDPARM(p)
89 # else
90 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
91 # endif
92 #endif
93
94 /* internal SWIG method */
95 #ifndef SWIGINTERN
96 # define SWIGINTERN static SWIGUNUSED
97 #endif
98
99 /* internal inline SWIG method */
100 #ifndef SWIGINTERNINLINE
101 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
102 #endif
103
104 /* exporting methods */
105 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
106 #  ifndef GCC_HASCLASSVISIBILITY
107 #    define GCC_HASCLASSVISIBILITY
108 #  endif
109 #endif
110
111 #ifndef SWIGEXPORT
112 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
113 #   if defined(STATIC_LINKED)
114 #     define SWIGEXPORT
115 #   else
116 #     define SWIGEXPORT __declspec(dllexport)
117 #   endif
118 # else
119 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
120 #     define SWIGEXPORT __attribute__ ((visibility("default")))
121 #   else
122 #     define SWIGEXPORT
123 #   endif
124 # endif
125 #endif
126
127 /* calling conventions for Windows */
128 #ifndef SWIGSTDCALL
129 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
130 #   define SWIGSTDCALL __stdcall
131 # else
132 #   define SWIGSTDCALL
133 # endif
134 #endif
135
136 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
137 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
138 # define _CRT_SECURE_NO_DEPRECATE
139 #endif
140
141 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
142 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
143 # define _SCL_SECURE_NO_DEPRECATE
144 #endif
145
146
147
148 /* Fix for jlong on some versions of gcc on Windows */
149 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
150   typedef long long __int64;
151 #endif
152
153 /* Fix for jlong on 64-bit x86 Solaris */
154 #if defined(__x86_64)
155 # ifdef _LP64
156 #   undef _LP64
157 # endif
158 #endif
159
160 #include <jni.h>
161 #include <stdlib.h>
162 #include <string.h>
163
164
165 /* Support for throwing Java exceptions */
166 typedef enum {
167   SWIG_JavaOutOfMemoryError = 1, 
168   SWIG_JavaIOException, 
169   SWIG_JavaRuntimeException, 
170   SWIG_JavaIndexOutOfBoundsException,
171   SWIG_JavaArithmeticException,
172   SWIG_JavaIllegalArgumentException,
173   SWIG_JavaNullPointerException,
174   SWIG_JavaDirectorPureVirtual,
175   SWIG_JavaUnknownError
176 } SWIG_JavaExceptionCodes;
177
178 typedef struct {
179   SWIG_JavaExceptionCodes code;
180   const char *java_exception;
181 } SWIG_JavaExceptions_t;
182
183
184 static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {
185   jclass excep;
186   static const SWIG_JavaExceptions_t java_exceptions[] = {
187     { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
188     { SWIG_JavaIOException, "java/io/IOException" },
189     { SWIG_JavaRuntimeException, "java/lang/RuntimeException" },
190     { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" },
191     { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" },
192     { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" },
193     { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
194     { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
195     { SWIG_JavaUnknownError,  "java/lang/UnknownError" },
196     { (SWIG_JavaExceptionCodes)0,  "java/lang/UnknownError" }
197   };
198   const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
199
200   while (except_ptr->code != code && except_ptr->code)
201     except_ptr++;
202
203   jenv->ExceptionClear();
204   excep = jenv->FindClass(except_ptr->java_exception);
205   if (excep)
206     jenv->ThrowNew(excep, msg);
207 }
208
209
210 /* Contract support */
211
212 #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
213
214 /* -----------------------------------------------------------------------------
215  * director.swg
216  *
217  * This file contains support for director classes that proxy
218  * method calls from C++ to Java extensions.
219  * ----------------------------------------------------------------------------- */
220
221 #ifdef __cplusplus
222
223 #if defined(DEBUG_DIRECTOR_OWNED)
224 #include <iostream>
225 #endif
226
227 namespace Swig {
228   /* Java object wrapper */
229   class JObjectWrapper {
230   public:
231     JObjectWrapper() : jthis_(NULL), weak_global_(true) {
232     }
233
234     ~JObjectWrapper() {
235       jthis_ = NULL;
236       weak_global_ = true;
237     }
238
239     bool set(JNIEnv *jenv, jobject jobj, bool mem_own, bool weak_global) {
240       if (!jthis_) {
241         weak_global_ = weak_global || !mem_own; // hold as weak global if explicitly requested or not owned
242         if (jobj)
243           jthis_ = weak_global_ ? jenv->NewWeakGlobalRef(jobj) : jenv->NewGlobalRef(jobj);
244 #if defined(DEBUG_DIRECTOR_OWNED)
245         std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> " << jthis_ << std::endl;
246 #endif
247         return true;
248       } else {
249 #if defined(DEBUG_DIRECTOR_OWNED)
250         std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> already set" << std::endl;
251 #endif
252         return false;
253       }
254     }
255
256     jobject get(JNIEnv *jenv) const {
257 #if defined(DEBUG_DIRECTOR_OWNED)
258       std::cout << "JObjectWrapper::get(";
259       if (jthis_)
260         std::cout << jthis_;
261       else
262         std::cout << "null";
263       std::cout << ") -> return new local ref" << std::endl;
264 #endif
265       return (jthis_ ? jenv->NewLocalRef(jthis_) : jthis_);
266     }
267
268     void release(JNIEnv *jenv) {
269 #if defined(DEBUG_DIRECTOR_OWNED)
270       std::cout << "JObjectWrapper::release(" << jthis_ << "): " << (weak_global_ ? "weak global ref" : "global ref") << std::endl;
271 #endif
272       if (jthis_) {
273         if (weak_global_) {
274           if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE)
275             jenv->DeleteWeakGlobalRef((jweak)jthis_);
276         } else
277           jenv->DeleteGlobalRef(jthis_);
278       }
279
280       jthis_ = NULL;
281       weak_global_ = true;
282     }
283
284     /* Only call peek if you know what you are doing wrt to weak/global references */
285     jobject peek() {
286       return jthis_;
287     }
288
289     /* Java proxy releases ownership of C++ object, C++ object is now
290        responsible for destruction (creates NewGlobalRef to pin Java
291        proxy) */
292     void java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) {
293       if (take_or_release) {  /* Java takes ownership of C++ object's lifetime. */
294         if (!weak_global_) {
295           jenv->DeleteGlobalRef(jthis_);
296           jthis_ = jenv->NewWeakGlobalRef(jself);
297           weak_global_ = true;
298         }
299       } else { /* Java releases ownership of C++ object's lifetime */
300         if (weak_global_) {
301           jenv->DeleteWeakGlobalRef((jweak)jthis_);
302           jthis_ = jenv->NewGlobalRef(jself);
303           weak_global_ = false;
304         }
305       }
306     }
307
308   private:
309     /* pointer to Java object */
310     jobject jthis_;
311     /* Local or global reference flag */
312     bool weak_global_;
313   };
314
315   /* director base class */
316   class Director {
317     /* pointer to Java virtual machine */
318     JavaVM *swig_jvm_;
319
320   protected:
321 #if defined (_MSC_VER) && (_MSC_VER<1300)
322     class JNIEnvWrapper;
323     friend class JNIEnvWrapper;
324 #endif
325     /* Utility class for managing the JNI environment */
326     class JNIEnvWrapper {
327       const Director *director_;
328       JNIEnv *jenv_;
329       int env_status;
330     public:
331       JNIEnvWrapper(const Director *director) : director_(director), jenv_(0), env_status(0) {
332 #if defined(__ANDROID__)
333         JNIEnv **jenv = &jenv_;
334 #else
335         void **jenv = (void **)&jenv_;
336 #endif
337         env_status = director_->swig_jvm_->GetEnv((void **)&jenv_, JNI_VERSION_1_2);
338 #if defined(SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON)
339         // Attach a daemon thread to the JVM. Useful when the JVM should not wait for 
340         // the thread to exit upon shutdown. Only for jdk-1.4 and later.
341         director_->swig_jvm_->AttachCurrentThreadAsDaemon(jenv, NULL);
342 #else
343         director_->swig_jvm_->AttachCurrentThread(jenv, NULL);
344 #endif
345       }
346       ~JNIEnvWrapper() {
347 #if !defined(SWIG_JAVA_NO_DETACH_CURRENT_THREAD)
348         // Some JVMs, eg jdk-1.4.2 and lower on Solaris have a bug and crash with the DetachCurrentThread call.
349         // However, without this call, the JVM hangs on exit when the thread was not created by the JVM and creates a memory leak.
350         if (env_status == JNI_EDETACHED)
351           director_->swig_jvm_->DetachCurrentThread();
352 #endif
353       }
354       JNIEnv *getJNIEnv() const {
355         return jenv_;
356       }
357     };
358
359     /* Java object wrapper */
360     JObjectWrapper swig_self_;
361
362     /* Disconnect director from Java object */
363     void swig_disconnect_director_self(const char *disconn_method) {
364       JNIEnvWrapper jnienv(this) ;
365       JNIEnv *jenv = jnienv.getJNIEnv() ;
366       jobject jobj = swig_self_.get(jenv);
367 #if defined(DEBUG_DIRECTOR_OWNED)
368       std::cout << "Swig::Director::disconnect_director_self(" << jobj << ")" << std::endl;
369 #endif
370       if (jobj && jenv->IsSameObject(jobj, NULL) == JNI_FALSE) {
371         jmethodID disconn_meth = jenv->GetMethodID(jenv->GetObjectClass(jobj), disconn_method, "()V");
372         if (disconn_meth) {
373 #if defined(DEBUG_DIRECTOR_OWNED)
374           std::cout << "Swig::Director::disconnect_director_self upcall to " << disconn_method << std::endl;
375 #endif
376           jenv->CallVoidMethod(jobj, disconn_meth);
377         }
378       }
379       jenv->DeleteLocalRef(jobj);
380     }
381
382   public:
383     Director(JNIEnv *jenv) : swig_jvm_((JavaVM *) NULL), swig_self_() {
384       /* Acquire the Java VM pointer */
385       jenv->GetJavaVM(&swig_jvm_);
386     }
387
388     virtual ~Director() {
389       JNIEnvWrapper jnienv(this) ;
390       JNIEnv *jenv = jnienv.getJNIEnv() ;
391       swig_self_.release(jenv);
392     }
393
394     bool swig_set_self(JNIEnv *jenv, jobject jself, bool mem_own, bool weak_global) {
395       return swig_self_.set(jenv, jself, mem_own, weak_global);
396     }
397
398     jobject swig_get_self(JNIEnv *jenv) const {
399       return swig_self_.get(jenv);
400     }
401
402     // Change C++ object's ownership, relative to Java
403     void swig_java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) {
404       swig_self_.java_change_ownership(jenv, jself, take_or_release);
405     }
406   };
407 }
408
409 #endif /* __cplusplus */
410
411
412 namespace Swig {
413   namespace {
414     jclass jclass_SurfJNI = NULL;
415     jmethodID director_methids[34];
416   }
417 }
418
419 #if defined(SWIG_NOINCLUDE) || defined(SWIG_NOARRAYS)
420
421
422 static int SWIG_JavaArrayInBool (JNIEnv *jenv, jboolean **jarr, bool **carr, jbooleanArray input);
423 static void SWIG_JavaArrayArgoutBool (JNIEnv *jenv, jboolean *jarr, bool *carr, jbooleanArray input);
424 static jbooleanArray SWIG_JavaArrayOutBool (JNIEnv *jenv, bool *result, jsize sz);
425
426
427 static int SWIG_JavaArrayInSchar (JNIEnv *jenv, jbyte **jarr, signed char **carr, jbyteArray input);
428 static void SWIG_JavaArrayArgoutSchar (JNIEnv *jenv, jbyte *jarr, signed char *carr, jbyteArray input);
429 static jbyteArray SWIG_JavaArrayOutSchar (JNIEnv *jenv, signed char *result, jsize sz);
430
431
432 static int SWIG_JavaArrayInUchar (JNIEnv *jenv, jshort **jarr, unsigned char **carr, jshortArray input);
433 static void SWIG_JavaArrayArgoutUchar (JNIEnv *jenv, jshort *jarr, unsigned char *carr, jshortArray input);
434 static jshortArray SWIG_JavaArrayOutUchar (JNIEnv *jenv, unsigned char *result, jsize sz);
435
436
437 static int SWIG_JavaArrayInShort (JNIEnv *jenv, jshort **jarr, short **carr, jshortArray input);
438 static void SWIG_JavaArrayArgoutShort (JNIEnv *jenv, jshort *jarr, short *carr, jshortArray input);
439 static jshortArray SWIG_JavaArrayOutShort (JNIEnv *jenv, short *result, jsize sz);
440
441
442 static int SWIG_JavaArrayInUshort (JNIEnv *jenv, jint **jarr, unsigned short **carr, jintArray input);
443 static void SWIG_JavaArrayArgoutUshort (JNIEnv *jenv, jint *jarr, unsigned short *carr, jintArray input);
444 static jintArray SWIG_JavaArrayOutUshort (JNIEnv *jenv, unsigned short *result, jsize sz);
445
446
447 static int SWIG_JavaArrayInInt (JNIEnv *jenv, jint **jarr, int **carr, jintArray input);
448 static void SWIG_JavaArrayArgoutInt (JNIEnv *jenv, jint *jarr, int *carr, jintArray input);
449 static jintArray SWIG_JavaArrayOutInt (JNIEnv *jenv, int *result, jsize sz);
450
451
452 static int SWIG_JavaArrayInUint (JNIEnv *jenv, jlong **jarr, unsigned int **carr, jlongArray input);
453 static void SWIG_JavaArrayArgoutUint (JNIEnv *jenv, jlong *jarr, unsigned int *carr, jlongArray input);
454 static jlongArray SWIG_JavaArrayOutUint (JNIEnv *jenv, unsigned int *result, jsize sz);
455
456
457 static int SWIG_JavaArrayInLong (JNIEnv *jenv, jint **jarr, long **carr, jintArray input);
458 static void SWIG_JavaArrayArgoutLong (JNIEnv *jenv, jint *jarr, long *carr, jintArray input);
459 static jintArray SWIG_JavaArrayOutLong (JNIEnv *jenv, long *result, jsize sz);
460
461
462 static int SWIG_JavaArrayInUlong (JNIEnv *jenv, jlong **jarr, unsigned long **carr, jlongArray input);
463 static void SWIG_JavaArrayArgoutUlong (JNIEnv *jenv, jlong *jarr, unsigned long *carr, jlongArray input);
464 static jlongArray SWIG_JavaArrayOutUlong (JNIEnv *jenv, unsigned long *result, jsize sz);
465
466
467 static int SWIG_JavaArrayInLonglong (JNIEnv *jenv, jlong **jarr, jlong **carr, jlongArray input);
468 static void SWIG_JavaArrayArgoutLonglong (JNIEnv *jenv, jlong *jarr, jlong *carr, jlongArray input);
469 static jlongArray SWIG_JavaArrayOutLonglong (JNIEnv *jenv, jlong *result, jsize sz);
470
471
472 static int SWIG_JavaArrayInFloat (JNIEnv *jenv, jfloat **jarr, float **carr, jfloatArray input);
473 static void SWIG_JavaArrayArgoutFloat (JNIEnv *jenv, jfloat *jarr, float *carr, jfloatArray input);
474 static jfloatArray SWIG_JavaArrayOutFloat (JNIEnv *jenv, float *result, jsize sz);
475
476
477 static int SWIG_JavaArrayInDouble (JNIEnv *jenv, jdouble **jarr, double **carr, jdoubleArray input);
478 static void SWIG_JavaArrayArgoutDouble (JNIEnv *jenv, jdouble *jarr, double *carr, jdoubleArray input);
479 static jdoubleArray SWIG_JavaArrayOutDouble (JNIEnv *jenv, double *result, jsize sz);
480
481
482 #else
483
484
485 /* bool[] support */
486 static int SWIG_JavaArrayInBool (JNIEnv *jenv, jboolean **jarr, bool **carr, jbooleanArray input) {
487   int i;
488   jsize sz;
489   if (!input) {
490     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array");
491     return 0;
492   }
493   sz = jenv->GetArrayLength(input);
494   *jarr = jenv->GetBooleanArrayElements(input, 0);
495   if (!*jarr)
496     return 0; 
497   *carr = new bool[sz]; 
498   if (!*carr) {
499     SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed");
500     return 0;
501   }
502   for (i=0; i<sz; i++)
503     (*carr)[i] = ((*jarr)[i] != 0);
504   return 1;
505 }
506
507 static void SWIG_JavaArrayArgoutBool (JNIEnv *jenv, jboolean *jarr, bool *carr, jbooleanArray input) {
508   int i;
509   jsize sz = jenv->GetArrayLength(input);
510   for (i=0; i<sz; i++)
511     jarr[i] = (jboolean)carr[i];
512   jenv->ReleaseBooleanArrayElements(input, jarr, 0);
513 }
514
515 static jbooleanArray SWIG_JavaArrayOutBool (JNIEnv *jenv, bool *result, jsize sz) {
516   jboolean *arr;
517   int i;
518   jbooleanArray jresult = jenv->NewBooleanArray(sz);
519   if (!jresult)
520     return NULL;
521   arr = jenv->GetBooleanArrayElements(jresult, 0);
522   if (!arr)
523     return NULL;
524   for (i=0; i<sz; i++)
525     arr[i] = (jboolean)result[i];
526   jenv->ReleaseBooleanArrayElements(jresult, arr, 0);
527   return jresult;
528 }
529
530
531 /* signed char[] support */
532 static int SWIG_JavaArrayInSchar (JNIEnv *jenv, jbyte **jarr, signed char **carr, jbyteArray input) {
533   int i;
534   jsize sz;
535   if (!input) {
536     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array");
537     return 0;
538   }
539   sz = jenv->GetArrayLength(input);
540   *jarr = jenv->GetByteArrayElements(input, 0);
541   if (!*jarr)
542     return 0; 
543   *carr = new signed char[sz]; 
544   if (!*carr) {
545     SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed");
546     return 0;
547   }
548   for (i=0; i<sz; i++)
549     (*carr)[i] = (signed char)(*jarr)[i];
550   return 1;
551 }
552
553 static void SWIG_JavaArrayArgoutSchar (JNIEnv *jenv, jbyte *jarr, signed char *carr, jbyteArray input) {
554   int i;
555   jsize sz = jenv->GetArrayLength(input);
556   for (i=0; i<sz; i++)
557     jarr[i] = (jbyte)carr[i];
558   jenv->ReleaseByteArrayElements(input, jarr, 0);
559 }
560
561 static jbyteArray SWIG_JavaArrayOutSchar (JNIEnv *jenv, signed char *result, jsize sz) {
562   jbyte *arr;
563   int i;
564   jbyteArray jresult = jenv->NewByteArray(sz);
565   if (!jresult)
566     return NULL;
567   arr = jenv->GetByteArrayElements(jresult, 0);
568   if (!arr)
569     return NULL;
570   for (i=0; i<sz; i++)
571     arr[i] = (jbyte)result[i];
572   jenv->ReleaseByteArrayElements(jresult, arr, 0);
573   return jresult;
574 }
575
576
577 /* unsigned char[] support */
578 static int SWIG_JavaArrayInUchar (JNIEnv *jenv, jshort **jarr, unsigned char **carr, jshortArray input) {
579   int i;
580   jsize sz;
581   if (!input) {
582     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array");
583     return 0;
584   }
585   sz = jenv->GetArrayLength(input);
586   *jarr = jenv->GetShortArrayElements(input, 0);
587   if (!*jarr)
588     return 0; 
589   *carr = new unsigned char[sz]; 
590   if (!*carr) {
591     SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed");
592     return 0;
593   }
594   for (i=0; i<sz; i++)
595     (*carr)[i] = (unsigned char)(*jarr)[i];
596   return 1;
597 }
598
599 static void SWIG_JavaArrayArgoutUchar (JNIEnv *jenv, jshort *jarr, unsigned char *carr, jshortArray input) {
600   int i;
601   jsize sz = jenv->GetArrayLength(input);
602   for (i=0; i<sz; i++)
603     jarr[i] = (jshort)carr[i];
604   jenv->ReleaseShortArrayElements(input, jarr, 0);
605 }
606
607 static jshortArray SWIG_JavaArrayOutUchar (JNIEnv *jenv, unsigned char *result, jsize sz) {
608   jshort *arr;
609   int i;
610   jshortArray jresult = jenv->NewShortArray(sz);
611   if (!jresult)
612     return NULL;
613   arr = jenv->GetShortArrayElements(jresult, 0);
614   if (!arr)
615     return NULL;
616   for (i=0; i<sz; i++)
617     arr[i] = (jshort)result[i];
618   jenv->ReleaseShortArrayElements(jresult, arr, 0);
619   return jresult;
620 }
621
622
623 /* short[] support */
624 static int SWIG_JavaArrayInShort (JNIEnv *jenv, jshort **jarr, short **carr, jshortArray input) {
625   int i;
626   jsize sz;
627   if (!input) {
628     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array");
629     return 0;
630   }
631   sz = jenv->GetArrayLength(input);
632   *jarr = jenv->GetShortArrayElements(input, 0);
633   if (!*jarr)
634     return 0; 
635   *carr = new short[sz]; 
636   if (!*carr) {
637     SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed");
638     return 0;
639   }
640   for (i=0; i<sz; i++)
641     (*carr)[i] = (short)(*jarr)[i];
642   return 1;
643 }
644
645 static void SWIG_JavaArrayArgoutShort (JNIEnv *jenv, jshort *jarr, short *carr, jshortArray input) {
646   int i;
647   jsize sz = jenv->GetArrayLength(input);
648   for (i=0; i<sz; i++)
649     jarr[i] = (jshort)carr[i];
650   jenv->ReleaseShortArrayElements(input, jarr, 0);
651 }
652
653 static jshortArray SWIG_JavaArrayOutShort (JNIEnv *jenv, short *result, jsize sz) {
654   jshort *arr;
655   int i;
656   jshortArray jresult = jenv->NewShortArray(sz);
657   if (!jresult)
658     return NULL;
659   arr = jenv->GetShortArrayElements(jresult, 0);
660   if (!arr)
661     return NULL;
662   for (i=0; i<sz; i++)
663     arr[i] = (jshort)result[i];
664   jenv->ReleaseShortArrayElements(jresult, arr, 0);
665   return jresult;
666 }
667
668
669 /* unsigned short[] support */
670 static int SWIG_JavaArrayInUshort (JNIEnv *jenv, jint **jarr, unsigned short **carr, jintArray input) {
671   int i;
672   jsize sz;
673   if (!input) {
674     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array");
675     return 0;
676   }
677   sz = jenv->GetArrayLength(input);
678   *jarr = jenv->GetIntArrayElements(input, 0);
679   if (!*jarr)
680     return 0; 
681   *carr = new unsigned short[sz]; 
682   if (!*carr) {
683     SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed");
684     return 0;
685   }
686   for (i=0; i<sz; i++)
687     (*carr)[i] = (unsigned short)(*jarr)[i];
688   return 1;
689 }
690
691 static void SWIG_JavaArrayArgoutUshort (JNIEnv *jenv, jint *jarr, unsigned short *carr, jintArray input) {
692   int i;
693   jsize sz = jenv->GetArrayLength(input);
694   for (i=0; i<sz; i++)
695     jarr[i] = (jint)carr[i];
696   jenv->ReleaseIntArrayElements(input, jarr, 0);
697 }
698
699 static jintArray SWIG_JavaArrayOutUshort (JNIEnv *jenv, unsigned short *result, jsize sz) {
700   jint *arr;
701   int i;
702   jintArray jresult = jenv->NewIntArray(sz);
703   if (!jresult)
704     return NULL;
705   arr = jenv->GetIntArrayElements(jresult, 0);
706   if (!arr)
707     return NULL;
708   for (i=0; i<sz; i++)
709     arr[i] = (jint)result[i];
710   jenv->ReleaseIntArrayElements(jresult, arr, 0);
711   return jresult;
712 }
713
714
715 /* int[] support */
716 static int SWIG_JavaArrayInInt (JNIEnv *jenv, jint **jarr, int **carr, jintArray input) {
717   int i;
718   jsize sz;
719   if (!input) {
720     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array");
721     return 0;
722   }
723   sz = jenv->GetArrayLength(input);
724   *jarr = jenv->GetIntArrayElements(input, 0);
725   if (!*jarr)
726     return 0; 
727   *carr = new int[sz]; 
728   if (!*carr) {
729     SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed");
730     return 0;
731   }
732   for (i=0; i<sz; i++)
733     (*carr)[i] = (int)(*jarr)[i];
734   return 1;
735 }
736
737 static void SWIG_JavaArrayArgoutInt (JNIEnv *jenv, jint *jarr, int *carr, jintArray input) {
738   int i;
739   jsize sz = jenv->GetArrayLength(input);
740   for (i=0; i<sz; i++)
741     jarr[i] = (jint)carr[i];
742   jenv->ReleaseIntArrayElements(input, jarr, 0);
743 }
744
745 static jintArray SWIG_JavaArrayOutInt (JNIEnv *jenv, int *result, jsize sz) {
746   jint *arr;
747   int i;
748   jintArray jresult = jenv->NewIntArray(sz);
749   if (!jresult)
750     return NULL;
751   arr = jenv->GetIntArrayElements(jresult, 0);
752   if (!arr)
753     return NULL;
754   for (i=0; i<sz; i++)
755     arr[i] = (jint)result[i];
756   jenv->ReleaseIntArrayElements(jresult, arr, 0);
757   return jresult;
758 }
759
760
761 /* unsigned int[] support */
762 static int SWIG_JavaArrayInUint (JNIEnv *jenv, jlong **jarr, unsigned int **carr, jlongArray input) {
763   int i;
764   jsize sz;
765   if (!input) {
766     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array");
767     return 0;
768   }
769   sz = jenv->GetArrayLength(input);
770   *jarr = jenv->GetLongArrayElements(input, 0);
771   if (!*jarr)
772     return 0; 
773   *carr = new unsigned int[sz]; 
774   if (!*carr) {
775     SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed");
776     return 0;
777   }
778   for (i=0; i<sz; i++)
779     (*carr)[i] = (unsigned int)(*jarr)[i];
780   return 1;
781 }
782
783 static void SWIG_JavaArrayArgoutUint (JNIEnv *jenv, jlong *jarr, unsigned int *carr, jlongArray input) {
784   int i;
785   jsize sz = jenv->GetArrayLength(input);
786   for (i=0; i<sz; i++)
787     jarr[i] = (jlong)carr[i];
788   jenv->ReleaseLongArrayElements(input, jarr, 0);
789 }
790
791 static jlongArray SWIG_JavaArrayOutUint (JNIEnv *jenv, unsigned int *result, jsize sz) {
792   jlong *arr;
793   int i;
794   jlongArray jresult = jenv->NewLongArray(sz);
795   if (!jresult)
796     return NULL;
797   arr = jenv->GetLongArrayElements(jresult, 0);
798   if (!arr)
799     return NULL;
800   for (i=0; i<sz; i++)
801     arr[i] = (jlong)result[i];
802   jenv->ReleaseLongArrayElements(jresult, arr, 0);
803   return jresult;
804 }
805
806
807 /* long[] support */
808 static int SWIG_JavaArrayInLong (JNIEnv *jenv, jint **jarr, long **carr, jintArray input) {
809   int i;
810   jsize sz;
811   if (!input) {
812     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array");
813     return 0;
814   }
815   sz = jenv->GetArrayLength(input);
816   *jarr = jenv->GetIntArrayElements(input, 0);
817   if (!*jarr)
818     return 0; 
819   *carr = new long[sz]; 
820   if (!*carr) {
821     SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed");
822     return 0;
823   }
824   for (i=0; i<sz; i++)
825     (*carr)[i] = (long)(*jarr)[i];
826   return 1;
827 }
828
829 static void SWIG_JavaArrayArgoutLong (JNIEnv *jenv, jint *jarr, long *carr, jintArray input) {
830   int i;
831   jsize sz = jenv->GetArrayLength(input);
832   for (i=0; i<sz; i++)
833     jarr[i] = (jint)carr[i];
834   jenv->ReleaseIntArrayElements(input, jarr, 0);
835 }
836
837 static jintArray SWIG_JavaArrayOutLong (JNIEnv *jenv, long *result, jsize sz) {
838   jint *arr;
839   int i;
840   jintArray jresult = jenv->NewIntArray(sz);
841   if (!jresult)
842     return NULL;
843   arr = jenv->GetIntArrayElements(jresult, 0);
844   if (!arr)
845     return NULL;
846   for (i=0; i<sz; i++)
847     arr[i] = (jint)result[i];
848   jenv->ReleaseIntArrayElements(jresult, arr, 0);
849   return jresult;
850 }
851
852
853 /* unsigned long[] support */
854 static int SWIG_JavaArrayInUlong (JNIEnv *jenv, jlong **jarr, unsigned long **carr, jlongArray input) {
855   int i;
856   jsize sz;
857   if (!input) {
858     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array");
859     return 0;
860   }
861   sz = jenv->GetArrayLength(input);
862   *jarr = jenv->GetLongArrayElements(input, 0);
863   if (!*jarr)
864     return 0; 
865   *carr = new unsigned long[sz]; 
866   if (!*carr) {
867     SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed");
868     return 0;
869   }
870   for (i=0; i<sz; i++)
871     (*carr)[i] = (unsigned long)(*jarr)[i];
872   return 1;
873 }
874
875 static void SWIG_JavaArrayArgoutUlong (JNIEnv *jenv, jlong *jarr, unsigned long *carr, jlongArray input) {
876   int i;
877   jsize sz = jenv->GetArrayLength(input);
878   for (i=0; i<sz; i++)
879     jarr[i] = (jlong)carr[i];
880   jenv->ReleaseLongArrayElements(input, jarr, 0);
881 }
882
883 static jlongArray SWIG_JavaArrayOutUlong (JNIEnv *jenv, unsigned long *result, jsize sz) {
884   jlong *arr;
885   int i;
886   jlongArray jresult = jenv->NewLongArray(sz);
887   if (!jresult)
888     return NULL;
889   arr = jenv->GetLongArrayElements(jresult, 0);
890   if (!arr)
891     return NULL;
892   for (i=0; i<sz; i++)
893     arr[i] = (jlong)result[i];
894   jenv->ReleaseLongArrayElements(jresult, arr, 0);
895   return jresult;
896 }
897
898
899 /* jlong[] support */
900 static int SWIG_JavaArrayInLonglong (JNIEnv *jenv, jlong **jarr, jlong **carr, jlongArray input) {
901   int i;
902   jsize sz;
903   if (!input) {
904     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array");
905     return 0;
906   }
907   sz = jenv->GetArrayLength(input);
908   *jarr = jenv->GetLongArrayElements(input, 0);
909   if (!*jarr)
910     return 0; 
911   *carr = new jlong[sz]; 
912   if (!*carr) {
913     SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed");
914     return 0;
915   }
916   for (i=0; i<sz; i++)
917     (*carr)[i] = (jlong)(*jarr)[i];
918   return 1;
919 }
920
921 static void SWIG_JavaArrayArgoutLonglong (JNIEnv *jenv, jlong *jarr, jlong *carr, jlongArray input) {
922   int i;
923   jsize sz = jenv->GetArrayLength(input);
924   for (i=0; i<sz; i++)
925     jarr[i] = (jlong)carr[i];
926   jenv->ReleaseLongArrayElements(input, jarr, 0);
927 }
928
929 static jlongArray SWIG_JavaArrayOutLonglong (JNIEnv *jenv, jlong *result, jsize sz) {
930   jlong *arr;
931   int i;
932   jlongArray jresult = jenv->NewLongArray(sz);
933   if (!jresult)
934     return NULL;
935   arr = jenv->GetLongArrayElements(jresult, 0);
936   if (!arr)
937     return NULL;
938   for (i=0; i<sz; i++)
939     arr[i] = (jlong)result[i];
940   jenv->ReleaseLongArrayElements(jresult, arr, 0);
941   return jresult;
942 }
943
944
945 /* float[] support */
946 static int SWIG_JavaArrayInFloat (JNIEnv *jenv, jfloat **jarr, float **carr, jfloatArray input) {
947   int i;
948   jsize sz;
949   if (!input) {
950     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array");
951     return 0;
952   }
953   sz = jenv->GetArrayLength(input);
954   *jarr = jenv->GetFloatArrayElements(input, 0);
955   if (!*jarr)
956     return 0; 
957   *carr = new float[sz]; 
958   if (!*carr) {
959     SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed");
960     return 0;
961   }
962   for (i=0; i<sz; i++)
963     (*carr)[i] = (float)(*jarr)[i];
964   return 1;
965 }
966
967 static void SWIG_JavaArrayArgoutFloat (JNIEnv *jenv, jfloat *jarr, float *carr, jfloatArray input) {
968   int i;
969   jsize sz = jenv->GetArrayLength(input);
970   for (i=0; i<sz; i++)
971     jarr[i] = (jfloat)carr[i];
972   jenv->ReleaseFloatArrayElements(input, jarr, 0);
973 }
974
975 static jfloatArray SWIG_JavaArrayOutFloat (JNIEnv *jenv, float *result, jsize sz) {
976   jfloat *arr;
977   int i;
978   jfloatArray jresult = jenv->NewFloatArray(sz);
979   if (!jresult)
980     return NULL;
981   arr = jenv->GetFloatArrayElements(jresult, 0);
982   if (!arr)
983     return NULL;
984   for (i=0; i<sz; i++)
985     arr[i] = (jfloat)result[i];
986   jenv->ReleaseFloatArrayElements(jresult, arr, 0);
987   return jresult;
988 }
989
990
991 /* double[] support */
992 static int SWIG_JavaArrayInDouble (JNIEnv *jenv, jdouble **jarr, double **carr, jdoubleArray input) {
993   int i;
994   jsize sz;
995   if (!input) {
996     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array");
997     return 0;
998   }
999   sz = jenv->GetArrayLength(input);
1000   *jarr = jenv->GetDoubleArrayElements(input, 0);
1001   if (!*jarr)
1002     return 0; 
1003   *carr = new double[sz]; 
1004   if (!*carr) {
1005     SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed");
1006     return 0;
1007   }
1008   for (i=0; i<sz; i++)
1009     (*carr)[i] = (double)(*jarr)[i];
1010   return 1;
1011 }
1012
1013 static void SWIG_JavaArrayArgoutDouble (JNIEnv *jenv, jdouble *jarr, double *carr, jdoubleArray input) {
1014   int i;
1015   jsize sz = jenv->GetArrayLength(input);
1016   for (i=0; i<sz; i++)
1017     jarr[i] = (jdouble)carr[i];
1018   jenv->ReleaseDoubleArrayElements(input, jarr, 0);
1019 }
1020
1021 static jdoubleArray SWIG_JavaArrayOutDouble (JNIEnv *jenv, double *result, jsize sz) {
1022   jdouble *arr;
1023   int i;
1024   jdoubleArray jresult = jenv->NewDoubleArray(sz);
1025   if (!jresult)
1026     return NULL;
1027   arr = jenv->GetDoubleArrayElements(jresult, 0);
1028   if (!arr)
1029     return NULL;
1030   for (i=0; i<sz; i++)
1031     arr[i] = (jdouble)result[i];
1032   jenv->ReleaseDoubleArrayElements(jresult, arr, 0);
1033   return jresult;
1034 }
1035
1036
1037 #endif
1038
1039
1040 #include <string>
1041
1042
1043 #include "src/surf/surf_interface.hpp"
1044 #include "src/surf/cpu_interface.hpp"
1045 #include "src/surf/network_interface.hpp"
1046 #include "src/surf/trace_mgr_private.h"
1047 #include "src/bindings/java/surf_swig.hpp"
1048 #include "src/xbt/dict_private.h"
1049
1050 typedef struct lmm_constraint *lmm_constraint_t;
1051 typedef xbt_dynar_t DoubleDynar;
1052
1053 SWIGINTERN ActionArrayPtr simgrid_surf_ActionList_getArray(simgrid::surf::ActionList *self){
1054     return self;
1055   }
1056 SWIGINTERN unsigned int tmgr_trace_event_getIdx(tmgr_trace_event *self){return 0;}
1057 SWIGINTERN simgrid::surf::Cpu *simgrid_surf_CpuAction_getCpu(simgrid::surf::CpuAction *self){return getActionCpu(self);}
1058 SWIGINTERN double simgrid_surf_NetworkAction_getLatency(simgrid::surf::NetworkAction *self){return self->m_latency;}
1059 SWIGINTERN double lmm_constraint_getUsage(lmm_constraint *self){return lmm_constraint_get_usage(self);}
1060 SWIGINTERN double lmm_variable_getValue(lmm_variable *self){return lmm_variable_getvalue(self);}
1061 SWIGINTERN char *s_xbt_dict_getValue(s_xbt_dict *self,char *key){return (char*)xbt_dict_get_or_null(self, key);}
1062
1063
1064 /* ---------------------------------------------------
1065  * C++ director class methods
1066  * --------------------------------------------------- */
1067
1068 #include "surfJAVA_wrap.h"
1069
1070 SwigDirector_Plugin::SwigDirector_Plugin(JNIEnv *jenv) : Plugin(), Swig::Director(jenv) {
1071 }
1072
1073 SwigDirector_Plugin::~SwigDirector_Plugin() {
1074   swig_disconnect_director_self("swigDirectorDisconnect");
1075 }
1076
1077
1078 void SwigDirector_Plugin::cpuCreatedCallback(simgrid::surf::Cpu *cpu) {
1079   JNIEnvWrapper swigjnienv(this) ;
1080   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1081   jobject swigjobj = (jobject) NULL ;
1082   jlong jcpu = 0 ;
1083   
1084   if (!swig_override[0]) {
1085     Plugin::cpuCreatedCallback(cpu);
1086     return;
1087   }
1088   swigjobj = swig_get_self(jenv);
1089   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1090     *((simgrid::surf::Cpu **)&jcpu) = (simgrid::surf::Cpu *) cpu; 
1091     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[0], swigjobj, jcpu);
1092     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1093   } else {
1094     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1095   }
1096   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1097 }
1098
1099 void SwigDirector_Plugin::cpuDestructedCallback(simgrid::surf::Cpu *cpu) {
1100   JNIEnvWrapper swigjnienv(this) ;
1101   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1102   jobject swigjobj = (jobject) NULL ;
1103   jlong jcpu = 0 ;
1104   
1105   if (!swig_override[1]) {
1106     Plugin::cpuDestructedCallback(cpu);
1107     return;
1108   }
1109   swigjobj = swig_get_self(jenv);
1110   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1111     *((simgrid::surf::Cpu **)&jcpu) = (simgrid::surf::Cpu *) cpu; 
1112     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[1], swigjobj, jcpu);
1113     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1114   } else {
1115     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1116   }
1117   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1118 }
1119
1120 void SwigDirector_Plugin::cpuStateChangedCallback(simgrid::surf::Cpu *cpu, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2) {
1121   JNIEnvWrapper swigjnienv(this) ;
1122   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1123   jobject swigjobj = (jobject) NULL ;
1124   jlong jcpu = 0 ;
1125   jint jarg1  ;
1126   jint jarg2  ;
1127   
1128   if (!swig_override[2]) {
1129     Plugin::cpuStateChangedCallback(cpu,arg1,arg2);
1130     return;
1131   }
1132   swigjobj = swig_get_self(jenv);
1133   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1134     *((simgrid::surf::Cpu **)&jcpu) = (simgrid::surf::Cpu *) cpu; 
1135     jarg1 = (jint) arg1;
1136     jarg2 = (jint) arg2;
1137     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[2], swigjobj, jcpu, jarg1, jarg2);
1138     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1139   } else {
1140     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1141   }
1142   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1143 }
1144
1145 void SwigDirector_Plugin::cpuActionStateChangedCallback(simgrid::surf::CpuAction *action, e_surf_action_state_t arg1, e_surf_action_state_t arg2) {
1146   JNIEnvWrapper swigjnienv(this) ;
1147   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1148   jobject swigjobj = (jobject) NULL ;
1149   jlong jaction = 0 ;
1150   jint jarg1  ;
1151   jint jarg2  ;
1152   
1153   if (!swig_override[3]) {
1154     Plugin::cpuActionStateChangedCallback(action,arg1,arg2);
1155     return;
1156   }
1157   swigjobj = swig_get_self(jenv);
1158   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1159     *((simgrid::surf::CpuAction **)&jaction) = (simgrid::surf::CpuAction *) action; 
1160     jarg1 = (jint) arg1;
1161     jarg2 = (jint) arg2;
1162     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[3], swigjobj, jaction, jarg1, jarg2);
1163     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1164   } else {
1165     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1166   }
1167   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1168 }
1169
1170 void SwigDirector_Plugin::networkLinkCreatedCallback(simgrid::surf::Link *link) {
1171   JNIEnvWrapper swigjnienv(this) ;
1172   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1173   jobject swigjobj = (jobject) NULL ;
1174   jlong jlink = 0 ;
1175   
1176   if (!swig_override[4]) {
1177     Plugin::networkLinkCreatedCallback(link);
1178     return;
1179   }
1180   swigjobj = swig_get_self(jenv);
1181   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1182     *((simgrid::surf::Link **)&jlink) = (simgrid::surf::Link *) link; 
1183     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[4], swigjobj, jlink);
1184     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1185   } else {
1186     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1187   }
1188   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1189 }
1190
1191 void SwigDirector_Plugin::networkLinkDestructedCallback(simgrid::surf::Link *link) {
1192   JNIEnvWrapper swigjnienv(this) ;
1193   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1194   jobject swigjobj = (jobject) NULL ;
1195   jlong jlink = 0 ;
1196   
1197   if (!swig_override[5]) {
1198     Plugin::networkLinkDestructedCallback(link);
1199     return;
1200   }
1201   swigjobj = swig_get_self(jenv);
1202   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1203     *((simgrid::surf::Link **)&jlink) = (simgrid::surf::Link *) link; 
1204     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[5], swigjobj, jlink);
1205     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1206   } else {
1207     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1208   }
1209   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1210 }
1211
1212 void SwigDirector_Plugin::networkLinkStateChangedCallback(simgrid::surf::Link *link, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2) {
1213   JNIEnvWrapper swigjnienv(this) ;
1214   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1215   jobject swigjobj = (jobject) NULL ;
1216   jlong jlink = 0 ;
1217   jint jarg1  ;
1218   jint jarg2  ;
1219   
1220   if (!swig_override[6]) {
1221     Plugin::networkLinkStateChangedCallback(link,arg1,arg2);
1222     return;
1223   }
1224   swigjobj = swig_get_self(jenv);
1225   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1226     *((simgrid::surf::Link **)&jlink) = (simgrid::surf::Link *) link; 
1227     jarg1 = (jint) arg1;
1228     jarg2 = (jint) arg2;
1229     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[6], swigjobj, jlink, jarg1, jarg2);
1230     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1231   } else {
1232     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1233   }
1234   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1235 }
1236
1237 void SwigDirector_Plugin::networkActionStateChangedCallback(simgrid::surf::NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur) {
1238   JNIEnvWrapper swigjnienv(this) ;
1239   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1240   jobject swigjobj = (jobject) NULL ;
1241   jlong jaction = 0 ;
1242   jint jold  ;
1243   jint jcur  ;
1244   
1245   if (!swig_override[7]) {
1246     Plugin::networkActionStateChangedCallback(action,old,cur);
1247     return;
1248   }
1249   swigjobj = swig_get_self(jenv);
1250   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1251     *((simgrid::surf::NetworkAction **)&jaction) = (simgrid::surf::NetworkAction *) action; 
1252     jold = (jint) old;
1253     jcur = (jint) cur;
1254     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[7], swigjobj, jaction, jold, jcur);
1255     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1256   } else {
1257     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1258   }
1259   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1260 }
1261
1262 void SwigDirector_Plugin::networkCommunicateCallback(simgrid::surf::NetworkAction *action, simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst, double size, double rate) {
1263   JNIEnvWrapper swigjnienv(this) ;
1264   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1265   jobject swigjobj = (jobject) NULL ;
1266   jlong jaction = 0 ;
1267   jlong jsrc = 0 ;
1268   jlong jdst = 0 ;
1269   jdouble jsize  ;
1270   jdouble jrate  ;
1271   
1272   if (!swig_override[8]) {
1273     Plugin::networkCommunicateCallback(action,src,dst,size,rate);
1274     return;
1275   }
1276   swigjobj = swig_get_self(jenv);
1277   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1278     *((simgrid::surf::NetworkAction **)&jaction) = (simgrid::surf::NetworkAction *) action; 
1279     *((simgrid::surf::RoutingEdge **)&jsrc) = (simgrid::surf::RoutingEdge *) src; 
1280     *((simgrid::surf::RoutingEdge **)&jdst) = (simgrid::surf::RoutingEdge *) dst; 
1281     jsize = (jdouble) size;
1282     jrate = (jdouble) rate;
1283     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[8], swigjobj, jaction, jsrc, jdst, jsize, jrate);
1284     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1285   } else {
1286     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1287   }
1288   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1289 }
1290
1291 void SwigDirector_Plugin::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) {
1292   static struct {
1293     const char *mname;
1294     const char *mdesc;
1295     jmethodID base_methid;
1296   } methods[] = {
1297     {
1298       "cpuCreatedCallback", "(Lorg/simgrid/surf/Cpu;)V", NULL 
1299     },
1300     {
1301       "cpuDestructedCallback", "(Lorg/simgrid/surf/Cpu;)V", NULL 
1302     },
1303     {
1304       "cpuStateChangedCallback", "(Lorg/simgrid/surf/Cpu;Lorg/simgrid/surf/ResourceState;Lorg/simgrid/surf/ResourceState;)V", NULL 
1305     },
1306     {
1307       "cpuActionStateChangedCallback", "(Lorg/simgrid/surf/CpuAction;Lorg/simgrid/surf/ActionState;Lorg/simgrid/surf/ActionState;)V", NULL 
1308     },
1309     {
1310       "networkLinkCreatedCallback", "(Lorg/simgrid/surf/Link;)V", NULL 
1311     },
1312     {
1313       "networkLinkDestructedCallback", "(Lorg/simgrid/surf/Link;)V", NULL 
1314     },
1315     {
1316       "networkLinkStateChangedCallback", "(Lorg/simgrid/surf/Link;Lorg/simgrid/surf/ResourceState;Lorg/simgrid/surf/ResourceState;)V", NULL 
1317     },
1318     {
1319       "networkActionStateChangedCallback", "(Lorg/simgrid/surf/NetworkAction;Lorg/simgrid/surf/ActionState;Lorg/simgrid/surf/ActionState;)V", NULL 
1320     },
1321     {
1322       "networkCommunicateCallback", "(Lorg/simgrid/surf/NetworkAction;Lorg/simgrid/surf/RoutingEdge;Lorg/simgrid/surf/RoutingEdge;DD)V", NULL 
1323     }
1324   };
1325   
1326   static jclass baseclass = 0 ;
1327   
1328   if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) {
1329     if (!baseclass) {
1330       baseclass = jenv->FindClass("org/simgrid/surf/Plugin");
1331       if (!baseclass) return;
1332       baseclass = (jclass) jenv->NewGlobalRef(baseclass);
1333     }
1334     bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true);
1335     for (int i = 0; i < 9; ++i) {
1336       if (!methods[i].base_methid) {
1337         methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc);
1338         if (!methods[i].base_methid) return;
1339       }
1340       swig_override[i] = false;
1341       if (derived) {
1342         jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc);
1343         swig_override[i] = (methid != methods[i].base_methid);
1344         jenv->ExceptionClear();
1345       }
1346     }
1347   }
1348 }
1349
1350
1351 SwigDirector_CpuModel::SwigDirector_CpuModel(JNIEnv *jenv) : simgrid::surf::CpuModel(), Swig::Director(jenv) {
1352 }
1353
1354 double SwigDirector_CpuModel::shareResources(double now) {
1355   double c_result = SwigValueInit< double >() ;
1356   jdouble jresult = 0 ;
1357   JNIEnvWrapper swigjnienv(this) ;
1358   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1359   jobject swigjobj = (jobject) NULL ;
1360   jdouble jnow  ;
1361   
1362   if (!swig_override[0]) {
1363     return simgrid::surf::Model::shareResources(now);
1364   }
1365   swigjobj = swig_get_self(jenv);
1366   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1367     jnow = (jdouble) now;
1368     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[9], swigjobj, jnow);
1369     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1370     c_result = (double)jresult; 
1371   } else {
1372     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1373   }
1374   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1375   return c_result;
1376 }
1377
1378 double SwigDirector_CpuModel::shareResourcesLazy(double now) {
1379   double c_result = SwigValueInit< double >() ;
1380   jdouble jresult = 0 ;
1381   JNIEnvWrapper swigjnienv(this) ;
1382   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1383   jobject swigjobj = (jobject) NULL ;
1384   jdouble jnow  ;
1385   
1386   if (!swig_override[1]) {
1387     return simgrid::surf::Model::shareResourcesLazy(now);
1388   }
1389   swigjobj = swig_get_self(jenv);
1390   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1391     jnow = (jdouble) now;
1392     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[10], swigjobj, jnow);
1393     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1394     c_result = (double)jresult; 
1395   } else {
1396     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1397   }
1398   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1399   return c_result;
1400 }
1401
1402 double SwigDirector_CpuModel::shareResourcesFull(double now) {
1403   double c_result = SwigValueInit< double >() ;
1404   jdouble jresult = 0 ;
1405   JNIEnvWrapper swigjnienv(this) ;
1406   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1407   jobject swigjobj = (jobject) NULL ;
1408   jdouble jnow  ;
1409   
1410   if (!swig_override[2]) {
1411     return simgrid::surf::Model::shareResourcesFull(now);
1412   }
1413   swigjobj = swig_get_self(jenv);
1414   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1415     jnow = (jdouble) now;
1416     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[11], swigjobj, jnow);
1417     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1418     c_result = (double)jresult; 
1419   } else {
1420     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1421   }
1422   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1423   return c_result;
1424 }
1425
1426 void SwigDirector_CpuModel::updateActionsState(double now, double delta) {
1427   JNIEnvWrapper swigjnienv(this) ;
1428   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1429   jobject swigjobj = (jobject) NULL ;
1430   jdouble jnow  ;
1431   jdouble jdelta  ;
1432   
1433   if (!swig_override[3]) {
1434     simgrid::surf::Model::updateActionsState(now,delta);
1435     return;
1436   }
1437   swigjobj = swig_get_self(jenv);
1438   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1439     jnow = (jdouble) now;
1440     jdelta = (jdouble) delta;
1441     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[12], swigjobj, jnow, jdelta);
1442     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1443   } else {
1444     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1445   }
1446   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1447 }
1448
1449 void SwigDirector_CpuModel::updateActionsStateLazy(double now, double delta) {
1450   JNIEnvWrapper swigjnienv(this) ;
1451   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1452   jobject swigjobj = (jobject) NULL ;
1453   jdouble jnow  ;
1454   jdouble jdelta  ;
1455   
1456   if (!swig_override[4]) {
1457     simgrid::surf::Model::updateActionsStateLazy(now,delta);
1458     return;
1459   }
1460   swigjobj = swig_get_self(jenv);
1461   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1462     jnow = (jdouble) now;
1463     jdelta = (jdouble) delta;
1464     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[13], swigjobj, jnow, jdelta);
1465     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1466   } else {
1467     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1468   }
1469   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1470 }
1471
1472 void SwigDirector_CpuModel::updateActionsStateFull(double now, double delta) {
1473   JNIEnvWrapper swigjnienv(this) ;
1474   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1475   jobject swigjobj = (jobject) NULL ;
1476   jdouble jnow  ;
1477   jdouble jdelta  ;
1478   
1479   if (!swig_override[5]) {
1480     simgrid::surf::Model::updateActionsStateFull(now,delta);
1481     return;
1482   }
1483   swigjobj = swig_get_self(jenv);
1484   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1485     jnow = (jdouble) now;
1486     jdelta = (jdouble) delta;
1487     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[14], swigjobj, jnow, jdelta);
1488     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1489   } else {
1490     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1491   }
1492   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1493 }
1494
1495 simgrid::surf::ActionList *SwigDirector_CpuModel::getRunningActionSet() {
1496   simgrid::surf::ActionList *c_result = 0 ;
1497   jlong jresult = 0 ;
1498   JNIEnvWrapper swigjnienv(this) ;
1499   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1500   jobject swigjobj = (jobject) NULL ;
1501   
1502   if (!swig_override[6]) {
1503     return simgrid::surf::Model::getRunningActionSet();
1504   }
1505   swigjobj = swig_get_self(jenv);
1506   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1507     jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[15], swigjobj);
1508     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1509     c_result = *(simgrid::surf::ActionList **)&jresult; 
1510   } else {
1511     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1512   }
1513   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1514   return c_result;
1515 }
1516
1517 void SwigDirector_CpuModel::addTraces() {
1518   JNIEnvWrapper swigjnienv(this) ;
1519   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1520   jobject swigjobj = (jobject) NULL ;
1521   
1522   if (!swig_override[7]) {
1523     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::CpuModel::addTraces.");
1524     return;
1525   }
1526   swigjobj = swig_get_self(jenv);
1527   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1528     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[16], swigjobj);
1529     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1530   } else {
1531     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1532   }
1533   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1534 }
1535
1536 SwigDirector_CpuModel::~SwigDirector_CpuModel() {
1537   swig_disconnect_director_self("swigDirectorDisconnect");
1538 }
1539
1540
1541 simgrid::surf::Cpu *SwigDirector_CpuModel::createCpu(char const *name, DoubleDynar power_peak, int pstate, double power_scale, tmgr_trace *power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace *state_trace) {
1542   simgrid::surf::Cpu *c_result = 0 ;
1543   jlong jresult = 0 ;
1544   JNIEnvWrapper swigjnienv(this) ;
1545   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1546   jobject swigjobj = (jobject) NULL ;
1547   jstring jname = 0 ;
1548   jdoubleArray jpower_peak  ;
1549   jint jpstate  ;
1550   jdouble jpower_scale  ;
1551   jlong jpower_trace = 0 ;
1552   jint jcore  ;
1553   jint jstate_initial  ;
1554   jlong jstate_trace = 0 ;
1555   
1556   if (!swig_override[8]) {
1557     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::CpuModel::createCpu.");
1558     return c_result;
1559   }
1560   swigjobj = swig_get_self(jenv);
1561   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1562     jname = 0;
1563     if (name) {
1564       jname = jenv->NewStringUTF((const char *)name);
1565       if (!jname) return c_result;
1566     }
1567     
1568     long l = xbt_dynar_length(power_peak);
1569     jpower_peak = jenv->NewDoubleArray(l);
1570     double *lout = (double *) xbt_dynar_get_ptr(power_peak, 0);
1571     jenv->SetDoubleArrayRegion(jpower_peak, 0, l, (jdouble*)lout);
1572     
1573     jpstate = (jint) pstate;
1574     jpower_scale = (jdouble) power_scale;
1575     *((tmgr_trace **)&jpower_trace) = (tmgr_trace *) power_trace; 
1576     jcore = (jint) core;
1577     jstate_initial = (jint) state_initial;
1578     *((tmgr_trace **)&jstate_trace) = (tmgr_trace *) state_trace; 
1579     jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[17], swigjobj, jname, jpower_peak, jpstate, jpower_scale, jpower_trace, jcore, jstate_initial, jstate_trace);
1580     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1581     c_result = *(simgrid::surf::Cpu **)&jresult; 
1582   } else {
1583     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1584   }
1585   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1586   return c_result;
1587 }
1588
1589 void SwigDirector_CpuModel::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) {
1590   static struct {
1591     const char *mname;
1592     const char *mdesc;
1593     jmethodID base_methid;
1594   } methods[] = {
1595     {
1596       "shareResources", "(D)D", NULL 
1597     },
1598     {
1599       "shareResourcesLazy", "(D)D", NULL 
1600     },
1601     {
1602       "shareResourcesFull", "(D)D", NULL 
1603     },
1604     {
1605       "updateActionsState", "(DD)V", NULL 
1606     },
1607     {
1608       "updateActionsStateLazy", "(DD)V", NULL 
1609     },
1610     {
1611       "updateActionsStateFull", "(DD)V", NULL 
1612     },
1613     {
1614       "getRunningActionSet", "()Lorg/simgrid/surf/ActionList;", NULL 
1615     },
1616     {
1617       "addTraces", "()V", NULL 
1618     },
1619     {
1620       "createCpu", "(Ljava/lang/String;[DIDLorg/simgrid/surf/TmgrTrace;ILorg/simgrid/surf/ResourceState;Lorg/simgrid/surf/TmgrTrace;)Lorg/simgrid/surf/Cpu;", NULL 
1621     }
1622   };
1623   
1624   static jclass baseclass = 0 ;
1625   
1626   if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) {
1627     if (!baseclass) {
1628       baseclass = jenv->FindClass("org/simgrid/surf/CpuModel");
1629       if (!baseclass) return;
1630       baseclass = (jclass) jenv->NewGlobalRef(baseclass);
1631     }
1632     bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true);
1633     for (int i = 0; i < 9; ++i) {
1634       if (!methods[i].base_methid) {
1635         methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc);
1636         if (!methods[i].base_methid) return;
1637       }
1638       swig_override[i] = false;
1639       if (derived) {
1640         jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc);
1641         swig_override[i] = (methid != methods[i].base_methid);
1642         jenv->ExceptionClear();
1643       }
1644     }
1645   }
1646 }
1647
1648
1649 SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, lmm_constraint *constraint, int core, double powerPeak, double powerScale) : simgrid::surf::Cpu(model, name, constraint, core, powerPeak, powerScale), Swig::Director(jenv) {
1650 }
1651
1652 SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, int core, double powerPeak, double powerScale) : simgrid::surf::Cpu(model, name, core, powerPeak, powerScale), Swig::Director(jenv) {
1653 }
1654
1655 bool SwigDirector_Cpu::isUsed() {
1656   bool c_result = SwigValueInit< bool >() ;
1657   jboolean jresult = 0 ;
1658   JNIEnvWrapper swigjnienv(this) ;
1659   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1660   jobject swigjobj = (jobject) NULL ;
1661   
1662   if (!swig_override[0]) {
1663     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::isUsed.");
1664     return c_result;
1665   }
1666   swigjobj = swig_get_self(jenv);
1667   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1668     jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_SurfJNI, Swig::director_methids[18], swigjobj);
1669     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1670     c_result = jresult ? true : false; 
1671   } else {
1672     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1673   }
1674   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1675   return c_result;
1676 }
1677
1678 e_surf_resource_state_t SwigDirector_Cpu::getState() {
1679   e_surf_resource_state_t c_result = SwigValueInit< e_surf_resource_state_t >() ;
1680   jint jresult = 0 ;
1681   JNIEnvWrapper swigjnienv(this) ;
1682   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1683   jobject swigjobj = (jobject) NULL ;
1684   
1685   if (!swig_override[1]) {
1686     return simgrid::surf::Resource::getState();
1687   }
1688   swigjobj = swig_get_self(jenv);
1689   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1690     jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[19], swigjobj);
1691     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1692     c_result = (e_surf_resource_state_t)jresult; 
1693   } else {
1694     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1695   }
1696   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1697   return c_result;
1698 }
1699
1700 void SwigDirector_Cpu::updateState(tmgr_trace_event *event_type, double value, double date) {
1701   JNIEnvWrapper swigjnienv(this) ;
1702   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1703   jobject swigjobj = (jobject) NULL ;
1704   jlong jevent_type = 0 ;
1705   jdouble jvalue  ;
1706   jdouble jdate  ;
1707   
1708   if (!swig_override[2]) {
1709     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::updateState.");
1710     return;
1711   }
1712   swigjobj = swig_get_self(jenv);
1713   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1714     *((tmgr_trace_event **)&jevent_type) = (tmgr_trace_event *) event_type; 
1715     jvalue = (jdouble) value;
1716     jdate = (jdouble) date;
1717     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[20], swigjobj, jevent_type, jvalue, jdate);
1718     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1719   } else {
1720     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1721   }
1722   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1723 }
1724
1725 SwigDirector_Cpu::~SwigDirector_Cpu() {
1726   swig_disconnect_director_self("swigDirectorDisconnect");
1727 }
1728
1729
1730 double SwigDirector_Cpu::getCurrentPowerPeak() {
1731   double c_result = SwigValueInit< double >() ;
1732   jdouble jresult = 0 ;
1733   JNIEnvWrapper swigjnienv(this) ;
1734   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1735   jobject swigjobj = (jobject) NULL ;
1736   
1737   if (!swig_override[3]) {
1738     return simgrid::surf::Cpu::getCurrentPowerPeak();
1739   }
1740   swigjobj = swig_get_self(jenv);
1741   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1742     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[21], swigjobj);
1743     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1744     c_result = (double)jresult; 
1745   } else {
1746     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1747   }
1748   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1749   return c_result;
1750 }
1751
1752 simgrid::surf::CpuAction *SwigDirector_Cpu::execute(double size) {
1753   simgrid::surf::CpuAction *c_result = 0 ;
1754   jlong jresult = 0 ;
1755   JNIEnvWrapper swigjnienv(this) ;
1756   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1757   jobject swigjobj = (jobject) NULL ;
1758   jdouble jsize  ;
1759   
1760   if (!swig_override[4]) {
1761     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::execute.");
1762     return c_result;
1763   }
1764   swigjobj = swig_get_self(jenv);
1765   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1766     jsize = (jdouble) size;
1767     jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[22], swigjobj, jsize);
1768     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1769     c_result = *(simgrid::surf::CpuAction **)&jresult; 
1770   } else {
1771     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1772   }
1773   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1774   return c_result;
1775 }
1776
1777 simgrid::surf::CpuAction *SwigDirector_Cpu::sleep(double duration) {
1778   simgrid::surf::CpuAction *c_result = 0 ;
1779   jlong jresult = 0 ;
1780   JNIEnvWrapper swigjnienv(this) ;
1781   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1782   jobject swigjobj = (jobject) NULL ;
1783   jdouble jduration  ;
1784   
1785   if (!swig_override[5]) {
1786     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::sleep.");
1787     return c_result;
1788   }
1789   swigjobj = swig_get_self(jenv);
1790   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1791     jduration = (jdouble) duration;
1792     jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[23], swigjobj, jduration);
1793     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1794     c_result = *(simgrid::surf::CpuAction **)&jresult; 
1795   } else {
1796     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1797   }
1798   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1799   return c_result;
1800 }
1801
1802 int SwigDirector_Cpu::getCore() {
1803   int c_result = SwigValueInit< int >() ;
1804   jint jresult = 0 ;
1805   JNIEnvWrapper swigjnienv(this) ;
1806   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1807   jobject swigjobj = (jobject) NULL ;
1808   
1809   if (!swig_override[6]) {
1810     return simgrid::surf::Cpu::getCore();
1811   }
1812   swigjobj = swig_get_self(jenv);
1813   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1814     jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[24], swigjobj);
1815     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1816     c_result = (int)jresult; 
1817   } else {
1818     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1819   }
1820   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1821   return c_result;
1822 }
1823
1824 double SwigDirector_Cpu::getSpeed(double load) {
1825   double c_result = SwigValueInit< double >() ;
1826   jdouble jresult = 0 ;
1827   JNIEnvWrapper swigjnienv(this) ;
1828   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1829   jobject swigjobj = (jobject) NULL ;
1830   jdouble jload  ;
1831   
1832   if (!swig_override[7]) {
1833     return simgrid::surf::Cpu::getSpeed(load);
1834   }
1835   swigjobj = swig_get_self(jenv);
1836   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1837     jload = (jdouble) load;
1838     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[25], swigjobj, jload);
1839     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1840     c_result = (double)jresult; 
1841   } else {
1842     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1843   }
1844   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1845   return c_result;
1846 }
1847
1848 double SwigDirector_Cpu::getAvailableSpeed() {
1849   double c_result = SwigValueInit< double >() ;
1850   jdouble jresult = 0 ;
1851   JNIEnvWrapper swigjnienv(this) ;
1852   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1853   jobject swigjobj = (jobject) NULL ;
1854   
1855   if (!swig_override[8]) {
1856     return simgrid::surf::Cpu::getAvailableSpeed();
1857   }
1858   swigjobj = swig_get_self(jenv);
1859   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1860     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[26], swigjobj);
1861     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1862     c_result = (double)jresult; 
1863   } else {
1864     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1865   }
1866   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1867   return c_result;
1868 }
1869
1870 double SwigDirector_Cpu::getPowerPeakAt(int pstate_index) {
1871   double c_result = SwigValueInit< double >() ;
1872   jdouble jresult = 0 ;
1873   JNIEnvWrapper swigjnienv(this) ;
1874   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1875   jobject swigjobj = (jobject) NULL ;
1876   jint jpstate_index  ;
1877   
1878   if (!swig_override[9]) {
1879     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::getPowerPeakAt.");
1880     return c_result;
1881   }
1882   swigjobj = swig_get_self(jenv);
1883   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1884     jpstate_index = (jint) pstate_index;
1885     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[27], swigjobj, jpstate_index);
1886     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1887     c_result = (double)jresult; 
1888   } else {
1889     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1890   }
1891   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1892   return c_result;
1893 }
1894
1895 int SwigDirector_Cpu::getNbPstates() {
1896   int c_result = SwigValueInit< int >() ;
1897   jint jresult = 0 ;
1898   JNIEnvWrapper swigjnienv(this) ;
1899   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1900   jobject swigjobj = (jobject) NULL ;
1901   
1902   if (!swig_override[10]) {
1903     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::getNbPstates.");
1904     return c_result;
1905   }
1906   swigjobj = swig_get_self(jenv);
1907   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1908     jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[28], swigjobj);
1909     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1910     c_result = (int)jresult; 
1911   } else {
1912     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1913   }
1914   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1915   return c_result;
1916 }
1917
1918 void SwigDirector_Cpu::setPstate(int pstate_index) {
1919   JNIEnvWrapper swigjnienv(this) ;
1920   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1921   jobject swigjobj = (jobject) NULL ;
1922   jint jpstate_index  ;
1923   
1924   if (!swig_override[11]) {
1925     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::setPstate.");
1926     return;
1927   }
1928   swigjobj = swig_get_self(jenv);
1929   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1930     jpstate_index = (jint) pstate_index;
1931     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[29], swigjobj, jpstate_index);
1932     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1933   } else {
1934     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1935   }
1936   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1937 }
1938
1939 int SwigDirector_Cpu::getPstate() {
1940   int c_result = SwigValueInit< int >() ;
1941   jint jresult = 0 ;
1942   JNIEnvWrapper swigjnienv(this) ;
1943   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1944   jobject swigjobj = (jobject) NULL ;
1945   
1946   if (!swig_override[12]) {
1947     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::getPstate.");
1948     return c_result;
1949   }
1950   swigjobj = swig_get_self(jenv);
1951   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1952     jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[30], swigjobj);
1953     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1954     c_result = (int)jresult; 
1955   } else {
1956     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1957   }
1958   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1959   return c_result;
1960 }
1961
1962 void SwigDirector_Cpu::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) {
1963   static struct {
1964     const char *mname;
1965     const char *mdesc;
1966     jmethodID base_methid;
1967   } methods[] = {
1968     {
1969       "isUsed", "()Z", NULL 
1970     },
1971     {
1972       "getState", "()Lorg/simgrid/surf/ResourceState;", NULL 
1973     },
1974     {
1975       "updateState", "(Lorg/simgrid/surf/TmgrTraceEvent;DD)V", NULL 
1976     },
1977     {
1978       "getCurrentPowerPeak", "()D", NULL 
1979     },
1980     {
1981       "execute", "(D)Lorg/simgrid/surf/CpuAction;", NULL 
1982     },
1983     {
1984       "sleep", "(D)Lorg/simgrid/surf/CpuAction;", NULL 
1985     },
1986     {
1987       "getCore", "()I", NULL 
1988     },
1989     {
1990       "getSpeed", "(D)D", NULL 
1991     },
1992     {
1993       "getAvailableSpeed", "()D", NULL 
1994     },
1995     {
1996       "getPowerPeakAt", "(I)D", NULL 
1997     },
1998     {
1999       "getNbPstates", "()I", NULL 
2000     },
2001     {
2002       "setPstate", "(I)V", NULL 
2003     },
2004     {
2005       "getPstate", "()I", NULL 
2006     }
2007   };
2008   
2009   static jclass baseclass = 0 ;
2010   
2011   if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) {
2012     if (!baseclass) {
2013       baseclass = jenv->FindClass("org/simgrid/surf/Cpu");
2014       if (!baseclass) return;
2015       baseclass = (jclass) jenv->NewGlobalRef(baseclass);
2016     }
2017     bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true);
2018     for (int i = 0; i < 13; ++i) {
2019       if (!methods[i].base_methid) {
2020         methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc);
2021         if (!methods[i].base_methid) return;
2022       }
2023       swig_override[i] = false;
2024       if (derived) {
2025         jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc);
2026         swig_override[i] = (methid != methods[i].base_methid);
2027         jenv->ExceptionClear();
2028       }
2029     }
2030   }
2031 }
2032
2033
2034 SwigDirector_CpuAction::SwigDirector_CpuAction(JNIEnv *jenv, simgrid::surf::Model *model, double cost, bool failed) : simgrid::surf::CpuAction(model, cost, failed), Swig::Director(jenv) {
2035 }
2036
2037 SwigDirector_CpuAction::~SwigDirector_CpuAction() {
2038   swig_disconnect_director_self("swigDirectorDisconnect");
2039 }
2040
2041
2042 double SwigDirector_CpuAction::getRemains() {
2043   double c_result = SwigValueInit< double >() ;
2044   jdouble jresult = 0 ;
2045   JNIEnvWrapper swigjnienv(this) ;
2046   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
2047   jobject swigjobj = (jobject) NULL ;
2048   
2049   if (!swig_override[0]) {
2050     return simgrid::surf::Action::getRemains();
2051   }
2052   swigjobj = swig_get_self(jenv);
2053   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
2054     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[31], swigjobj);
2055     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
2056     c_result = (double)jresult; 
2057   } else {
2058     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
2059   }
2060   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
2061   return c_result;
2062 }
2063
2064 void SwigDirector_CpuAction::setPriority(double priority) {
2065   JNIEnvWrapper swigjnienv(this) ;
2066   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
2067   jobject swigjobj = (jobject) NULL ;
2068   jdouble jpriority  ;
2069   
2070   if (!swig_override[1]) {
2071     simgrid::surf::Action::setPriority(priority);
2072     return;
2073   }
2074   swigjobj = swig_get_self(jenv);
2075   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
2076     jpriority = (jdouble) priority;
2077     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[32], swigjobj, jpriority);
2078     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
2079   } else {
2080     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
2081   }
2082   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
2083 }
2084
2085 void SwigDirector_CpuAction::setState(e_surf_action_state_t state) {
2086   JNIEnvWrapper swigjnienv(this) ;
2087   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
2088   jobject swigjobj = (jobject) NULL ;
2089   jint jstate  ;
2090   
2091   if (!swig_override[2]) {
2092     simgrid::surf::Action::setState(state);
2093     return;
2094   }
2095   swigjobj = swig_get_self(jenv);
2096   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
2097     jstate = (jint) state;
2098     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[33], swigjobj, jstate);
2099     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
2100   } else {
2101     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
2102   }
2103   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
2104 }
2105
2106 void SwigDirector_CpuAction::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) {
2107   static struct {
2108     const char *mname;
2109     const char *mdesc;
2110     jmethodID base_methid;
2111   } methods[] = {
2112     {
2113       "getRemains", "()D", NULL 
2114     },
2115     {
2116       "setPriority", "(D)V", NULL 
2117     },
2118     {
2119       "setState", "(Lorg/simgrid/surf/ActionState;)V", NULL 
2120     }
2121   };
2122   
2123   static jclass baseclass = 0 ;
2124   
2125   if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) {
2126     if (!baseclass) {
2127       baseclass = jenv->FindClass("org/simgrid/surf/CpuAction");
2128       if (!baseclass) return;
2129       baseclass = (jclass) jenv->NewGlobalRef(baseclass);
2130     }
2131     bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true);
2132     for (int i = 0; i < 3; ++i) {
2133       if (!methods[i].base_methid) {
2134         methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc);
2135         if (!methods[i].base_methid) return;
2136       }
2137       swig_override[i] = false;
2138       if (derived) {
2139         jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc);
2140         swig_override[i] = (methid != methods[i].base_methid);
2141         jenv->ExceptionClear();
2142       }
2143     }
2144   }
2145 }
2146
2147
2148
2149 #ifdef __cplusplus
2150 extern "C" {
2151 #endif
2152
2153
2154 #ifdef __cplusplus
2155 extern "C" {
2156 #endif
2157
2158 JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_getAction(JNIEnv *env, jclass cls, jlong jarg1) {
2159   simgrid::surf::Action * action = (simgrid::surf::Action *)jarg1;
2160   jobject res;
2161   simgrid::surf::CpuAction *cpu_action =
2162     dynamic_cast<simgrid::surf::CpuAction*>(action);
2163   if (cpu_action) {
2164     SwigDirector_CpuAction *dir_cpu_action =
2165       dynamic_cast<SwigDirector_CpuAction*>(cpu_action);
2166     if (dir_cpu_action) {
2167       res = dir_cpu_action->swig_get_self(env);\
2168     } else {
2169       jclass clss = env->FindClass("org/simgrid/surf/CpuAction");\
2170       jmethodID constru = env->GetMethodID(clss, "<init>", "()V");\
2171       res = env->NewObject(clss, constru);\
2172       res = env->NewGlobalRef(res);\
2173     }
2174   } else {
2175     jclass clss = env->FindClass("org/simgrid/surf/Action");\
2176     jmethodID constru = env->GetMethodID(clss, "<init>", "()V");\
2177     res = env->NewObject(clss, constru);\
2178     res = env->NewGlobalRef(res);\
2179   }
2180   return res;
2181 }
2182
2183 #define GETDIRECTOR(NAME) \
2184 JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_get## NAME ## Director(JNIEnv *env, jclass cls, jlong jarg1)\
2185 {\
2186   simgrid::surf::NAME * arg1 = (simgrid::surf::NAME*)jarg1;\
2187   SwigDirector_ ##NAME *director = dynamic_cast<SwigDirector_ ##NAME *>(arg1);\
2188   jobject res;\
2189   if (director) {\
2190     res = director->swig_get_self(env);\
2191   } else {\
2192     jclass clss = env->FindClass("org/simgrid/surf/NAME");\
2193     jmethodID constru = env->GetMethodID(clss, "<init>", "()V");\
2194     res = env->NewObject(clss, constru);\
2195     res = env->NewGlobalRef(res);\
2196   }\
2197   return res;\
2198 }
2199
2200 GETDIRECTOR(CpuModel)
2201 GETDIRECTOR(Cpu)
2202 GETDIRECTOR(CpuAction)
2203
2204 #ifdef __cplusplus
2205 }
2206 #endif
2207
2208
2209 SWIGEXPORT jlongArray JNICALL Java_org_simgrid_surf_SurfJNI_ActionList_1getArray(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2210   jlongArray jresult = 0 ;
2211   simgrid::surf::ActionList *arg1 = (simgrid::surf::ActionList *) 0 ;
2212   ActionArrayPtr result;
2213   
2214   (void)jenv;
2215   (void)jcls;
2216   (void)jarg1_;
2217   arg1 = *(simgrid::surf::ActionList **)&jarg1; 
2218   result = (ActionArrayPtr)simgrid_surf_ActionList_getArray(arg1);
2219   {
2220     long l = 0;
2221     for(simgrid::surf::ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) {
2222       l++;
2223     }
2224     jresult = jenv->NewLongArray(l);
2225     jlong *elts = jenv->GetLongArrayElements(jresult, NULL);
2226     l = 0;
2227     for(simgrid::surf::ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) {
2228       elts[l++] = (jlong)static_cast<simgrid::surf::Action*>(&*it);
2229     }
2230     jenv->ReleaseLongArrayElements(jresult, elts, 0);
2231   }
2232   return jresult;
2233 }
2234
2235
2236 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1ActionList(JNIEnv *jenv, jclass jcls) {
2237   jlong jresult = 0 ;
2238   simgrid::surf::ActionList *result = 0 ;
2239   
2240   (void)jenv;
2241   (void)jcls;
2242   result = (simgrid::surf::ActionList *)new simgrid::surf::ActionList();
2243   *(simgrid::surf::ActionList **)&jresult = result; 
2244   return jresult;
2245 }
2246
2247
2248 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1ActionList(JNIEnv *jenv, jclass jcls, jlong jarg1) {
2249   simgrid::surf::ActionList *arg1 = (simgrid::surf::ActionList *) 0 ;
2250   
2251   (void)jenv;
2252   (void)jcls;
2253   arg1 = *(simgrid::surf::ActionList **)&jarg1; 
2254   delete arg1;
2255 }
2256
2257
2258 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_getClock(JNIEnv *jenv, jclass jcls) {
2259   jdouble jresult = 0 ;
2260   double result;
2261   
2262   (void)jenv;
2263   (void)jcls;
2264   result = (double)getClock();
2265   jresult = (jdouble)result; 
2266   return jresult;
2267 }
2268
2269
2270 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_clean(JNIEnv *jenv, jclass jcls) {
2271   (void)jenv;
2272   (void)jcls;
2273   clean();
2274 }
2275
2276
2277 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_getCpuModel(JNIEnv *jenv, jclass jcls) {
2278   jlong jresult = 0 ;
2279   simgrid::surf::CpuModel *result = 0 ;
2280   
2281   (void)jenv;
2282   (void)jcls;
2283   result = (simgrid::surf::CpuModel *)getCpuModel();
2284   *(simgrid::surf::CpuModel **)&jresult = result; 
2285   return jresult;
2286 }
2287
2288
2289 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_setCpuModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2290   simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ;
2291   
2292   (void)jenv;
2293   (void)jcls;
2294   (void)jarg1_;
2295   arg1 = *(simgrid::surf::CpuModel **)&jarg1; 
2296   setCpuModel(arg1);
2297 }
2298
2299
2300 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_setCpu(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2, jobject jarg2_) {
2301   char *arg1 = (char *) 0 ;
2302   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2303   
2304   (void)jenv;
2305   (void)jcls;
2306   (void)jarg2_;
2307   arg1 = 0;
2308   if (jarg1) {
2309     arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0);
2310     if (!arg1) return ;
2311   }
2312   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2313   setCpu(arg1,arg2);
2314   {
2315     
2316   }
2317 }
2318
2319
2320 SWIGEXPORT jlongArray JNICALL Java_org_simgrid_surf_SurfJNI_getRoute(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2) {
2321   jlongArray jresult = 0 ;
2322   char *arg1 = (char *) 0 ;
2323   char *arg2 = (char *) 0 ;
2324   LinkDynar result;
2325   
2326   (void)jenv;
2327   (void)jcls;
2328   arg1 = 0;
2329   if (jarg1) {
2330     arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0);
2331     if (!arg1) return 0;
2332   }
2333   arg2 = 0;
2334   if (jarg2) {
2335     arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
2336     if (!arg2) return 0;
2337   }
2338   result = getRoute(arg1,arg2);
2339   {
2340     long l = xbt_dynar_length(result);
2341     jresult = jenv->NewLongArray(l);
2342     unsigned i;
2343     Link *link;
2344     jlong *elts = jenv->GetLongArrayElements(jresult, NULL);
2345     xbt_dynar_foreach(result, i, link) {
2346       elts[i] = (jlong)link;
2347     }
2348     jenv->ReleaseLongArrayElements(jresult, elts, 0);
2349     xbt_dynar_free(&result);
2350   }
2351   if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1);
2352   if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
2353   return jresult;
2354 }
2355
2356
2357 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Plugin(JNIEnv *jenv, jclass jcls, jlong jarg1) {
2358   Plugin *arg1 = (Plugin *) 0 ;
2359   
2360   (void)jenv;
2361   (void)jcls;
2362   arg1 = *(Plugin **)&jarg1; 
2363   delete arg1;
2364 }
2365
2366
2367 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2368   Plugin *arg1 = (Plugin *) 0 ;
2369   
2370   (void)jenv;
2371   (void)jcls;
2372   (void)jarg1_;
2373   arg1 = *(Plugin **)&jarg1; 
2374   (arg1)->activateCpuCreatedCallback();
2375 }
2376
2377
2378 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2379   Plugin *arg1 = (Plugin *) 0 ;
2380   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2381   
2382   (void)jenv;
2383   (void)jcls;
2384   (void)jarg1_;
2385   (void)jarg2_;
2386   arg1 = *(Plugin **)&jarg1; 
2387   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2388   (arg1)->cpuCreatedCallback(arg2);
2389 }
2390
2391
2392 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuCreatedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2393   Plugin *arg1 = (Plugin *) 0 ;
2394   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2395   
2396   (void)jenv;
2397   (void)jcls;
2398   (void)jarg1_;
2399   (void)jarg2_;
2400   arg1 = *(Plugin **)&jarg1; 
2401   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2402   (arg1)->Plugin::cpuCreatedCallback(arg2);
2403 }
2404
2405
2406 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2407   Plugin *arg1 = (Plugin *) 0 ;
2408   
2409   (void)jenv;
2410   (void)jcls;
2411   (void)jarg1_;
2412   arg1 = *(Plugin **)&jarg1; 
2413   (arg1)->activateCpuDestructedCallback();
2414 }
2415
2416
2417 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2418   Plugin *arg1 = (Plugin *) 0 ;
2419   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2420   
2421   (void)jenv;
2422   (void)jcls;
2423   (void)jarg1_;
2424   (void)jarg2_;
2425   arg1 = *(Plugin **)&jarg1; 
2426   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2427   (arg1)->cpuDestructedCallback(arg2);
2428 }
2429
2430
2431 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuDestructedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2432   Plugin *arg1 = (Plugin *) 0 ;
2433   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2434   
2435   (void)jenv;
2436   (void)jcls;
2437   (void)jarg1_;
2438   (void)jarg2_;
2439   arg1 = *(Plugin **)&jarg1; 
2440   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2441   (arg1)->Plugin::cpuDestructedCallback(arg2);
2442 }
2443
2444
2445 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2446   Plugin *arg1 = (Plugin *) 0 ;
2447   
2448   (void)jenv;
2449   (void)jcls;
2450   (void)jarg1_;
2451   arg1 = *(Plugin **)&jarg1; 
2452   (arg1)->activateCpuStateChangedCallback();
2453 }
2454
2455
2456 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
2457   Plugin *arg1 = (Plugin *) 0 ;
2458   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2459   e_surf_resource_state_t arg3 ;
2460   e_surf_resource_state_t arg4 ;
2461   
2462   (void)jenv;
2463   (void)jcls;
2464   (void)jarg1_;
2465   (void)jarg2_;
2466   arg1 = *(Plugin **)&jarg1; 
2467   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2468   arg3 = (e_surf_resource_state_t)jarg3; 
2469   arg4 = (e_surf_resource_state_t)jarg4; 
2470   (arg1)->cpuStateChangedCallback(arg2,arg3,arg4);
2471 }
2472
2473
2474 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
2475   Plugin *arg1 = (Plugin *) 0 ;
2476   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2477   e_surf_resource_state_t arg3 ;
2478   e_surf_resource_state_t arg4 ;
2479   
2480   (void)jenv;
2481   (void)jcls;
2482   (void)jarg1_;
2483   (void)jarg2_;
2484   arg1 = *(Plugin **)&jarg1; 
2485   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2486   arg3 = (e_surf_resource_state_t)jarg3; 
2487   arg4 = (e_surf_resource_state_t)jarg4; 
2488   (arg1)->Plugin::cpuStateChangedCallback(arg2,arg3,arg4);
2489 }
2490
2491
2492 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2493   Plugin *arg1 = (Plugin *) 0 ;
2494   
2495   (void)jenv;
2496   (void)jcls;
2497   (void)jarg1_;
2498   arg1 = *(Plugin **)&jarg1; 
2499   (arg1)->activateCpuActionStateChangedCallback();
2500 }
2501
2502
2503 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
2504   Plugin *arg1 = (Plugin *) 0 ;
2505   simgrid::surf::CpuAction *arg2 = (simgrid::surf::CpuAction *) 0 ;
2506   e_surf_action_state_t arg3 ;
2507   e_surf_action_state_t arg4 ;
2508   
2509   (void)jenv;
2510   (void)jcls;
2511   (void)jarg1_;
2512   (void)jarg2_;
2513   arg1 = *(Plugin **)&jarg1; 
2514   arg2 = *(simgrid::surf::CpuAction **)&jarg2; 
2515   arg3 = (e_surf_action_state_t)jarg3; 
2516   arg4 = (e_surf_action_state_t)jarg4; 
2517   (arg1)->cpuActionStateChangedCallback(arg2,arg3,arg4);
2518 }
2519
2520
2521 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuActionStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
2522   Plugin *arg1 = (Plugin *) 0 ;
2523   simgrid::surf::CpuAction *arg2 = (simgrid::surf::CpuAction *) 0 ;
2524   e_surf_action_state_t arg3 ;
2525   e_surf_action_state_t arg4 ;
2526   
2527   (void)jenv;
2528   (void)jcls;
2529   (void)jarg1_;
2530   (void)jarg2_;
2531   arg1 = *(Plugin **)&jarg1; 
2532   arg2 = *(simgrid::surf::CpuAction **)&jarg2; 
2533   arg3 = (e_surf_action_state_t)jarg3; 
2534   arg4 = (e_surf_action_state_t)jarg4; 
2535   (arg1)->Plugin::cpuActionStateChangedCallback(arg2,arg3,arg4);
2536 }
2537
2538
2539 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateLinkCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2540   Plugin *arg1 = (Plugin *) 0 ;
2541   
2542   (void)jenv;
2543   (void)jcls;
2544   (void)jarg1_;
2545   arg1 = *(Plugin **)&jarg1; 
2546   (arg1)->activateLinkCreatedCallback();
2547 }
2548
2549
2550 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2551   Plugin *arg1 = (Plugin *) 0 ;
2552   simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
2553   
2554   (void)jenv;
2555   (void)jcls;
2556   (void)jarg1_;
2557   (void)jarg2_;
2558   arg1 = *(Plugin **)&jarg1; 
2559   arg2 = *(simgrid::surf::Link **)&jarg2; 
2560   (arg1)->networkLinkCreatedCallback(arg2);
2561 }
2562
2563
2564 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkCreatedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2565   Plugin *arg1 = (Plugin *) 0 ;
2566   simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
2567   
2568   (void)jenv;
2569   (void)jcls;
2570   (void)jarg1_;
2571   (void)jarg2_;
2572   arg1 = *(Plugin **)&jarg1; 
2573   arg2 = *(simgrid::surf::Link **)&jarg2; 
2574   (arg1)->Plugin::networkLinkCreatedCallback(arg2);
2575 }
2576
2577
2578 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateLinkDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2579   Plugin *arg1 = (Plugin *) 0 ;
2580   
2581   (void)jenv;
2582   (void)jcls;
2583   (void)jarg1_;
2584   arg1 = *(Plugin **)&jarg1; 
2585   (arg1)->activateLinkDestructedCallback();
2586 }
2587
2588
2589 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2590   Plugin *arg1 = (Plugin *) 0 ;
2591   simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
2592   
2593   (void)jenv;
2594   (void)jcls;
2595   (void)jarg1_;
2596   (void)jarg2_;
2597   arg1 = *(Plugin **)&jarg1; 
2598   arg2 = *(simgrid::surf::Link **)&jarg2; 
2599   (arg1)->networkLinkDestructedCallback(arg2);
2600 }
2601
2602
2603 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkDestructedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2604   Plugin *arg1 = (Plugin *) 0 ;
2605   simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
2606   
2607   (void)jenv;
2608   (void)jcls;
2609   (void)jarg1_;
2610   (void)jarg2_;
2611   arg1 = *(Plugin **)&jarg1; 
2612   arg2 = *(simgrid::surf::Link **)&jarg2; 
2613   (arg1)->Plugin::networkLinkDestructedCallback(arg2);
2614 }
2615
2616
2617 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateLinkStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2618   Plugin *arg1 = (Plugin *) 0 ;
2619   
2620   (void)jenv;
2621   (void)jcls;
2622   (void)jarg1_;
2623   arg1 = *(Plugin **)&jarg1; 
2624   (arg1)->activateLinkStateChangedCallback();
2625 }
2626
2627
2628 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
2629   Plugin *arg1 = (Plugin *) 0 ;
2630   simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
2631   e_surf_resource_state_t arg3 ;
2632   e_surf_resource_state_t arg4 ;
2633   
2634   (void)jenv;
2635   (void)jcls;
2636   (void)jarg1_;
2637   (void)jarg2_;
2638   arg1 = *(Plugin **)&jarg1; 
2639   arg2 = *(simgrid::surf::Link **)&jarg2; 
2640   arg3 = (e_surf_resource_state_t)jarg3; 
2641   arg4 = (e_surf_resource_state_t)jarg4; 
2642   (arg1)->networkLinkStateChangedCallback(arg2,arg3,arg4);
2643 }
2644
2645
2646 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
2647   Plugin *arg1 = (Plugin *) 0 ;
2648   simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
2649   e_surf_resource_state_t arg3 ;
2650   e_surf_resource_state_t arg4 ;
2651   
2652   (void)jenv;
2653   (void)jcls;
2654   (void)jarg1_;
2655   (void)jarg2_;
2656   arg1 = *(Plugin **)&jarg1; 
2657   arg2 = *(simgrid::surf::Link **)&jarg2; 
2658   arg3 = (e_surf_resource_state_t)jarg3; 
2659   arg4 = (e_surf_resource_state_t)jarg4; 
2660   (arg1)->Plugin::networkLinkStateChangedCallback(arg2,arg3,arg4);
2661 }
2662
2663
2664 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateNetworkActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2665   Plugin *arg1 = (Plugin *) 0 ;
2666   
2667   (void)jenv;
2668   (void)jcls;
2669   (void)jarg1_;
2670   arg1 = *(Plugin **)&jarg1; 
2671   (arg1)->activateNetworkActionStateChangedCallback();
2672 }
2673
2674
2675 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
2676   Plugin *arg1 = (Plugin *) 0 ;
2677   simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ;
2678   e_surf_action_state_t arg3 ;
2679   e_surf_action_state_t arg4 ;
2680   
2681   (void)jenv;
2682   (void)jcls;
2683   (void)jarg1_;
2684   (void)jarg2_;
2685   arg1 = *(Plugin **)&jarg1; 
2686   arg2 = *(simgrid::surf::NetworkAction **)&jarg2; 
2687   arg3 = (e_surf_action_state_t)jarg3; 
2688   arg4 = (e_surf_action_state_t)jarg4; 
2689   (arg1)->networkActionStateChangedCallback(arg2,arg3,arg4);
2690 }
2691
2692
2693 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkActionStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
2694   Plugin *arg1 = (Plugin *) 0 ;
2695   simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ;
2696   e_surf_action_state_t arg3 ;
2697   e_surf_action_state_t arg4 ;
2698   
2699   (void)jenv;
2700   (void)jcls;
2701   (void)jarg1_;
2702   (void)jarg2_;
2703   arg1 = *(Plugin **)&jarg1; 
2704   arg2 = *(simgrid::surf::NetworkAction **)&jarg2; 
2705   arg3 = (e_surf_action_state_t)jarg3; 
2706   arg4 = (e_surf_action_state_t)jarg4; 
2707   (arg1)->Plugin::networkActionStateChangedCallback(arg2,arg3,arg4);
2708 }
2709
2710
2711 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateNetworkCommunicateCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2712   Plugin *arg1 = (Plugin *) 0 ;
2713   
2714   (void)jenv;
2715   (void)jcls;
2716   (void)jarg1_;
2717   arg1 = *(Plugin **)&jarg1; 
2718   (arg1)->activateNetworkCommunicateCallback();
2719 }
2720
2721
2722 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkCommunicateCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jdouble jarg5, jdouble jarg6) {
2723   Plugin *arg1 = (Plugin *) 0 ;
2724   simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ;
2725   simgrid::surf::RoutingEdge *arg3 = (simgrid::surf::RoutingEdge *) 0 ;
2726   simgrid::surf::RoutingEdge *arg4 = (simgrid::surf::RoutingEdge *) 0 ;
2727   double arg5 ;
2728   double arg6 ;
2729   
2730   (void)jenv;
2731   (void)jcls;
2732   (void)jarg1_;
2733   (void)jarg2_;
2734   (void)jarg3_;
2735   (void)jarg4_;
2736   arg1 = *(Plugin **)&jarg1; 
2737   arg2 = *(simgrid::surf::NetworkAction **)&jarg2; 
2738   arg3 = *(simgrid::surf::RoutingEdge **)&jarg3; 
2739   arg4 = *(simgrid::surf::RoutingEdge **)&jarg4; 
2740   arg5 = (double)jarg5; 
2741   arg6 = (double)jarg6; 
2742   (arg1)->networkCommunicateCallback(arg2,arg3,arg4,arg5,arg6);
2743 }
2744
2745
2746 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkCommunicateCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jdouble jarg5, jdouble jarg6) {
2747   Plugin *arg1 = (Plugin *) 0 ;
2748   simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ;
2749   simgrid::surf::RoutingEdge *arg3 = (simgrid::surf::RoutingEdge *) 0 ;
2750   simgrid::surf::RoutingEdge *arg4 = (simgrid::surf::RoutingEdge *) 0 ;
2751   double arg5 ;
2752   double arg6 ;
2753   
2754   (void)jenv;
2755   (void)jcls;
2756   (void)jarg1_;
2757   (void)jarg2_;
2758   (void)jarg3_;
2759   (void)jarg4_;
2760   arg1 = *(Plugin **)&jarg1; 
2761   arg2 = *(simgrid::surf::NetworkAction **)&jarg2; 
2762   arg3 = *(simgrid::surf::RoutingEdge **)&jarg3; 
2763   arg4 = *(simgrid::surf::RoutingEdge **)&jarg4; 
2764   arg5 = (double)jarg5; 
2765   arg6 = (double)jarg6; 
2766   (arg1)->Plugin::networkCommunicateCallback(arg2,arg3,arg4,arg5,arg6);
2767 }
2768
2769
2770 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Plugin(JNIEnv *jenv, jclass jcls) {
2771   jlong jresult = 0 ;
2772   Plugin *result = 0 ;
2773   
2774   (void)jenv;
2775   (void)jcls;
2776   result = (Plugin *)new SwigDirector_Plugin(jenv);
2777   *(Plugin **)&jresult = result; 
2778   return jresult;
2779 }
2780
2781
2782 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) {
2783   Plugin *obj = *((Plugin **)&objarg);
2784   (void)jcls;
2785   SwigDirector_Plugin *director = dynamic_cast<SwigDirector_Plugin *>(obj);
2786   if (director) {
2787     director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE));
2788   }
2789 }
2790
2791
2792 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {
2793   Plugin *obj = *((Plugin **)&objarg);
2794   SwigDirector_Plugin *director = dynamic_cast<SwigDirector_Plugin *>(obj);
2795   (void)jcls;
2796   if (director) {
2797     director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false);
2798   }
2799 }
2800
2801
2802 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1TmgrTrace(JNIEnv *jenv, jclass jcls, jlong jarg1) {
2803   tmgr_trace *arg1 = (tmgr_trace *) 0 ;
2804   
2805   (void)jenv;
2806   (void)jcls;
2807   arg1 = *(tmgr_trace **)&jarg1; 
2808   delete arg1;
2809 }
2810
2811
2812 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_TmgrTraceEvent_1getIdx(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2813   jlong jresult = 0 ;
2814   tmgr_trace_event *arg1 = (tmgr_trace_event *) 0 ;
2815   unsigned int result;
2816   
2817   (void)jenv;
2818   (void)jcls;
2819   (void)jarg1_;
2820   arg1 = *(tmgr_trace_event **)&jarg1; 
2821   result = (unsigned int)tmgr_trace_event_getIdx(arg1);
2822   jresult = (jlong)result; 
2823   return jresult;
2824 }
2825
2826
2827 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1TmgrTraceEvent(JNIEnv *jenv, jclass jcls, jlong jarg1) {
2828   tmgr_trace_event *arg1 = (tmgr_trace_event *) 0 ;
2829   
2830   (void)jenv;
2831   (void)jcls;
2832   arg1 = *(tmgr_trace_event **)&jarg1; 
2833   delete arg1;
2834 }
2835
2836
2837 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResources(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
2838   jdouble jresult = 0 ;
2839   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2840   double arg2 ;
2841   double result;
2842   
2843   (void)jenv;
2844   (void)jcls;
2845   (void)jarg1_;
2846   arg1 = *(simgrid::surf::Model **)&jarg1; 
2847   arg2 = (double)jarg2; 
2848   result = (double)(arg1)->shareResources(arg2);
2849   jresult = (jdouble)result; 
2850   return jresult;
2851 }
2852
2853
2854 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResourcesLazy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
2855   jdouble jresult = 0 ;
2856   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2857   double arg2 ;
2858   double result;
2859   
2860   (void)jenv;
2861   (void)jcls;
2862   (void)jarg1_;
2863   arg1 = *(simgrid::surf::Model **)&jarg1; 
2864   arg2 = (double)jarg2; 
2865   result = (double)(arg1)->shareResourcesLazy(arg2);
2866   jresult = (jdouble)result; 
2867   return jresult;
2868 }
2869
2870
2871 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResourcesFull(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
2872   jdouble jresult = 0 ;
2873   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2874   double arg2 ;
2875   double result;
2876   
2877   (void)jenv;
2878   (void)jcls;
2879   (void)jarg1_;
2880   arg1 = *(simgrid::surf::Model **)&jarg1; 
2881   arg2 = (double)jarg2; 
2882   result = (double)(arg1)->shareResourcesFull(arg2);
2883   jresult = (jdouble)result; 
2884   return jresult;
2885 }
2886
2887
2888 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
2889   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2890   double arg2 ;
2891   double arg3 ;
2892   
2893   (void)jenv;
2894   (void)jcls;
2895   (void)jarg1_;
2896   arg1 = *(simgrid::surf::Model **)&jarg1; 
2897   arg2 = (double)jarg2; 
2898   arg3 = (double)jarg3; 
2899   (arg1)->updateActionsState(arg2,arg3);
2900 }
2901
2902
2903 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsStateLazy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
2904   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2905   double arg2 ;
2906   double arg3 ;
2907   
2908   (void)jenv;
2909   (void)jcls;
2910   (void)jarg1_;
2911   arg1 = *(simgrid::surf::Model **)&jarg1; 
2912   arg2 = (double)jarg2; 
2913   arg3 = (double)jarg3; 
2914   (arg1)->updateActionsStateLazy(arg2,arg3);
2915 }
2916
2917
2918 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsStateFull(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
2919   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2920   double arg2 ;
2921   double arg3 ;
2922   
2923   (void)jenv;
2924   (void)jcls;
2925   (void)jarg1_;
2926   arg1 = *(simgrid::surf::Model **)&jarg1; 
2927   arg2 = (double)jarg2; 
2928   arg3 = (double)jarg3; 
2929   (arg1)->updateActionsStateFull(arg2,arg3);
2930 }
2931
2932
2933 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Model_1getRunningActionSet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2934   jlong jresult = 0 ;
2935   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2936   simgrid::surf::ActionList *result = 0 ;
2937   
2938   (void)jenv;
2939   (void)jcls;
2940   (void)jarg1_;
2941   arg1 = *(simgrid::surf::Model **)&jarg1; 
2942   result = (simgrid::surf::ActionList *)(arg1)->getRunningActionSet();
2943   *(simgrid::surf::ActionList **)&jresult = result; 
2944   return jresult;
2945 }
2946
2947
2948 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1addTraces(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2949   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2950   
2951   (void)jenv;
2952   (void)jcls;
2953   (void)jarg1_;
2954   arg1 = *(simgrid::surf::Model **)&jarg1; 
2955   (arg1)->addTraces();
2956 }
2957
2958
2959 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Model(JNIEnv *jenv, jclass jcls, jlong jarg1) {
2960   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2961   
2962   (void)jenv;
2963   (void)jcls;
2964   arg1 = *(simgrid::surf::Model **)&jarg1; 
2965   delete arg1;
2966 }
2967
2968
2969 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1CpuModel(JNIEnv *jenv, jclass jcls) {
2970   jlong jresult = 0 ;
2971   simgrid::surf::CpuModel *result = 0 ;
2972   
2973   (void)jenv;
2974   (void)jcls;
2975   result = (simgrid::surf::CpuModel *)new SwigDirector_CpuModel(jenv);
2976   *(simgrid::surf::CpuModel **)&jresult = result; 
2977   return jresult;
2978 }
2979
2980
2981 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1CpuModel(JNIEnv *jenv, jclass jcls, jlong jarg1) {
2982   simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ;
2983   
2984   (void)jenv;
2985   (void)jcls;
2986   arg1 = *(simgrid::surf::CpuModel **)&jarg1; 
2987   delete arg1;
2988 }
2989
2990
2991 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1createCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jdoubleArray jarg3, jint jarg4, jdouble jarg5, jlong jarg6, jobject jarg6_, jint jarg7, jint jarg8, jlong jarg9, jobject jarg9_) {
2992   jlong jresult = 0 ;
2993   simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ;
2994   char *arg2 = (char *) 0 ;
2995   DoubleDynar arg3 ;
2996   int arg4 ;
2997   double arg5 ;
2998   tmgr_trace *arg6 = (tmgr_trace *) 0 ;
2999   int arg7 ;
3000   e_surf_resource_state_t arg8 ;
3001   tmgr_trace *arg9 = (tmgr_trace *) 0 ;
3002   DoubleDynar *argp3 ;
3003   simgrid::surf::Cpu *result = 0 ;
3004   
3005   (void)jenv;
3006   (void)jcls;
3007   (void)jarg1_;
3008   (void)jarg6_;
3009   (void)jarg9_;
3010   arg1 = *(simgrid::surf::CpuModel **)&jarg1; 
3011   arg2 = 0;
3012   if (jarg2) {
3013     arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
3014     if (!arg2) return 0;
3015   }
3016   argp3 = *(DoubleDynar **)&jarg3; 
3017   if (!argp3) {
3018     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null DoubleDynar");
3019     return 0;
3020   }
3021   arg3 = *argp3; 
3022   arg4 = (int)jarg4; 
3023   arg5 = (double)jarg5; 
3024   arg6 = *(tmgr_trace **)&jarg6; 
3025   arg7 = (int)jarg7; 
3026   arg8 = (e_surf_resource_state_t)jarg8; 
3027   arg9 = *(tmgr_trace **)&jarg9; 
3028   result = (simgrid::surf::Cpu *)(arg1)->createCpu((char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
3029   *(simgrid::surf::Cpu **)&jresult = result; 
3030   {
3031     
3032   }
3033   return jresult;
3034 }
3035
3036
3037 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) {
3038   simgrid::surf::CpuModel *obj = *((simgrid::surf::CpuModel **)&objarg);
3039   (void)jcls;
3040   SwigDirector_CpuModel *director = dynamic_cast<SwigDirector_CpuModel *>(obj);
3041   if (director) {
3042     director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE));
3043   }
3044 }
3045
3046
3047 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {
3048   simgrid::surf::CpuModel *obj = *((simgrid::surf::CpuModel **)&objarg);
3049   SwigDirector_CpuModel *director = dynamic_cast<SwigDirector_CpuModel *>(obj);
3050   (void)jcls;
3051   if (director) {
3052     director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false);
3053   }
3054 }
3055
3056
3057 SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3058   jstring jresult = 0 ;
3059   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3060   char *result = 0 ;
3061   
3062   (void)jenv;
3063   (void)jcls;
3064   (void)jarg1_;
3065   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3066   result = (char *)(arg1)->getName();
3067   if (result) jresult = jenv->NewStringUTF((const char *)result);
3068   return jresult;
3069 }
3070
3071
3072 SWIGEXPORT jboolean JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1isUsed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3073   jboolean jresult = 0 ;
3074   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3075   bool result;
3076   
3077   (void)jenv;
3078   (void)jcls;
3079   (void)jarg1_;
3080   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3081   result = (bool)(arg1)->isUsed();
3082   jresult = (jboolean)result; 
3083   return jresult;
3084 }
3085
3086
3087 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3088   jlong jresult = 0 ;
3089   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3090   simgrid::surf::Model *result = 0 ;
3091   
3092   (void)jenv;
3093   (void)jcls;
3094   (void)jarg1_;
3095   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3096   result = (simgrid::surf::Model *)(arg1)->getModel();
3097   *(simgrid::surf::Model **)&jresult = result; 
3098   return jresult;
3099 }
3100
3101
3102 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3103   jint jresult = 0 ;
3104   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3105   e_surf_resource_state_t result;
3106   
3107   (void)jenv;
3108   (void)jcls;
3109   (void)jarg1_;
3110   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3111   result = (e_surf_resource_state_t)(arg1)->getState();
3112   jresult = (jint)result; 
3113   return jresult;
3114 }
3115
3116
3117 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getConstraint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3118   jlong jresult = 0 ;
3119   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3120   lmm_constraint *result = 0 ;
3121   
3122   (void)jenv;
3123   (void)jcls;
3124   (void)jarg1_;
3125   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3126   result = (lmm_constraint *)(arg1)->getConstraint();
3127   *(lmm_constraint **)&jresult = result; 
3128   return jresult;
3129 }
3130
3131
3132 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1updateState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jdouble jarg3, jdouble jarg4) {
3133   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3134   tmgr_trace_event *arg2 = (tmgr_trace_event *) 0 ;
3135   double arg3 ;
3136   double arg4 ;
3137   
3138   (void)jenv;
3139   (void)jcls;
3140   (void)jarg1_;
3141   (void)jarg2_;
3142   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3143   arg2 = *(tmgr_trace_event **)&jarg2; 
3144   arg3 = (double)jarg3; 
3145   arg4 = (double)jarg4; 
3146   (arg1)->updateState(arg2,arg3,arg4);
3147 }
3148
3149
3150 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Resource(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3151   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3152   
3153   (void)jenv;
3154   (void)jcls;
3155   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3156   delete arg1;
3157 }
3158
3159
3160 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Cpu_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jint jarg4, jdouble jarg5, jdouble jarg6) {
3161   jlong jresult = 0 ;
3162   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
3163   char *arg2 = (char *) 0 ;
3164   lmm_constraint *arg3 = (lmm_constraint *) 0 ;
3165   int arg4 ;
3166   double arg5 ;
3167   double arg6 ;
3168   simgrid::surf::Cpu *result = 0 ;
3169   
3170   (void)jenv;
3171   (void)jcls;
3172   (void)jarg1_;
3173   (void)jarg3_;
3174   arg1 = *(simgrid::surf::Model **)&jarg1; 
3175   arg2 = 0;
3176   if (jarg2) {
3177     arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
3178     if (!arg2) return 0;
3179   }
3180   arg3 = *(lmm_constraint **)&jarg3; 
3181   arg4 = (int)jarg4; 
3182   arg5 = (double)jarg5; 
3183   arg6 = (double)jarg6; 
3184   result = (simgrid::surf::Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
3185   *(simgrid::surf::Cpu **)&jresult = result; 
3186   {
3187     
3188   }
3189   return jresult;
3190 }
3191
3192
3193 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Cpu_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3, jdouble jarg4, jdouble jarg5) {
3194   jlong jresult = 0 ;
3195   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
3196   char *arg2 = (char *) 0 ;
3197   int arg3 ;
3198   double arg4 ;
3199   double arg5 ;
3200   simgrid::surf::Cpu *result = 0 ;
3201   
3202   (void)jenv;
3203   (void)jcls;
3204   (void)jarg1_;
3205   arg1 = *(simgrid::surf::Model **)&jarg1; 
3206   arg2 = 0;
3207   if (jarg2) {
3208     arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
3209     if (!arg2) return 0;
3210   }
3211   arg3 = (int)jarg3; 
3212   arg4 = (double)jarg4; 
3213   arg5 = (double)jarg5; 
3214   result = (simgrid::surf::Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5);
3215   *(simgrid::surf::Cpu **)&jresult = result; 
3216   {
3217     
3218   }
3219   return jresult;
3220 }
3221
3222
3223 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Cpu(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3224   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3225   
3226   (void)jenv;
3227   (void)jcls;
3228   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3229   delete arg1;
3230 }
3231
3232
3233 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCurrentPowerPeak(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3234   jdouble jresult = 0 ;
3235   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3236   double result;
3237   
3238   (void)jenv;
3239   (void)jcls;
3240   (void)jarg1_;
3241   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3242   result = (double)(arg1)->getCurrentPowerPeak();
3243   jresult = (jdouble)result; 
3244   return jresult;
3245 }
3246
3247
3248 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCurrentPowerPeakSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3249   jdouble jresult = 0 ;
3250   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3251   double result;
3252   
3253   (void)jenv;
3254   (void)jcls;
3255   (void)jarg1_;
3256   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3257   result = (double)(arg1)->simgrid::surf::Cpu::getCurrentPowerPeak();
3258   jresult = (jdouble)result; 
3259   return jresult;
3260 }
3261
3262
3263 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1execute(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3264   jlong jresult = 0 ;
3265   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3266   double arg2 ;
3267   simgrid::surf::CpuAction *result = 0 ;
3268   
3269   (void)jenv;
3270   (void)jcls;
3271   (void)jarg1_;
3272   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3273   arg2 = (double)jarg2; 
3274   result = (simgrid::surf::CpuAction *)(arg1)->execute(arg2);
3275   *(simgrid::surf::CpuAction **)&jresult = result; 
3276   return jresult;
3277 }
3278
3279
3280 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1sleep(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3281   jlong jresult = 0 ;
3282   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3283   double arg2 ;
3284   simgrid::surf::CpuAction *result = 0 ;
3285   
3286   (void)jenv;
3287   (void)jcls;
3288   (void)jarg1_;
3289   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3290   arg2 = (double)jarg2; 
3291   result = (simgrid::surf::CpuAction *)(arg1)->sleep(arg2);
3292   *(simgrid::surf::CpuAction **)&jresult = result; 
3293   return jresult;
3294 }
3295
3296
3297 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCore(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3298   jint jresult = 0 ;
3299   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3300   int result;
3301   
3302   (void)jenv;
3303   (void)jcls;
3304   (void)jarg1_;
3305   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3306   result = (int)(arg1)->getCore();
3307   jresult = (jint)result; 
3308   return jresult;
3309 }
3310
3311
3312 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCoreSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3313   jint jresult = 0 ;
3314   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3315   int result;
3316   
3317   (void)jenv;
3318   (void)jcls;
3319   (void)jarg1_;
3320   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3321   result = (int)(arg1)->simgrid::surf::Cpu::getCore();
3322   jresult = (jint)result; 
3323   return jresult;
3324 }
3325
3326
3327 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getSpeed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3328   jdouble jresult = 0 ;
3329   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3330   double arg2 ;
3331   double result;
3332   
3333   (void)jenv;
3334   (void)jcls;
3335   (void)jarg1_;
3336   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3337   arg2 = (double)jarg2; 
3338   result = (double)(arg1)->getSpeed(arg2);
3339   jresult = (jdouble)result; 
3340   return jresult;
3341 }
3342
3343
3344 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getSpeedSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3345   jdouble jresult = 0 ;
3346   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3347   double arg2 ;
3348   double result;
3349   
3350   (void)jenv;
3351   (void)jcls;
3352   (void)jarg1_;
3353   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3354   arg2 = (double)jarg2; 
3355   result = (double)(arg1)->simgrid::surf::Cpu::getSpeed(arg2);
3356   jresult = (jdouble)result; 
3357   return jresult;
3358 }
3359
3360
3361 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getAvailableSpeed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3362   jdouble jresult = 0 ;
3363   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3364   double result;
3365   
3366   (void)jenv;
3367   (void)jcls;
3368   (void)jarg1_;
3369   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3370   result = (double)(arg1)->getAvailableSpeed();
3371   jresult = (jdouble)result; 
3372   return jresult;
3373 }
3374
3375
3376 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getAvailableSpeedSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3377   jdouble jresult = 0 ;
3378   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3379   double result;
3380   
3381   (void)jenv;
3382   (void)jcls;
3383   (void)jarg1_;
3384   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3385   result = (double)(arg1)->simgrid::surf::Cpu::getAvailableSpeed();
3386   jresult = (jdouble)result; 
3387   return jresult;
3388 }
3389
3390
3391 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getPowerPeakAt(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
3392   jdouble jresult = 0 ;
3393   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3394   int arg2 ;
3395   double result;
3396   
3397   (void)jenv;
3398   (void)jcls;
3399   (void)jarg1_;
3400   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3401   arg2 = (int)jarg2; 
3402   result = (double)(arg1)->getPowerPeakAt(arg2);
3403   jresult = (jdouble)result; 
3404   return jresult;
3405 }
3406
3407
3408 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getNbPstates(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3409   jint jresult = 0 ;
3410   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3411   int result;
3412   
3413   (void)jenv;
3414   (void)jcls;
3415   (void)jarg1_;
3416   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3417   result = (int)(arg1)->getNbPstates();
3418   jresult = (jint)result; 
3419   return jresult;
3420 }
3421
3422
3423 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1setPstate(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
3424   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3425   int arg2 ;
3426   
3427   (void)jenv;
3428   (void)jcls;
3429   (void)jarg1_;
3430   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3431   arg2 = (int)jarg2; 
3432   (arg1)->setPstate(arg2);
3433 }
3434
3435
3436 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getPstate(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3437   jint jresult = 0 ;
3438   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3439   int result;
3440   
3441   (void)jenv;
3442   (void)jcls;
3443   (void)jarg1_;
3444   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3445   result = (int)(arg1)->getPstate();
3446   jresult = (jint)result; 
3447   return jresult;
3448 }
3449
3450
3451 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1setState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
3452   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3453   e_surf_resource_state_t arg2 ;
3454   
3455   (void)jenv;
3456   (void)jcls;
3457   (void)jarg1_;
3458   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3459   arg2 = (e_surf_resource_state_t)jarg2; 
3460   (arg1)->setState(arg2);
3461 }
3462
3463
3464 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) {
3465   simgrid::surf::Cpu *obj = *((simgrid::surf::Cpu **)&objarg);
3466   (void)jcls;
3467   SwigDirector_Cpu *director = dynamic_cast<SwigDirector_Cpu *>(obj);
3468   if (director) {
3469     director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE));
3470   }
3471 }
3472
3473
3474 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {
3475   simgrid::surf::Cpu *obj = *((simgrid::surf::Cpu **)&objarg);
3476   SwigDirector_Cpu *director = dynamic_cast<SwigDirector_Cpu *>(obj);
3477   (void)jcls;
3478   if (director) {
3479     director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false);
3480   }
3481 }
3482
3483
3484 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Link(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3485   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3486   
3487   (void)jenv;
3488   (void)jcls;
3489   arg1 = *(simgrid::surf::Link **)&jarg1; 
3490   delete arg1;
3491 }
3492
3493
3494 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Link_1getBandwidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3495   jdouble jresult = 0 ;
3496   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3497   double result;
3498   
3499   (void)jenv;
3500   (void)jcls;
3501   (void)jarg1_;
3502   arg1 = *(simgrid::surf::Link **)&jarg1; 
3503   result = (double)(arg1)->getBandwidth();
3504   jresult = (jdouble)result; 
3505   return jresult;
3506 }
3507
3508
3509 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateBandwidth_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
3510   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3511   double arg2 ;
3512   double arg3 ;
3513   
3514   (void)jenv;
3515   (void)jcls;
3516   (void)jarg1_;
3517   arg1 = *(simgrid::surf::Link **)&jarg1; 
3518   arg2 = (double)jarg2; 
3519   arg3 = (double)jarg3; 
3520   (arg1)->updateBandwidth(arg2,arg3);
3521 }
3522
3523
3524 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateBandwidth_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3525   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3526   double arg2 ;
3527   
3528   (void)jenv;
3529   (void)jcls;
3530   (void)jarg1_;
3531   arg1 = *(simgrid::surf::Link **)&jarg1; 
3532   arg2 = (double)jarg2; 
3533   (arg1)->updateBandwidth(arg2);
3534 }
3535
3536
3537 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Link_1getLatency(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3538   jdouble jresult = 0 ;
3539   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3540   double result;
3541   
3542   (void)jenv;
3543   (void)jcls;
3544   (void)jarg1_;
3545   arg1 = *(simgrid::surf::Link **)&jarg1; 
3546   result = (double)(arg1)->getLatency();
3547   jresult = (jdouble)result; 
3548   return jresult;
3549 }
3550
3551
3552 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateLatency_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
3553   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3554   double arg2 ;
3555   double arg3 ;
3556   
3557   (void)jenv;
3558   (void)jcls;
3559   (void)jarg1_;
3560   arg1 = *(simgrid::surf::Link **)&jarg1; 
3561   arg2 = (double)jarg2; 
3562   arg3 = (double)jarg3; 
3563   (arg1)->updateLatency(arg2,arg3);
3564 }
3565
3566
3567 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateLatency_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3568   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3569   double arg2 ;
3570   
3571   (void)jenv;
3572   (void)jcls;
3573   (void)jarg1_;
3574   arg1 = *(simgrid::surf::Link **)&jarg1; 
3575   arg2 = (double)jarg2; 
3576   (arg1)->updateLatency(arg2);
3577 }
3578
3579
3580 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Link_1getProperties(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3581   jlong jresult = 0 ;
3582   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3583   s_xbt_dict *result = 0 ;
3584   
3585   (void)jenv;
3586   (void)jcls;
3587   (void)jarg1_;
3588   arg1 = *(simgrid::surf::Link **)&jarg1; 
3589   result = (s_xbt_dict *)(arg1)->getProperties();
3590   *(s_xbt_dict **)&jresult = result; 
3591   return jresult;
3592 }
3593
3594
3595 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Action(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jboolean jarg3) {
3596   jlong jresult = 0 ;
3597   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
3598   double arg2 ;
3599   bool arg3 ;
3600   simgrid::surf::Action *result = 0 ;
3601   
3602   (void)jenv;
3603   (void)jcls;
3604   (void)jarg1_;
3605   arg1 = *(simgrid::surf::Model **)&jarg1; 
3606   arg2 = (double)jarg2; 
3607   arg3 = jarg3 ? true : false; 
3608   result = (simgrid::surf::Action *)new simgrid::surf::Action(arg1,arg2,arg3);
3609   *(simgrid::surf::Action **)&jresult = result; 
3610   return jresult;
3611 }
3612
3613
3614 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Action(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3615   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3616   
3617   (void)jenv;
3618   (void)jcls;
3619   arg1 = *(simgrid::surf::Action **)&jarg1; 
3620   delete arg1;
3621 }
3622
3623
3624 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3625   jlong jresult = 0 ;
3626   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3627   simgrid::surf::Model *result = 0 ;
3628   
3629   (void)jenv;
3630   (void)jcls;
3631   (void)jarg1_;
3632   arg1 = *(simgrid::surf::Action **)&jarg1; 
3633   result = (simgrid::surf::Model *)(arg1)->getModel();
3634   *(simgrid::surf::Model **)&jresult = result; 
3635   return jresult;
3636 }
3637
3638
3639 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getVariable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3640   jlong jresult = 0 ;
3641   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3642   lmm_variable *result = 0 ;
3643   
3644   (void)jenv;
3645   (void)jcls;
3646   (void)jarg1_;
3647   arg1 = *(simgrid::surf::Action **)&jarg1; 
3648   result = (lmm_variable *)(arg1)->getVariable();
3649   *(lmm_variable **)&jresult = result; 
3650   return jresult;
3651 }
3652
3653
3654 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3655   jint jresult = 0 ;
3656   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3657   e_surf_action_state_t result;
3658   
3659   (void)jenv;
3660   (void)jcls;
3661   (void)jarg1_;
3662   arg1 = *(simgrid::surf::Action **)&jarg1; 
3663   result = (e_surf_action_state_t)(arg1)->getState();
3664   jresult = (jint)result; 
3665   return jresult;
3666 }
3667
3668
3669 SWIGEXPORT jboolean JNICALL Java_org_simgrid_surf_SurfJNI_Action_1isSuspended(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3670   jboolean jresult = 0 ;
3671   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3672   bool result;
3673   
3674   (void)jenv;
3675   (void)jcls;
3676   (void)jarg1_;
3677   arg1 = *(simgrid::surf::Action **)&jarg1; 
3678   result = (bool)(arg1)->isSuspended();
3679   jresult = (jboolean)result; 
3680   return jresult;
3681 }
3682
3683
3684 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getBound(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3685   jdouble jresult = 0 ;
3686   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3687   double result;
3688   
3689   (void)jenv;
3690   (void)jcls;
3691   (void)jarg1_;
3692   arg1 = *(simgrid::surf::Action **)&jarg1; 
3693   result = (double)(arg1)->getBound();
3694   jresult = (jdouble)result; 
3695   return jresult;
3696 }
3697
3698
3699 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setBound(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3700   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3701   double arg2 ;
3702   
3703   (void)jenv;
3704   (void)jcls;
3705   (void)jarg1_;
3706   arg1 = *(simgrid::surf::Action **)&jarg1; 
3707   arg2 = (double)jarg2; 
3708   (arg1)->setBound(arg2);
3709 }
3710
3711
3712 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1updateRemains(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3713   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3714   double arg2 ;
3715   
3716   (void)jenv;
3717   (void)jcls;
3718   (void)jarg1_;
3719   arg1 = *(simgrid::surf::Action **)&jarg1; 
3720   arg2 = (double)jarg2; 
3721   (arg1)->updateRemains(arg2);
3722 }
3723
3724
3725 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getRemains(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3726   jdouble jresult = 0 ;
3727   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3728   double result;
3729   
3730   (void)jenv;
3731   (void)jcls;
3732   (void)jarg1_;
3733   arg1 = *(simgrid::surf::Action **)&jarg1; 
3734   result = (double)(arg1)->getRemains();
3735   jresult = (jdouble)result; 
3736   return jresult;
3737 }
3738
3739
3740 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setPriority(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3741   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3742   double arg2 ;
3743   
3744   (void)jenv;
3745   (void)jcls;
3746   (void)jarg1_;
3747   arg1 = *(simgrid::surf::Action **)&jarg1; 
3748   arg2 = (double)jarg2; 
3749   (arg1)->setPriority(arg2);
3750 }
3751
3752
3753 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
3754   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3755   e_surf_action_state_t arg2 ;
3756   
3757   (void)jenv;
3758   (void)jcls;
3759   (void)jarg1_;
3760   arg1 = *(simgrid::surf::Action **)&jarg1; 
3761   arg2 = (e_surf_action_state_t)jarg2; 
3762   (arg1)->setState(arg2);
3763 }
3764
3765
3766 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1CpuAction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jboolean jarg3) {
3767   jlong jresult = 0 ;
3768   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
3769   double arg2 ;
3770   bool arg3 ;
3771   simgrid::surf::CpuAction *result = 0 ;
3772   
3773   (void)jenv;
3774   (void)jcls;
3775   (void)jarg1_;
3776   arg1 = *(simgrid::surf::Model **)&jarg1; 
3777   arg2 = (double)jarg2; 
3778   arg3 = jarg3 ? true : false; 
3779   result = (simgrid::surf::CpuAction *)new SwigDirector_CpuAction(jenv,arg1,arg2,arg3);
3780   *(simgrid::surf::CpuAction **)&jresult = result; 
3781   return jresult;
3782 }
3783
3784
3785 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1getCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3786   jlong jresult = 0 ;
3787   simgrid::surf::CpuAction *arg1 = (simgrid::surf::CpuAction *) 0 ;
3788   simgrid::surf::Cpu *result = 0 ;
3789   
3790   (void)jenv;
3791   (void)jcls;
3792   (void)jarg1_;
3793   arg1 = *(simgrid::surf::CpuAction **)&jarg1; 
3794   result = (simgrid::surf::Cpu *)simgrid_surf_CpuAction_getCpu(arg1);
3795   *(simgrid::surf::Cpu **)&jresult = result; 
3796   return jresult;
3797 }
3798
3799
3800 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1CpuAction(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3801   simgrid::surf::CpuAction *arg1 = (simgrid::surf::CpuAction *) 0 ;
3802   
3803   (void)jenv;
3804   (void)jcls;
3805   arg1 = *(simgrid::surf::CpuAction **)&jarg1; 
3806   delete arg1;
3807 }
3808
3809
3810 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) {
3811   simgrid::surf::CpuAction *obj = *((simgrid::surf::CpuAction **)&objarg);
3812   (void)jcls;
3813   SwigDirector_CpuAction *director = dynamic_cast<SwigDirector_CpuAction *>(obj);
3814   if (director) {
3815     director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE));
3816   }
3817 }
3818
3819
3820 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {
3821   simgrid::surf::CpuAction *obj = *((simgrid::surf::CpuAction **)&objarg);
3822   SwigDirector_CpuAction *director = dynamic_cast<SwigDirector_CpuAction *>(obj);
3823   (void)jcls;
3824   if (director) {
3825     director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false);
3826   }
3827 }
3828
3829
3830 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_NetworkAction_1getLatency(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3831   jdouble jresult = 0 ;
3832   simgrid::surf::NetworkAction *arg1 = (simgrid::surf::NetworkAction *) 0 ;
3833   double result;
3834   
3835   (void)jenv;
3836   (void)jcls;
3837   (void)jarg1_;
3838   arg1 = *(simgrid::surf::NetworkAction **)&jarg1; 
3839   result = (double)simgrid_surf_NetworkAction_getLatency(arg1);
3840   jresult = (jdouble)result; 
3841   return jresult;
3842 }
3843
3844
3845 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1NetworkAction(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3846   simgrid::surf::NetworkAction *arg1 = (simgrid::surf::NetworkAction *) 0 ;
3847   
3848   (void)jenv;
3849   (void)jcls;
3850   arg1 = *(simgrid::surf::NetworkAction **)&jarg1; 
3851   delete arg1;
3852 }
3853
3854
3855 SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_RoutingEdge_1getName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3856   jstring jresult = 0 ;
3857   simgrid::surf::RoutingEdge *arg1 = (simgrid::surf::RoutingEdge *) 0 ;
3858   char *result = 0 ;
3859   
3860   (void)jenv;
3861   (void)jcls;
3862   (void)jarg1_;
3863   arg1 = *(simgrid::surf::RoutingEdge **)&jarg1; 
3864   result = (char *)(arg1)->getName();
3865   if (result) jresult = jenv->NewStringUTF((const char *)result);
3866   return jresult;
3867 }
3868
3869
3870 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1RoutingEdge(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3871   simgrid::surf::RoutingEdge *arg1 = (simgrid::surf::RoutingEdge *) 0 ;
3872   
3873   (void)jenv;
3874   (void)jcls;
3875   arg1 = *(simgrid::surf::RoutingEdge **)&jarg1; 
3876   delete arg1;
3877 }
3878
3879
3880 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_LmmConstraint_1getUsage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3881   jdouble jresult = 0 ;
3882   lmm_constraint *arg1 = (lmm_constraint *) 0 ;
3883   double result;
3884   
3885   (void)jenv;
3886   (void)jcls;
3887   (void)jarg1_;
3888   arg1 = *(lmm_constraint **)&jarg1; 
3889   result = (double)lmm_constraint_getUsage(arg1);
3890   jresult = (jdouble)result; 
3891   return jresult;
3892 }
3893
3894
3895 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1LmmConstraint(JNIEnv *jenv, jclass jcls) {
3896   jlong jresult = 0 ;
3897   lmm_constraint *result = 0 ;
3898   
3899   (void)jenv;
3900   (void)jcls;
3901   result = (lmm_constraint *)new lmm_constraint();
3902   *(lmm_constraint **)&jresult = result; 
3903   return jresult;
3904 }
3905
3906
3907 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1LmmConstraint(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3908   lmm_constraint *arg1 = (lmm_constraint *) 0 ;
3909   
3910   (void)jenv;
3911   (void)jcls;
3912   arg1 = *(lmm_constraint **)&jarg1; 
3913   delete arg1;
3914 }
3915
3916
3917 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_LmmVariable_1getValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3918   jdouble jresult = 0 ;
3919   lmm_variable *arg1 = (lmm_variable *) 0 ;
3920   double result;
3921   
3922   (void)jenv;
3923   (void)jcls;
3924   (void)jarg1_;
3925   arg1 = *(lmm_variable **)&jarg1; 
3926   result = (double)lmm_variable_getValue(arg1);
3927   jresult = (jdouble)result; 
3928   return jresult;
3929 }
3930
3931
3932 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1LmmVariable(JNIEnv *jenv, jclass jcls) {
3933   jlong jresult = 0 ;
3934   lmm_variable *result = 0 ;
3935   
3936   (void)jenv;
3937   (void)jcls;
3938   result = (lmm_variable *)new lmm_variable();
3939   *(lmm_variable **)&jresult = result; 
3940   return jresult;
3941 }
3942
3943
3944 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1LmmVariable(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3945   lmm_variable *arg1 = (lmm_variable *) 0 ;
3946   
3947   (void)jenv;
3948   (void)jcls;
3949   arg1 = *(lmm_variable **)&jarg1; 
3950   delete arg1;
3951 }
3952
3953
3954 SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_XbtDict_1getValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) {
3955   jstring jresult = 0 ;
3956   s_xbt_dict *arg1 = (s_xbt_dict *) 0 ;
3957   char *arg2 = (char *) 0 ;
3958   char *result = 0 ;
3959   
3960   (void)jenv;
3961   (void)jcls;
3962   (void)jarg1_;
3963   arg1 = *(s_xbt_dict **)&jarg1; 
3964   arg2 = 0;
3965   if (jarg2) {
3966     arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
3967     if (!arg2) return 0;
3968   }
3969   result = (char *)s_xbt_dict_getValue(arg1,arg2);
3970   if (result) jresult = jenv->NewStringUTF((const char *)result);
3971   if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
3972   return jresult;
3973 }
3974
3975
3976 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1XbtDict(JNIEnv *jenv, jclass jcls) {
3977   jlong jresult = 0 ;
3978   s_xbt_dict *result = 0 ;
3979   
3980   (void)jenv;
3981   (void)jcls;
3982   result = (s_xbt_dict *)new s_xbt_dict();
3983   *(s_xbt_dict **)&jresult = result; 
3984   return jresult;
3985 }
3986
3987
3988 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1XbtDict(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3989   s_xbt_dict *arg1 = (s_xbt_dict *) 0 ;
3990   
3991   (void)jenv;
3992   (void)jcls;
3993   arg1 = *(s_xbt_dict **)&jarg1; 
3994   delete arg1;
3995 }
3996
3997
3998 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_SURF_1ACTION_1READY_1get(JNIEnv *jenv, jclass jcls) {
3999   jint jresult = 0 ;
4000   e_surf_action_state_t result;
4001   
4002   (void)jenv;
4003   (void)jcls;
4004   result = (e_surf_action_state_t)SURF_ACTION_READY;
4005   jresult = (jint)result; 
4006   return jresult;
4007 }
4008
4009
4010 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_SURF_1RESOURCE_1ON_1get(JNIEnv *jenv, jclass jcls) {
4011   jint jresult = 0 ;
4012   e_surf_resource_state_t result;
4013   
4014   (void)jenv;
4015   (void)jcls;
4016   result = (e_surf_resource_state_t)SURF_RESOURCE_ON;
4017   jresult = (jint)result; 
4018   return jresult;
4019 }
4020
4021
4022 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_SURF_1RESOURCE_1OFF_1get(JNIEnv *jenv, jclass jcls) {
4023   jint jresult = 0 ;
4024   e_surf_resource_state_t result;
4025   
4026   (void)jenv;
4027   (void)jcls;
4028   result = (e_surf_resource_state_t)SURF_RESOURCE_OFF;
4029   jresult = (jint)result; 
4030   return jresult;
4031 }
4032
4033
4034 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
4035     jlong baseptr = 0;
4036     (void)jenv;
4037     (void)jcls;
4038     *(simgrid::surf::Model **)&baseptr = *(simgrid::surf::CpuModel **)&jarg1;
4039     return baseptr;
4040 }
4041
4042 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
4043     jlong baseptr = 0;
4044     (void)jenv;
4045     (void)jcls;
4046     *(simgrid::surf::Resource **)&baseptr = *(simgrid::surf::Cpu **)&jarg1;
4047     return baseptr;
4048 }
4049
4050 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Link_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
4051     jlong baseptr = 0;
4052     (void)jenv;
4053     (void)jcls;
4054     *(simgrid::surf::Resource **)&baseptr = *(simgrid::surf::Link **)&jarg1;
4055     return baseptr;
4056 }
4057
4058 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
4059     jlong baseptr = 0;
4060     (void)jenv;
4061     (void)jcls;
4062     *(simgrid::surf::Action **)&baseptr = *(simgrid::surf::CpuAction **)&jarg1;
4063     return baseptr;
4064 }
4065
4066 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_NetworkAction_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
4067     jlong baseptr = 0;
4068     (void)jenv;
4069     (void)jcls;
4070     *(simgrid::surf::Action **)&baseptr = *(simgrid::surf::NetworkAction **)&jarg1;
4071     return baseptr;
4072 }
4073
4074 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_swig_1module_1init(JNIEnv *jenv, jclass jcls) {
4075   int i;
4076   
4077   static struct {
4078     const char *method;
4079     const char *signature;
4080   } methods[34] = {
4081     {
4082       "SwigDirector_Plugin_cpuCreatedCallback", "(Lorg/simgrid/surf/Plugin;J)V" 
4083     },
4084     {
4085       "SwigDirector_Plugin_cpuDestructedCallback", "(Lorg/simgrid/surf/Plugin;J)V" 
4086     },
4087     {
4088       "SwigDirector_Plugin_cpuStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" 
4089     },
4090     {
4091       "SwigDirector_Plugin_cpuActionStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" 
4092     },
4093     {
4094       "SwigDirector_Plugin_networkLinkCreatedCallback", "(Lorg/simgrid/surf/Plugin;J)V" 
4095     },
4096     {
4097       "SwigDirector_Plugin_networkLinkDestructedCallback", "(Lorg/simgrid/surf/Plugin;J)V" 
4098     },
4099     {
4100       "SwigDirector_Plugin_networkLinkStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" 
4101     },
4102     {
4103       "SwigDirector_Plugin_networkActionStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" 
4104     },
4105     {
4106       "SwigDirector_Plugin_networkCommunicateCallback", "(Lorg/simgrid/surf/Plugin;JJJDD)V" 
4107     },
4108     {
4109       "SwigDirector_CpuModel_shareResources", "(Lorg/simgrid/surf/CpuModel;D)D" 
4110     },
4111     {
4112       "SwigDirector_CpuModel_shareResourcesLazy", "(Lorg/simgrid/surf/CpuModel;D)D" 
4113     },
4114     {
4115       "SwigDirector_CpuModel_shareResourcesFull", "(Lorg/simgrid/surf/CpuModel;D)D" 
4116     },
4117     {
4118       "SwigDirector_CpuModel_updateActionsState", "(Lorg/simgrid/surf/CpuModel;DD)V" 
4119     },
4120     {
4121       "SwigDirector_CpuModel_updateActionsStateLazy", "(Lorg/simgrid/surf/CpuModel;DD)V" 
4122     },
4123     {
4124       "SwigDirector_CpuModel_updateActionsStateFull", "(Lorg/simgrid/surf/CpuModel;DD)V" 
4125     },
4126     {
4127       "SwigDirector_CpuModel_getRunningActionSet", "(Lorg/simgrid/surf/CpuModel;)J" 
4128     },
4129     {
4130       "SwigDirector_CpuModel_addTraces", "(Lorg/simgrid/surf/CpuModel;)V" 
4131     },
4132     {
4133       "SwigDirector_CpuModel_createCpu", "(Lorg/simgrid/surf/CpuModel;Ljava/lang/String;[DIDJIIJ)J" 
4134     },
4135     {
4136       "SwigDirector_Cpu_isUsed", "(Lorg/simgrid/surf/Cpu;)Z" 
4137     },
4138     {
4139       "SwigDirector_Cpu_getState", "(Lorg/simgrid/surf/Cpu;)I" 
4140     },
4141     {
4142       "SwigDirector_Cpu_updateState", "(Lorg/simgrid/surf/Cpu;JDD)V" 
4143     },
4144     {
4145       "SwigDirector_Cpu_getCurrentPowerPeak", "(Lorg/simgrid/surf/Cpu;)D" 
4146     },
4147     {
4148       "SwigDirector_Cpu_execute", "(Lorg/simgrid/surf/Cpu;D)J" 
4149     },
4150     {
4151       "SwigDirector_Cpu_sleep", "(Lorg/simgrid/surf/Cpu;D)J" 
4152     },
4153     {
4154       "SwigDirector_Cpu_getCore", "(Lorg/simgrid/surf/Cpu;)I" 
4155     },
4156     {
4157       "SwigDirector_Cpu_getSpeed", "(Lorg/simgrid/surf/Cpu;D)D" 
4158     },
4159     {
4160       "SwigDirector_Cpu_getAvailableSpeed", "(Lorg/simgrid/surf/Cpu;)D" 
4161     },
4162     {
4163       "SwigDirector_Cpu_getPowerPeakAt", "(Lorg/simgrid/surf/Cpu;I)D" 
4164     },
4165     {
4166       "SwigDirector_Cpu_getNbPstates", "(Lorg/simgrid/surf/Cpu;)I" 
4167     },
4168     {
4169       "SwigDirector_Cpu_setPstate", "(Lorg/simgrid/surf/Cpu;I)V" 
4170     },
4171     {
4172       "SwigDirector_Cpu_getPstate", "(Lorg/simgrid/surf/Cpu;)I" 
4173     },
4174     {
4175       "SwigDirector_CpuAction_getRemains", "(Lorg/simgrid/surf/CpuAction;)D" 
4176     },
4177     {
4178       "SwigDirector_CpuAction_setPriority", "(Lorg/simgrid/surf/CpuAction;D)V" 
4179     },
4180     {
4181       "SwigDirector_CpuAction_setState", "(Lorg/simgrid/surf/CpuAction;I)V" 
4182     }
4183   };
4184   Swig::jclass_SurfJNI = (jclass) jenv->NewGlobalRef(jcls);
4185   if (!Swig::jclass_SurfJNI) return;
4186   for (i = 0; i < (int) (sizeof(methods)/sizeof(methods[0])); ++i) {
4187     Swig::director_methids[i] = jenv->GetStaticMethodID(jcls, methods[i].method, methods[i].signature);
4188     if (!Swig::director_methids[i]) return;
4189   }
4190 }
4191
4192
4193 #ifdef __cplusplus
4194 }
4195 #endif
4196