Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merging changes done by Steven, Samuel and Luka, regarding simulation of StarPU-MPI
[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, s_xbt_dict *cpu_properties) {
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   jlong jcpu_properties = 0 ;
1556   
1557   if (!swig_override[8]) {
1558     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::CpuModel::createCpu.");
1559     return c_result;
1560   }
1561   swigjobj = swig_get_self(jenv);
1562   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1563     jname = 0;
1564     if (name) {
1565       jname = jenv->NewStringUTF((const char *)name);
1566       if (!jname) return c_result;
1567     }
1568     
1569     long l = xbt_dynar_length(power_peak);
1570     jpower_peak = jenv->NewDoubleArray(l);
1571     double *lout = (double *) xbt_dynar_get_ptr(power_peak, 0);
1572     jenv->SetDoubleArrayRegion(jpower_peak, 0, l, (jdouble*)lout);
1573     
1574     jpstate = (jint) pstate;
1575     jpower_scale = (jdouble) power_scale;
1576     *((tmgr_trace **)&jpower_trace) = (tmgr_trace *) power_trace; 
1577     jcore = (jint) core;
1578     jstate_initial = (jint) state_initial;
1579     *((tmgr_trace **)&jstate_trace) = (tmgr_trace *) state_trace; 
1580     *((s_xbt_dict **)&jcpu_properties) = (s_xbt_dict *) cpu_properties; 
1581     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, jcpu_properties);
1582     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1583     c_result = *(simgrid::surf::Cpu **)&jresult; 
1584   } else {
1585     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1586   }
1587   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1588   return c_result;
1589 }
1590
1591 void SwigDirector_CpuModel::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) {
1592   static struct {
1593     const char *mname;
1594     const char *mdesc;
1595     jmethodID base_methid;
1596   } methods[] = {
1597     {
1598       "shareResources", "(D)D", NULL 
1599     },
1600     {
1601       "shareResourcesLazy", "(D)D", NULL 
1602     },
1603     {
1604       "shareResourcesFull", "(D)D", NULL 
1605     },
1606     {
1607       "updateActionsState", "(DD)V", NULL 
1608     },
1609     {
1610       "updateActionsStateLazy", "(DD)V", NULL 
1611     },
1612     {
1613       "updateActionsStateFull", "(DD)V", NULL 
1614     },
1615     {
1616       "getRunningActionSet", "()Lorg/simgrid/surf/ActionList;", NULL 
1617     },
1618     {
1619       "addTraces", "()V", NULL 
1620     },
1621     {
1622       "createCpu", "(Ljava/lang/String;[DIDLorg/simgrid/surf/TmgrTrace;ILorg/simgrid/surf/ResourceState;Lorg/simgrid/surf/TmgrTrace;Lorg/simgrid/surf/XbtDict;)Lorg/simgrid/surf/Cpu;", NULL 
1623     }
1624   };
1625   
1626   static jclass baseclass = 0 ;
1627   
1628   if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) {
1629     if (!baseclass) {
1630       baseclass = jenv->FindClass("org/simgrid/surf/CpuModel");
1631       if (!baseclass) return;
1632       baseclass = (jclass) jenv->NewGlobalRef(baseclass);
1633     }
1634     bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true);
1635     for (int i = 0; i < 9; ++i) {
1636       if (!methods[i].base_methid) {
1637         methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc);
1638         if (!methods[i].base_methid) return;
1639       }
1640       swig_override[i] = false;
1641       if (derived) {
1642         jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc);
1643         swig_override[i] = (methid != methods[i].base_methid);
1644         jenv->ExceptionClear();
1645       }
1646     }
1647   }
1648 }
1649
1650
1651 SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, s_xbt_dict *props, lmm_constraint *constraint, int core, double powerPeak, double powerScale) : simgrid::surf::Cpu(model, name, props, constraint, core, powerPeak, powerScale), Swig::Director(jenv) {
1652 }
1653
1654 SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, s_xbt_dict *props, int core, double powerPeak, double powerScale) : simgrid::surf::Cpu(model, name, props, core, powerPeak, powerScale), Swig::Director(jenv) {
1655 }
1656
1657 bool SwigDirector_Cpu::isUsed() {
1658   bool c_result = SwigValueInit< bool >() ;
1659   jboolean jresult = 0 ;
1660   JNIEnvWrapper swigjnienv(this) ;
1661   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1662   jobject swigjobj = (jobject) NULL ;
1663   
1664   if (!swig_override[0]) {
1665     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::isUsed.");
1666     return c_result;
1667   }
1668   swigjobj = swig_get_self(jenv);
1669   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1670     jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_SurfJNI, Swig::director_methids[18], swigjobj);
1671     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1672     c_result = jresult ? true : false; 
1673   } else {
1674     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1675   }
1676   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1677   return c_result;
1678 }
1679
1680 e_surf_resource_state_t SwigDirector_Cpu::getState() {
1681   e_surf_resource_state_t c_result = SwigValueInit< e_surf_resource_state_t >() ;
1682   jint jresult = 0 ;
1683   JNIEnvWrapper swigjnienv(this) ;
1684   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1685   jobject swigjobj = (jobject) NULL ;
1686   
1687   if (!swig_override[1]) {
1688     return simgrid::surf::Resource::getState();
1689   }
1690   swigjobj = swig_get_self(jenv);
1691   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1692     jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[19], swigjobj);
1693     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1694     c_result = (e_surf_resource_state_t)jresult; 
1695   } else {
1696     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1697   }
1698   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1699   return c_result;
1700 }
1701
1702 void SwigDirector_Cpu::updateState(tmgr_trace_event *event_type, double value, double date) {
1703   JNIEnvWrapper swigjnienv(this) ;
1704   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1705   jobject swigjobj = (jobject) NULL ;
1706   jlong jevent_type = 0 ;
1707   jdouble jvalue  ;
1708   jdouble jdate  ;
1709   
1710   if (!swig_override[2]) {
1711     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::updateState.");
1712     return;
1713   }
1714   swigjobj = swig_get_self(jenv);
1715   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1716     *((tmgr_trace_event **)&jevent_type) = (tmgr_trace_event *) event_type; 
1717     jvalue = (jdouble) value;
1718     jdate = (jdouble) date;
1719     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[20], swigjobj, jevent_type, jvalue, jdate);
1720     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1721   } else {
1722     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1723   }
1724   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1725 }
1726
1727 SwigDirector_Cpu::~SwigDirector_Cpu() {
1728   swig_disconnect_director_self("swigDirectorDisconnect");
1729 }
1730
1731
1732 double SwigDirector_Cpu::getCurrentPowerPeak() {
1733   double c_result = SwigValueInit< double >() ;
1734   jdouble jresult = 0 ;
1735   JNIEnvWrapper swigjnienv(this) ;
1736   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1737   jobject swigjobj = (jobject) NULL ;
1738   
1739   if (!swig_override[3]) {
1740     return simgrid::surf::Cpu::getCurrentPowerPeak();
1741   }
1742   swigjobj = swig_get_self(jenv);
1743   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1744     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[21], swigjobj);
1745     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1746     c_result = (double)jresult; 
1747   } else {
1748     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1749   }
1750   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1751   return c_result;
1752 }
1753
1754 simgrid::surf::CpuAction *SwigDirector_Cpu::execute(double size) {
1755   simgrid::surf::CpuAction *c_result = 0 ;
1756   jlong jresult = 0 ;
1757   JNIEnvWrapper swigjnienv(this) ;
1758   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1759   jobject swigjobj = (jobject) NULL ;
1760   jdouble jsize  ;
1761   
1762   if (!swig_override[4]) {
1763     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::execute.");
1764     return c_result;
1765   }
1766   swigjobj = swig_get_self(jenv);
1767   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1768     jsize = (jdouble) size;
1769     jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[22], swigjobj, jsize);
1770     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1771     c_result = *(simgrid::surf::CpuAction **)&jresult; 
1772   } else {
1773     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1774   }
1775   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1776   return c_result;
1777 }
1778
1779 simgrid::surf::CpuAction *SwigDirector_Cpu::sleep(double duration) {
1780   simgrid::surf::CpuAction *c_result = 0 ;
1781   jlong jresult = 0 ;
1782   JNIEnvWrapper swigjnienv(this) ;
1783   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1784   jobject swigjobj = (jobject) NULL ;
1785   jdouble jduration  ;
1786   
1787   if (!swig_override[5]) {
1788     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::sleep.");
1789     return c_result;
1790   }
1791   swigjobj = swig_get_self(jenv);
1792   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1793     jduration = (jdouble) duration;
1794     jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[23], swigjobj, jduration);
1795     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1796     c_result = *(simgrid::surf::CpuAction **)&jresult; 
1797   } else {
1798     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1799   }
1800   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1801   return c_result;
1802 }
1803
1804 int SwigDirector_Cpu::getCore() {
1805   int c_result = SwigValueInit< int >() ;
1806   jint jresult = 0 ;
1807   JNIEnvWrapper swigjnienv(this) ;
1808   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1809   jobject swigjobj = (jobject) NULL ;
1810   
1811   if (!swig_override[6]) {
1812     return simgrid::surf::Cpu::getCore();
1813   }
1814   swigjobj = swig_get_self(jenv);
1815   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1816     jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[24], swigjobj);
1817     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1818     c_result = (int)jresult; 
1819   } else {
1820     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1821   }
1822   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1823   return c_result;
1824 }
1825
1826 double SwigDirector_Cpu::getSpeed(double load) {
1827   double c_result = SwigValueInit< double >() ;
1828   jdouble jresult = 0 ;
1829   JNIEnvWrapper swigjnienv(this) ;
1830   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1831   jobject swigjobj = (jobject) NULL ;
1832   jdouble jload  ;
1833   
1834   if (!swig_override[7]) {
1835     return simgrid::surf::Cpu::getSpeed(load);
1836   }
1837   swigjobj = swig_get_self(jenv);
1838   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1839     jload = (jdouble) load;
1840     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[25], swigjobj, jload);
1841     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1842     c_result = (double)jresult; 
1843   } else {
1844     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1845   }
1846   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1847   return c_result;
1848 }
1849
1850 double SwigDirector_Cpu::getAvailableSpeed() {
1851   double c_result = SwigValueInit< double >() ;
1852   jdouble jresult = 0 ;
1853   JNIEnvWrapper swigjnienv(this) ;
1854   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1855   jobject swigjobj = (jobject) NULL ;
1856   
1857   if (!swig_override[8]) {
1858     return simgrid::surf::Cpu::getAvailableSpeed();
1859   }
1860   swigjobj = swig_get_self(jenv);
1861   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1862     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[26], swigjobj);
1863     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1864     c_result = (double)jresult; 
1865   } else {
1866     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1867   }
1868   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1869   return c_result;
1870 }
1871
1872 double SwigDirector_Cpu::getPowerPeakAt(int pstate_index) {
1873   double c_result = SwigValueInit< double >() ;
1874   jdouble jresult = 0 ;
1875   JNIEnvWrapper swigjnienv(this) ;
1876   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1877   jobject swigjobj = (jobject) NULL ;
1878   jint jpstate_index  ;
1879   
1880   if (!swig_override[9]) {
1881     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::getPowerPeakAt.");
1882     return c_result;
1883   }
1884   swigjobj = swig_get_self(jenv);
1885   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1886     jpstate_index = (jint) pstate_index;
1887     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[27], swigjobj, jpstate_index);
1888     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1889     c_result = (double)jresult; 
1890   } else {
1891     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1892   }
1893   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1894   return c_result;
1895 }
1896
1897 int SwigDirector_Cpu::getNbPstates() {
1898   int c_result = SwigValueInit< int >() ;
1899   jint jresult = 0 ;
1900   JNIEnvWrapper swigjnienv(this) ;
1901   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1902   jobject swigjobj = (jobject) NULL ;
1903   
1904   if (!swig_override[10]) {
1905     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::getNbPstates.");
1906     return c_result;
1907   }
1908   swigjobj = swig_get_self(jenv);
1909   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1910     jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[28], swigjobj);
1911     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1912     c_result = (int)jresult; 
1913   } else {
1914     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1915   }
1916   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1917   return c_result;
1918 }
1919
1920 void SwigDirector_Cpu::setPstate(int pstate_index) {
1921   JNIEnvWrapper swigjnienv(this) ;
1922   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1923   jobject swigjobj = (jobject) NULL ;
1924   jint jpstate_index  ;
1925   
1926   if (!swig_override[11]) {
1927     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::setPstate.");
1928     return;
1929   }
1930   swigjobj = swig_get_self(jenv);
1931   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1932     jpstate_index = (jint) pstate_index;
1933     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[29], swigjobj, jpstate_index);
1934     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
1935   } else {
1936     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1937   }
1938   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1939 }
1940
1941 int SwigDirector_Cpu::getPstate() {
1942   int c_result = SwigValueInit< int >() ;
1943   jint jresult = 0 ;
1944   JNIEnvWrapper swigjnienv(this) ;
1945   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
1946   jobject swigjobj = (jobject) NULL ;
1947   
1948   if (!swig_override[12]) {
1949     SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::getPstate.");
1950     return c_result;
1951   }
1952   swigjobj = swig_get_self(jenv);
1953   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
1954     jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[30], swigjobj);
1955     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
1956     c_result = (int)jresult; 
1957   } else {
1958     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
1959   }
1960   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
1961   return c_result;
1962 }
1963
1964 void SwigDirector_Cpu::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) {
1965   static struct {
1966     const char *mname;
1967     const char *mdesc;
1968     jmethodID base_methid;
1969   } methods[] = {
1970     {
1971       "isUsed", "()Z", NULL 
1972     },
1973     {
1974       "getState", "()Lorg/simgrid/surf/ResourceState;", NULL 
1975     },
1976     {
1977       "updateState", "(Lorg/simgrid/surf/TmgrTraceEvent;DD)V", NULL 
1978     },
1979     {
1980       "getCurrentPowerPeak", "()D", NULL 
1981     },
1982     {
1983       "execute", "(D)Lorg/simgrid/surf/CpuAction;", NULL 
1984     },
1985     {
1986       "sleep", "(D)Lorg/simgrid/surf/CpuAction;", NULL 
1987     },
1988     {
1989       "getCore", "()I", NULL 
1990     },
1991     {
1992       "getSpeed", "(D)D", NULL 
1993     },
1994     {
1995       "getAvailableSpeed", "()D", NULL 
1996     },
1997     {
1998       "getPowerPeakAt", "(I)D", NULL 
1999     },
2000     {
2001       "getNbPstates", "()I", NULL 
2002     },
2003     {
2004       "setPstate", "(I)V", NULL 
2005     },
2006     {
2007       "getPstate", "()I", NULL 
2008     }
2009   };
2010   
2011   static jclass baseclass = 0 ;
2012   
2013   if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) {
2014     if (!baseclass) {
2015       baseclass = jenv->FindClass("org/simgrid/surf/Cpu");
2016       if (!baseclass) return;
2017       baseclass = (jclass) jenv->NewGlobalRef(baseclass);
2018     }
2019     bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true);
2020     for (int i = 0; i < 13; ++i) {
2021       if (!methods[i].base_methid) {
2022         methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc);
2023         if (!methods[i].base_methid) return;
2024       }
2025       swig_override[i] = false;
2026       if (derived) {
2027         jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc);
2028         swig_override[i] = (methid != methods[i].base_methid);
2029         jenv->ExceptionClear();
2030       }
2031     }
2032   }
2033 }
2034
2035
2036 SwigDirector_CpuAction::SwigDirector_CpuAction(JNIEnv *jenv, simgrid::surf::Model *model, double cost, bool failed) : simgrid::surf::CpuAction(model, cost, failed), Swig::Director(jenv) {
2037 }
2038
2039 SwigDirector_CpuAction::~SwigDirector_CpuAction() {
2040   swig_disconnect_director_self("swigDirectorDisconnect");
2041 }
2042
2043
2044 double SwigDirector_CpuAction::getRemains() {
2045   double c_result = SwigValueInit< double >() ;
2046   jdouble jresult = 0 ;
2047   JNIEnvWrapper swigjnienv(this) ;
2048   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
2049   jobject swigjobj = (jobject) NULL ;
2050   
2051   if (!swig_override[0]) {
2052     return simgrid::surf::Action::getRemains();
2053   }
2054   swigjobj = swig_get_self(jenv);
2055   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
2056     jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[31], swigjobj);
2057     if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
2058     c_result = (double)jresult; 
2059   } else {
2060     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
2061   }
2062   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
2063   return c_result;
2064 }
2065
2066 void SwigDirector_CpuAction::setPriority(double priority) {
2067   JNIEnvWrapper swigjnienv(this) ;
2068   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
2069   jobject swigjobj = (jobject) NULL ;
2070   jdouble jpriority  ;
2071   
2072   if (!swig_override[1]) {
2073     simgrid::surf::Action::setPriority(priority);
2074     return;
2075   }
2076   swigjobj = swig_get_self(jenv);
2077   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
2078     jpriority = (jdouble) priority;
2079     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[32], swigjobj, jpriority);
2080     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
2081   } else {
2082     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
2083   }
2084   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
2085 }
2086
2087 void SwigDirector_CpuAction::setState(e_surf_action_state_t state) {
2088   JNIEnvWrapper swigjnienv(this) ;
2089   JNIEnv * jenv = swigjnienv.getJNIEnv() ;
2090   jobject swigjobj = (jobject) NULL ;
2091   jint jstate  ;
2092   
2093   if (!swig_override[2]) {
2094     simgrid::surf::Action::setState(state);
2095     return;
2096   }
2097   swigjobj = swig_get_self(jenv);
2098   if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
2099     jstate = (jint) state;
2100     jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[33], swigjobj, jstate);
2101     if (jenv->ExceptionCheck() == JNI_TRUE) return ;
2102   } else {
2103     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
2104   }
2105   if (swigjobj) jenv->DeleteLocalRef(swigjobj);
2106 }
2107
2108 void SwigDirector_CpuAction::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) {
2109   static struct {
2110     const char *mname;
2111     const char *mdesc;
2112     jmethodID base_methid;
2113   } methods[] = {
2114     {
2115       "getRemains", "()D", NULL 
2116     },
2117     {
2118       "setPriority", "(D)V", NULL 
2119     },
2120     {
2121       "setState", "(Lorg/simgrid/surf/ActionState;)V", NULL 
2122     }
2123   };
2124   
2125   static jclass baseclass = 0 ;
2126   
2127   if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) {
2128     if (!baseclass) {
2129       baseclass = jenv->FindClass("org/simgrid/surf/CpuAction");
2130       if (!baseclass) return;
2131       baseclass = (jclass) jenv->NewGlobalRef(baseclass);
2132     }
2133     bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true);
2134     for (int i = 0; i < 3; ++i) {
2135       if (!methods[i].base_methid) {
2136         methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc);
2137         if (!methods[i].base_methid) return;
2138       }
2139       swig_override[i] = false;
2140       if (derived) {
2141         jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc);
2142         swig_override[i] = (methid != methods[i].base_methid);
2143         jenv->ExceptionClear();
2144       }
2145     }
2146   }
2147 }
2148
2149
2150
2151 #ifdef __cplusplus
2152 extern "C" {
2153 #endif
2154
2155
2156 #ifdef __cplusplus
2157 extern "C" {
2158 #endif
2159
2160 JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_getAction(JNIEnv *env, jclass cls, jlong jarg1) {
2161   simgrid::surf::Action * action = (simgrid::surf::Action *)jarg1;
2162   jobject res;
2163   simgrid::surf::CpuAction *cpu_action =
2164     dynamic_cast<simgrid::surf::CpuAction*>(action);
2165   if (cpu_action) {
2166     SwigDirector_CpuAction *dir_cpu_action =
2167       dynamic_cast<SwigDirector_CpuAction*>(cpu_action);
2168     if (dir_cpu_action) {
2169       res = dir_cpu_action->swig_get_self(env);\
2170     } else {
2171       jclass clss = env->FindClass("org/simgrid/surf/CpuAction");\
2172       jmethodID constru = env->GetMethodID(clss, "<init>", "()V");\
2173       res = env->NewObject(clss, constru);\
2174       res = env->NewGlobalRef(res);\
2175     }
2176   } else {
2177     jclass clss = env->FindClass("org/simgrid/surf/Action");\
2178     jmethodID constru = env->GetMethodID(clss, "<init>", "()V");\
2179     res = env->NewObject(clss, constru);\
2180     res = env->NewGlobalRef(res);\
2181   }
2182   return res;
2183 }
2184
2185 #define GETDIRECTOR(NAME) \
2186 JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_get## NAME ## Director(JNIEnv *env, jclass cls, jlong jarg1)\
2187 {\
2188   simgrid::surf::NAME * arg1 = (simgrid::surf::NAME*)jarg1;\
2189   SwigDirector_ ##NAME *director = dynamic_cast<SwigDirector_ ##NAME *>(arg1);\
2190   jobject res;\
2191   if (director) {\
2192     res = director->swig_get_self(env);\
2193   } else {\
2194     jclass clss = env->FindClass("org/simgrid/surf/NAME");\
2195     jmethodID constru = env->GetMethodID(clss, "<init>", "()V");\
2196     res = env->NewObject(clss, constru);\
2197     res = env->NewGlobalRef(res);\
2198   }\
2199   return res;\
2200 }
2201
2202 GETDIRECTOR(CpuModel)
2203 GETDIRECTOR(Cpu)
2204 GETDIRECTOR(CpuAction)
2205
2206 #ifdef __cplusplus
2207 }
2208 #endif
2209
2210
2211 SWIGEXPORT jlongArray JNICALL Java_org_simgrid_surf_SurfJNI_ActionList_1getArray(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2212   jlongArray jresult = 0 ;
2213   simgrid::surf::ActionList *arg1 = (simgrid::surf::ActionList *) 0 ;
2214   ActionArrayPtr result;
2215   
2216   (void)jenv;
2217   (void)jcls;
2218   (void)jarg1_;
2219   arg1 = *(simgrid::surf::ActionList **)&jarg1; 
2220   result = (ActionArrayPtr)simgrid_surf_ActionList_getArray(arg1);
2221   {
2222     long l = 0;
2223     for(simgrid::surf::ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) {
2224       l++;
2225     }
2226     jresult = jenv->NewLongArray(l);
2227     jlong *elts = jenv->GetLongArrayElements(jresult, NULL);
2228     l = 0;
2229     for(simgrid::surf::ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) {
2230       elts[l++] = (jlong)static_cast<simgrid::surf::Action*>(&*it);
2231     }
2232     jenv->ReleaseLongArrayElements(jresult, elts, 0);
2233   }
2234   return jresult;
2235 }
2236
2237
2238 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1ActionList(JNIEnv *jenv, jclass jcls) {
2239   jlong jresult = 0 ;
2240   simgrid::surf::ActionList *result = 0 ;
2241   
2242   (void)jenv;
2243   (void)jcls;
2244   result = (simgrid::surf::ActionList *)new simgrid::surf::ActionList();
2245   *(simgrid::surf::ActionList **)&jresult = result; 
2246   return jresult;
2247 }
2248
2249
2250 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1ActionList(JNIEnv *jenv, jclass jcls, jlong jarg1) {
2251   simgrid::surf::ActionList *arg1 = (simgrid::surf::ActionList *) 0 ;
2252   
2253   (void)jenv;
2254   (void)jcls;
2255   arg1 = *(simgrid::surf::ActionList **)&jarg1; 
2256   delete arg1;
2257 }
2258
2259
2260 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_getClock(JNIEnv *jenv, jclass jcls) {
2261   jdouble jresult = 0 ;
2262   double result;
2263   
2264   (void)jenv;
2265   (void)jcls;
2266   result = (double)getClock();
2267   jresult = (jdouble)result; 
2268   return jresult;
2269 }
2270
2271
2272 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_clean(JNIEnv *jenv, jclass jcls) {
2273   (void)jenv;
2274   (void)jcls;
2275   clean();
2276 }
2277
2278
2279 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_getCpuModel(JNIEnv *jenv, jclass jcls) {
2280   jlong jresult = 0 ;
2281   simgrid::surf::CpuModel *result = 0 ;
2282   
2283   (void)jenv;
2284   (void)jcls;
2285   result = (simgrid::surf::CpuModel *)getCpuModel();
2286   *(simgrid::surf::CpuModel **)&jresult = result; 
2287   return jresult;
2288 }
2289
2290
2291 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_setCpuModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2292   simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ;
2293   
2294   (void)jenv;
2295   (void)jcls;
2296   (void)jarg1_;
2297   arg1 = *(simgrid::surf::CpuModel **)&jarg1; 
2298   setCpuModel(arg1);
2299 }
2300
2301
2302 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_setCpu(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2, jobject jarg2_) {
2303   char *arg1 = (char *) 0 ;
2304   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2305   
2306   (void)jenv;
2307   (void)jcls;
2308   (void)jarg2_;
2309   arg1 = 0;
2310   if (jarg1) {
2311     arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0);
2312     if (!arg1) return ;
2313   }
2314   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2315   setCpu(arg1,arg2);
2316   {
2317     
2318   }
2319 }
2320
2321
2322 SWIGEXPORT jlongArray JNICALL Java_org_simgrid_surf_SurfJNI_getRoute(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2) {
2323   jlongArray jresult = 0 ;
2324   char *arg1 = (char *) 0 ;
2325   char *arg2 = (char *) 0 ;
2326   LinkDynar result;
2327   
2328   (void)jenv;
2329   (void)jcls;
2330   arg1 = 0;
2331   if (jarg1) {
2332     arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0);
2333     if (!arg1) return 0;
2334   }
2335   arg2 = 0;
2336   if (jarg2) {
2337     arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
2338     if (!arg2) return 0;
2339   }
2340   result = getRoute(arg1,arg2);
2341   {
2342     long l = xbt_dynar_length(result);
2343     jresult = jenv->NewLongArray(l);
2344     unsigned i;
2345     Link *link;
2346     jlong *elts = jenv->GetLongArrayElements(jresult, NULL);
2347     xbt_dynar_foreach(result, i, link) {
2348       elts[i] = (jlong)link;
2349     }
2350     jenv->ReleaseLongArrayElements(jresult, elts, 0);
2351     xbt_dynar_free(&result);
2352   }
2353   if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1);
2354   if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
2355   return jresult;
2356 }
2357
2358
2359 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Plugin(JNIEnv *jenv, jclass jcls, jlong jarg1) {
2360   Plugin *arg1 = (Plugin *) 0 ;
2361   
2362   (void)jenv;
2363   (void)jcls;
2364   arg1 = *(Plugin **)&jarg1; 
2365   delete arg1;
2366 }
2367
2368
2369 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2370   Plugin *arg1 = (Plugin *) 0 ;
2371   
2372   (void)jenv;
2373   (void)jcls;
2374   (void)jarg1_;
2375   arg1 = *(Plugin **)&jarg1; 
2376   (arg1)->activateCpuCreatedCallback();
2377 }
2378
2379
2380 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2381   Plugin *arg1 = (Plugin *) 0 ;
2382   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2383   
2384   (void)jenv;
2385   (void)jcls;
2386   (void)jarg1_;
2387   (void)jarg2_;
2388   arg1 = *(Plugin **)&jarg1; 
2389   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2390   (arg1)->cpuCreatedCallback(arg2);
2391 }
2392
2393
2394 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuCreatedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2395   Plugin *arg1 = (Plugin *) 0 ;
2396   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2397   
2398   (void)jenv;
2399   (void)jcls;
2400   (void)jarg1_;
2401   (void)jarg2_;
2402   arg1 = *(Plugin **)&jarg1; 
2403   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2404   (arg1)->Plugin::cpuCreatedCallback(arg2);
2405 }
2406
2407
2408 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2409   Plugin *arg1 = (Plugin *) 0 ;
2410   
2411   (void)jenv;
2412   (void)jcls;
2413   (void)jarg1_;
2414   arg1 = *(Plugin **)&jarg1; 
2415   (arg1)->activateCpuDestructedCallback();
2416 }
2417
2418
2419 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2420   Plugin *arg1 = (Plugin *) 0 ;
2421   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2422   
2423   (void)jenv;
2424   (void)jcls;
2425   (void)jarg1_;
2426   (void)jarg2_;
2427   arg1 = *(Plugin **)&jarg1; 
2428   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2429   (arg1)->cpuDestructedCallback(arg2);
2430 }
2431
2432
2433 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuDestructedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2434   Plugin *arg1 = (Plugin *) 0 ;
2435   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2436   
2437   (void)jenv;
2438   (void)jcls;
2439   (void)jarg1_;
2440   (void)jarg2_;
2441   arg1 = *(Plugin **)&jarg1; 
2442   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2443   (arg1)->Plugin::cpuDestructedCallback(arg2);
2444 }
2445
2446
2447 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2448   Plugin *arg1 = (Plugin *) 0 ;
2449   
2450   (void)jenv;
2451   (void)jcls;
2452   (void)jarg1_;
2453   arg1 = *(Plugin **)&jarg1; 
2454   (arg1)->activateCpuStateChangedCallback();
2455 }
2456
2457
2458 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) {
2459   Plugin *arg1 = (Plugin *) 0 ;
2460   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2461   e_surf_resource_state_t arg3 ;
2462   e_surf_resource_state_t arg4 ;
2463   
2464   (void)jenv;
2465   (void)jcls;
2466   (void)jarg1_;
2467   (void)jarg2_;
2468   arg1 = *(Plugin **)&jarg1; 
2469   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2470   arg3 = (e_surf_resource_state_t)jarg3; 
2471   arg4 = (e_surf_resource_state_t)jarg4; 
2472   (arg1)->cpuStateChangedCallback(arg2,arg3,arg4);
2473 }
2474
2475
2476 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) {
2477   Plugin *arg1 = (Plugin *) 0 ;
2478   simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
2479   e_surf_resource_state_t arg3 ;
2480   e_surf_resource_state_t arg4 ;
2481   
2482   (void)jenv;
2483   (void)jcls;
2484   (void)jarg1_;
2485   (void)jarg2_;
2486   arg1 = *(Plugin **)&jarg1; 
2487   arg2 = *(simgrid::surf::Cpu **)&jarg2; 
2488   arg3 = (e_surf_resource_state_t)jarg3; 
2489   arg4 = (e_surf_resource_state_t)jarg4; 
2490   (arg1)->Plugin::cpuStateChangedCallback(arg2,arg3,arg4);
2491 }
2492
2493
2494 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2495   Plugin *arg1 = (Plugin *) 0 ;
2496   
2497   (void)jenv;
2498   (void)jcls;
2499   (void)jarg1_;
2500   arg1 = *(Plugin **)&jarg1; 
2501   (arg1)->activateCpuActionStateChangedCallback();
2502 }
2503
2504
2505 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) {
2506   Plugin *arg1 = (Plugin *) 0 ;
2507   simgrid::surf::CpuAction *arg2 = (simgrid::surf::CpuAction *) 0 ;
2508   e_surf_action_state_t arg3 ;
2509   e_surf_action_state_t arg4 ;
2510   
2511   (void)jenv;
2512   (void)jcls;
2513   (void)jarg1_;
2514   (void)jarg2_;
2515   arg1 = *(Plugin **)&jarg1; 
2516   arg2 = *(simgrid::surf::CpuAction **)&jarg2; 
2517   arg3 = (e_surf_action_state_t)jarg3; 
2518   arg4 = (e_surf_action_state_t)jarg4; 
2519   (arg1)->cpuActionStateChangedCallback(arg2,arg3,arg4);
2520 }
2521
2522
2523 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) {
2524   Plugin *arg1 = (Plugin *) 0 ;
2525   simgrid::surf::CpuAction *arg2 = (simgrid::surf::CpuAction *) 0 ;
2526   e_surf_action_state_t arg3 ;
2527   e_surf_action_state_t arg4 ;
2528   
2529   (void)jenv;
2530   (void)jcls;
2531   (void)jarg1_;
2532   (void)jarg2_;
2533   arg1 = *(Plugin **)&jarg1; 
2534   arg2 = *(simgrid::surf::CpuAction **)&jarg2; 
2535   arg3 = (e_surf_action_state_t)jarg3; 
2536   arg4 = (e_surf_action_state_t)jarg4; 
2537   (arg1)->Plugin::cpuActionStateChangedCallback(arg2,arg3,arg4);
2538 }
2539
2540
2541 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateLinkCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2542   Plugin *arg1 = (Plugin *) 0 ;
2543   
2544   (void)jenv;
2545   (void)jcls;
2546   (void)jarg1_;
2547   arg1 = *(Plugin **)&jarg1; 
2548   (arg1)->activateLinkCreatedCallback();
2549 }
2550
2551
2552 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2553   Plugin *arg1 = (Plugin *) 0 ;
2554   simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
2555   
2556   (void)jenv;
2557   (void)jcls;
2558   (void)jarg1_;
2559   (void)jarg2_;
2560   arg1 = *(Plugin **)&jarg1; 
2561   arg2 = *(simgrid::surf::Link **)&jarg2; 
2562   (arg1)->networkLinkCreatedCallback(arg2);
2563 }
2564
2565
2566 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkCreatedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2567   Plugin *arg1 = (Plugin *) 0 ;
2568   simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
2569   
2570   (void)jenv;
2571   (void)jcls;
2572   (void)jarg1_;
2573   (void)jarg2_;
2574   arg1 = *(Plugin **)&jarg1; 
2575   arg2 = *(simgrid::surf::Link **)&jarg2; 
2576   (arg1)->Plugin::networkLinkCreatedCallback(arg2);
2577 }
2578
2579
2580 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateLinkDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2581   Plugin *arg1 = (Plugin *) 0 ;
2582   
2583   (void)jenv;
2584   (void)jcls;
2585   (void)jarg1_;
2586   arg1 = *(Plugin **)&jarg1; 
2587   (arg1)->activateLinkDestructedCallback();
2588 }
2589
2590
2591 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2592   Plugin *arg1 = (Plugin *) 0 ;
2593   simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
2594   
2595   (void)jenv;
2596   (void)jcls;
2597   (void)jarg1_;
2598   (void)jarg2_;
2599   arg1 = *(Plugin **)&jarg1; 
2600   arg2 = *(simgrid::surf::Link **)&jarg2; 
2601   (arg1)->networkLinkDestructedCallback(arg2);
2602 }
2603
2604
2605 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkDestructedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
2606   Plugin *arg1 = (Plugin *) 0 ;
2607   simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
2608   
2609   (void)jenv;
2610   (void)jcls;
2611   (void)jarg1_;
2612   (void)jarg2_;
2613   arg1 = *(Plugin **)&jarg1; 
2614   arg2 = *(simgrid::surf::Link **)&jarg2; 
2615   (arg1)->Plugin::networkLinkDestructedCallback(arg2);
2616 }
2617
2618
2619 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateLinkStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2620   Plugin *arg1 = (Plugin *) 0 ;
2621   
2622   (void)jenv;
2623   (void)jcls;
2624   (void)jarg1_;
2625   arg1 = *(Plugin **)&jarg1; 
2626   (arg1)->activateLinkStateChangedCallback();
2627 }
2628
2629
2630 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) {
2631   Plugin *arg1 = (Plugin *) 0 ;
2632   simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
2633   e_surf_resource_state_t arg3 ;
2634   e_surf_resource_state_t arg4 ;
2635   
2636   (void)jenv;
2637   (void)jcls;
2638   (void)jarg1_;
2639   (void)jarg2_;
2640   arg1 = *(Plugin **)&jarg1; 
2641   arg2 = *(simgrid::surf::Link **)&jarg2; 
2642   arg3 = (e_surf_resource_state_t)jarg3; 
2643   arg4 = (e_surf_resource_state_t)jarg4; 
2644   (arg1)->networkLinkStateChangedCallback(arg2,arg3,arg4);
2645 }
2646
2647
2648 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) {
2649   Plugin *arg1 = (Plugin *) 0 ;
2650   simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
2651   e_surf_resource_state_t arg3 ;
2652   e_surf_resource_state_t arg4 ;
2653   
2654   (void)jenv;
2655   (void)jcls;
2656   (void)jarg1_;
2657   (void)jarg2_;
2658   arg1 = *(Plugin **)&jarg1; 
2659   arg2 = *(simgrid::surf::Link **)&jarg2; 
2660   arg3 = (e_surf_resource_state_t)jarg3; 
2661   arg4 = (e_surf_resource_state_t)jarg4; 
2662   (arg1)->Plugin::networkLinkStateChangedCallback(arg2,arg3,arg4);
2663 }
2664
2665
2666 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateNetworkActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2667   Plugin *arg1 = (Plugin *) 0 ;
2668   
2669   (void)jenv;
2670   (void)jcls;
2671   (void)jarg1_;
2672   arg1 = *(Plugin **)&jarg1; 
2673   (arg1)->activateNetworkActionStateChangedCallback();
2674 }
2675
2676
2677 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) {
2678   Plugin *arg1 = (Plugin *) 0 ;
2679   simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ;
2680   e_surf_action_state_t arg3 ;
2681   e_surf_action_state_t arg4 ;
2682   
2683   (void)jenv;
2684   (void)jcls;
2685   (void)jarg1_;
2686   (void)jarg2_;
2687   arg1 = *(Plugin **)&jarg1; 
2688   arg2 = *(simgrid::surf::NetworkAction **)&jarg2; 
2689   arg3 = (e_surf_action_state_t)jarg3; 
2690   arg4 = (e_surf_action_state_t)jarg4; 
2691   (arg1)->networkActionStateChangedCallback(arg2,arg3,arg4);
2692 }
2693
2694
2695 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) {
2696   Plugin *arg1 = (Plugin *) 0 ;
2697   simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ;
2698   e_surf_action_state_t arg3 ;
2699   e_surf_action_state_t arg4 ;
2700   
2701   (void)jenv;
2702   (void)jcls;
2703   (void)jarg1_;
2704   (void)jarg2_;
2705   arg1 = *(Plugin **)&jarg1; 
2706   arg2 = *(simgrid::surf::NetworkAction **)&jarg2; 
2707   arg3 = (e_surf_action_state_t)jarg3; 
2708   arg4 = (e_surf_action_state_t)jarg4; 
2709   (arg1)->Plugin::networkActionStateChangedCallback(arg2,arg3,arg4);
2710 }
2711
2712
2713 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateNetworkCommunicateCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2714   Plugin *arg1 = (Plugin *) 0 ;
2715   
2716   (void)jenv;
2717   (void)jcls;
2718   (void)jarg1_;
2719   arg1 = *(Plugin **)&jarg1; 
2720   (arg1)->activateNetworkCommunicateCallback();
2721 }
2722
2723
2724 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) {
2725   Plugin *arg1 = (Plugin *) 0 ;
2726   simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ;
2727   simgrid::surf::RoutingEdge *arg3 = (simgrid::surf::RoutingEdge *) 0 ;
2728   simgrid::surf::RoutingEdge *arg4 = (simgrid::surf::RoutingEdge *) 0 ;
2729   double arg5 ;
2730   double arg6 ;
2731   
2732   (void)jenv;
2733   (void)jcls;
2734   (void)jarg1_;
2735   (void)jarg2_;
2736   (void)jarg3_;
2737   (void)jarg4_;
2738   arg1 = *(Plugin **)&jarg1; 
2739   arg2 = *(simgrid::surf::NetworkAction **)&jarg2; 
2740   arg3 = *(simgrid::surf::RoutingEdge **)&jarg3; 
2741   arg4 = *(simgrid::surf::RoutingEdge **)&jarg4; 
2742   arg5 = (double)jarg5; 
2743   arg6 = (double)jarg6; 
2744   (arg1)->networkCommunicateCallback(arg2,arg3,arg4,arg5,arg6);
2745 }
2746
2747
2748 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) {
2749   Plugin *arg1 = (Plugin *) 0 ;
2750   simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ;
2751   simgrid::surf::RoutingEdge *arg3 = (simgrid::surf::RoutingEdge *) 0 ;
2752   simgrid::surf::RoutingEdge *arg4 = (simgrid::surf::RoutingEdge *) 0 ;
2753   double arg5 ;
2754   double arg6 ;
2755   
2756   (void)jenv;
2757   (void)jcls;
2758   (void)jarg1_;
2759   (void)jarg2_;
2760   (void)jarg3_;
2761   (void)jarg4_;
2762   arg1 = *(Plugin **)&jarg1; 
2763   arg2 = *(simgrid::surf::NetworkAction **)&jarg2; 
2764   arg3 = *(simgrid::surf::RoutingEdge **)&jarg3; 
2765   arg4 = *(simgrid::surf::RoutingEdge **)&jarg4; 
2766   arg5 = (double)jarg5; 
2767   arg6 = (double)jarg6; 
2768   (arg1)->Plugin::networkCommunicateCallback(arg2,arg3,arg4,arg5,arg6);
2769 }
2770
2771
2772 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Plugin(JNIEnv *jenv, jclass jcls) {
2773   jlong jresult = 0 ;
2774   Plugin *result = 0 ;
2775   
2776   (void)jenv;
2777   (void)jcls;
2778   result = (Plugin *)new SwigDirector_Plugin(jenv);
2779   *(Plugin **)&jresult = result; 
2780   return jresult;
2781 }
2782
2783
2784 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) {
2785   Plugin *obj = *((Plugin **)&objarg);
2786   (void)jcls;
2787   SwigDirector_Plugin *director = dynamic_cast<SwigDirector_Plugin *>(obj);
2788   if (director) {
2789     director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE));
2790   }
2791 }
2792
2793
2794 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {
2795   Plugin *obj = *((Plugin **)&objarg);
2796   SwigDirector_Plugin *director = dynamic_cast<SwigDirector_Plugin *>(obj);
2797   (void)jcls;
2798   if (director) {
2799     director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false);
2800   }
2801 }
2802
2803
2804 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1TmgrTrace(JNIEnv *jenv, jclass jcls, jlong jarg1) {
2805   tmgr_trace *arg1 = (tmgr_trace *) 0 ;
2806   
2807   (void)jenv;
2808   (void)jcls;
2809   arg1 = *(tmgr_trace **)&jarg1; 
2810   delete arg1;
2811 }
2812
2813
2814 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_TmgrTraceEvent_1getIdx(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2815   jlong jresult = 0 ;
2816   tmgr_trace_event *arg1 = (tmgr_trace_event *) 0 ;
2817   unsigned int result;
2818   
2819   (void)jenv;
2820   (void)jcls;
2821   (void)jarg1_;
2822   arg1 = *(tmgr_trace_event **)&jarg1; 
2823   result = (unsigned int)tmgr_trace_event_getIdx(arg1);
2824   jresult = (jlong)result; 
2825   return jresult;
2826 }
2827
2828
2829 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1TmgrTraceEvent(JNIEnv *jenv, jclass jcls, jlong jarg1) {
2830   tmgr_trace_event *arg1 = (tmgr_trace_event *) 0 ;
2831   
2832   (void)jenv;
2833   (void)jcls;
2834   arg1 = *(tmgr_trace_event **)&jarg1; 
2835   delete arg1;
2836 }
2837
2838
2839 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResources(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
2840   jdouble jresult = 0 ;
2841   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2842   double arg2 ;
2843   double result;
2844   
2845   (void)jenv;
2846   (void)jcls;
2847   (void)jarg1_;
2848   arg1 = *(simgrid::surf::Model **)&jarg1; 
2849   arg2 = (double)jarg2; 
2850   result = (double)(arg1)->shareResources(arg2);
2851   jresult = (jdouble)result; 
2852   return jresult;
2853 }
2854
2855
2856 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResourcesLazy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
2857   jdouble jresult = 0 ;
2858   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2859   double arg2 ;
2860   double result;
2861   
2862   (void)jenv;
2863   (void)jcls;
2864   (void)jarg1_;
2865   arg1 = *(simgrid::surf::Model **)&jarg1; 
2866   arg2 = (double)jarg2; 
2867   result = (double)(arg1)->shareResourcesLazy(arg2);
2868   jresult = (jdouble)result; 
2869   return jresult;
2870 }
2871
2872
2873 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResourcesFull(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
2874   jdouble jresult = 0 ;
2875   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2876   double arg2 ;
2877   double result;
2878   
2879   (void)jenv;
2880   (void)jcls;
2881   (void)jarg1_;
2882   arg1 = *(simgrid::surf::Model **)&jarg1; 
2883   arg2 = (double)jarg2; 
2884   result = (double)(arg1)->shareResourcesFull(arg2);
2885   jresult = (jdouble)result; 
2886   return jresult;
2887 }
2888
2889
2890 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
2891   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2892   double arg2 ;
2893   double arg3 ;
2894   
2895   (void)jenv;
2896   (void)jcls;
2897   (void)jarg1_;
2898   arg1 = *(simgrid::surf::Model **)&jarg1; 
2899   arg2 = (double)jarg2; 
2900   arg3 = (double)jarg3; 
2901   (arg1)->updateActionsState(arg2,arg3);
2902 }
2903
2904
2905 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsStateLazy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
2906   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2907   double arg2 ;
2908   double arg3 ;
2909   
2910   (void)jenv;
2911   (void)jcls;
2912   (void)jarg1_;
2913   arg1 = *(simgrid::surf::Model **)&jarg1; 
2914   arg2 = (double)jarg2; 
2915   arg3 = (double)jarg3; 
2916   (arg1)->updateActionsStateLazy(arg2,arg3);
2917 }
2918
2919
2920 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsStateFull(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
2921   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2922   double arg2 ;
2923   double arg3 ;
2924   
2925   (void)jenv;
2926   (void)jcls;
2927   (void)jarg1_;
2928   arg1 = *(simgrid::surf::Model **)&jarg1; 
2929   arg2 = (double)jarg2; 
2930   arg3 = (double)jarg3; 
2931   (arg1)->updateActionsStateFull(arg2,arg3);
2932 }
2933
2934
2935 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Model_1getRunningActionSet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2936   jlong jresult = 0 ;
2937   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2938   simgrid::surf::ActionList *result = 0 ;
2939   
2940   (void)jenv;
2941   (void)jcls;
2942   (void)jarg1_;
2943   arg1 = *(simgrid::surf::Model **)&jarg1; 
2944   result = (simgrid::surf::ActionList *)(arg1)->getRunningActionSet();
2945   *(simgrid::surf::ActionList **)&jresult = result; 
2946   return jresult;
2947 }
2948
2949
2950 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1addTraces(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
2951   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2952   
2953   (void)jenv;
2954   (void)jcls;
2955   (void)jarg1_;
2956   arg1 = *(simgrid::surf::Model **)&jarg1; 
2957   (arg1)->addTraces();
2958 }
2959
2960
2961 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Model(JNIEnv *jenv, jclass jcls, jlong jarg1) {
2962   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
2963   
2964   (void)jenv;
2965   (void)jcls;
2966   arg1 = *(simgrid::surf::Model **)&jarg1; 
2967   delete arg1;
2968 }
2969
2970
2971 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1CpuModel(JNIEnv *jenv, jclass jcls) {
2972   jlong jresult = 0 ;
2973   simgrid::surf::CpuModel *result = 0 ;
2974   
2975   (void)jenv;
2976   (void)jcls;
2977   result = (simgrid::surf::CpuModel *)new SwigDirector_CpuModel(jenv);
2978   *(simgrid::surf::CpuModel **)&jresult = result; 
2979   return jresult;
2980 }
2981
2982
2983 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1CpuModel(JNIEnv *jenv, jclass jcls, jlong jarg1) {
2984   simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ;
2985   
2986   (void)jenv;
2987   (void)jcls;
2988   arg1 = *(simgrid::surf::CpuModel **)&jarg1; 
2989   delete arg1;
2990 }
2991
2992
2993 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_, jlong jarg10, jobject jarg10_) {
2994   jlong jresult = 0 ;
2995   simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ;
2996   char *arg2 = (char *) 0 ;
2997   DoubleDynar arg3 ;
2998   int arg4 ;
2999   double arg5 ;
3000   tmgr_trace *arg6 = (tmgr_trace *) 0 ;
3001   int arg7 ;
3002   e_surf_resource_state_t arg8 ;
3003   tmgr_trace *arg9 = (tmgr_trace *) 0 ;
3004   s_xbt_dict *arg10 = (s_xbt_dict *) 0 ;
3005   DoubleDynar *argp3 ;
3006   simgrid::surf::Cpu *result = 0 ;
3007   
3008   (void)jenv;
3009   (void)jcls;
3010   (void)jarg1_;
3011   (void)jarg6_;
3012   (void)jarg9_;
3013   (void)jarg10_;
3014   arg1 = *(simgrid::surf::CpuModel **)&jarg1; 
3015   arg2 = 0;
3016   if (jarg2) {
3017     arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
3018     if (!arg2) return 0;
3019   }
3020   argp3 = *(DoubleDynar **)&jarg3; 
3021   if (!argp3) {
3022     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null DoubleDynar");
3023     return 0;
3024   }
3025   arg3 = *argp3; 
3026   arg4 = (int)jarg4; 
3027   arg5 = (double)jarg5; 
3028   arg6 = *(tmgr_trace **)&jarg6; 
3029   arg7 = (int)jarg7; 
3030   arg8 = (e_surf_resource_state_t)jarg8; 
3031   arg9 = *(tmgr_trace **)&jarg9; 
3032   arg10 = *(s_xbt_dict **)&jarg10; 
3033   result = (simgrid::surf::Cpu *)(arg1)->createCpu((char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
3034   *(simgrid::surf::Cpu **)&jresult = result; 
3035   {
3036     
3037   }
3038   return jresult;
3039 }
3040
3041
3042 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) {
3043   simgrid::surf::CpuModel *obj = *((simgrid::surf::CpuModel **)&objarg);
3044   (void)jcls;
3045   SwigDirector_CpuModel *director = dynamic_cast<SwigDirector_CpuModel *>(obj);
3046   if (director) {
3047     director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE));
3048   }
3049 }
3050
3051
3052 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {
3053   simgrid::surf::CpuModel *obj = *((simgrid::surf::CpuModel **)&objarg);
3054   SwigDirector_CpuModel *director = dynamic_cast<SwigDirector_CpuModel *>(obj);
3055   (void)jcls;
3056   if (director) {
3057     director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false);
3058   }
3059 }
3060
3061
3062 SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3063   jstring jresult = 0 ;
3064   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3065   char *result = 0 ;
3066   
3067   (void)jenv;
3068   (void)jcls;
3069   (void)jarg1_;
3070   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3071   result = (char *)(arg1)->getName();
3072   if (result) jresult = jenv->NewStringUTF((const char *)result);
3073   return jresult;
3074 }
3075
3076
3077 SWIGEXPORT jboolean JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1isUsed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3078   jboolean jresult = 0 ;
3079   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3080   bool result;
3081   
3082   (void)jenv;
3083   (void)jcls;
3084   (void)jarg1_;
3085   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3086   result = (bool)(arg1)->isUsed();
3087   jresult = (jboolean)result; 
3088   return jresult;
3089 }
3090
3091
3092 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3093   jlong jresult = 0 ;
3094   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3095   simgrid::surf::Model *result = 0 ;
3096   
3097   (void)jenv;
3098   (void)jcls;
3099   (void)jarg1_;
3100   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3101   result = (simgrid::surf::Model *)(arg1)->getModel();
3102   *(simgrid::surf::Model **)&jresult = result; 
3103   return jresult;
3104 }
3105
3106
3107 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3108   jint jresult = 0 ;
3109   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3110   e_surf_resource_state_t result;
3111   
3112   (void)jenv;
3113   (void)jcls;
3114   (void)jarg1_;
3115   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3116   result = (e_surf_resource_state_t)(arg1)->getState();
3117   jresult = (jint)result; 
3118   return jresult;
3119 }
3120
3121
3122 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getConstraint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3123   jlong jresult = 0 ;
3124   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3125   lmm_constraint *result = 0 ;
3126   
3127   (void)jenv;
3128   (void)jcls;
3129   (void)jarg1_;
3130   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3131   result = (lmm_constraint *)(arg1)->getConstraint();
3132   *(lmm_constraint **)&jresult = result; 
3133   return jresult;
3134 }
3135
3136
3137 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getProperties(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3138   jlong jresult = 0 ;
3139   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3140   s_xbt_dict *result = 0 ;
3141   
3142   (void)jenv;
3143   (void)jcls;
3144   (void)jarg1_;
3145   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3146   result = (s_xbt_dict *)(arg1)->getProperties();
3147   *(s_xbt_dict **)&jresult = result; 
3148   return jresult;
3149 }
3150
3151
3152 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) {
3153   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3154   tmgr_trace_event *arg2 = (tmgr_trace_event *) 0 ;
3155   double arg3 ;
3156   double arg4 ;
3157   
3158   (void)jenv;
3159   (void)jcls;
3160   (void)jarg1_;
3161   (void)jarg2_;
3162   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3163   arg2 = *(tmgr_trace_event **)&jarg2; 
3164   arg3 = (double)jarg3; 
3165   arg4 = (double)jarg4; 
3166   (arg1)->updateState(arg2,arg3,arg4);
3167 }
3168
3169
3170 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Resource(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3171   simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
3172   
3173   (void)jenv;
3174   (void)jcls;
3175   arg1 = *(simgrid::surf::Resource **)&jarg1; 
3176   delete arg1;
3177 }
3178
3179
3180 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_, jlong jarg4, jobject jarg4_, jint jarg5, jdouble jarg6, jdouble jarg7) {
3181   jlong jresult = 0 ;
3182   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
3183   char *arg2 = (char *) 0 ;
3184   s_xbt_dict *arg3 = (s_xbt_dict *) 0 ;
3185   lmm_constraint *arg4 = (lmm_constraint *) 0 ;
3186   int arg5 ;
3187   double arg6 ;
3188   double arg7 ;
3189   simgrid::surf::Cpu *result = 0 ;
3190   
3191   (void)jenv;
3192   (void)jcls;
3193   (void)jarg1_;
3194   (void)jarg3_;
3195   (void)jarg4_;
3196   arg1 = *(simgrid::surf::Model **)&jarg1; 
3197   arg2 = 0;
3198   if (jarg2) {
3199     arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
3200     if (!arg2) return 0;
3201   }
3202   arg3 = *(s_xbt_dict **)&jarg3; 
3203   arg4 = *(lmm_constraint **)&jarg4; 
3204   arg5 = (int)jarg5; 
3205   arg6 = (double)jarg6; 
3206   arg7 = (double)jarg7; 
3207   result = (simgrid::surf::Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7);
3208   *(simgrid::surf::Cpu **)&jresult = result; 
3209   {
3210     
3211   }
3212   return jresult;
3213 }
3214
3215
3216 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Cpu_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jint jarg4, jdouble jarg5, jdouble jarg6) {
3217   jlong jresult = 0 ;
3218   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
3219   char *arg2 = (char *) 0 ;
3220   s_xbt_dict *arg3 = (s_xbt_dict *) 0 ;
3221   int arg4 ;
3222   double arg5 ;
3223   double arg6 ;
3224   simgrid::surf::Cpu *result = 0 ;
3225   
3226   (void)jenv;
3227   (void)jcls;
3228   (void)jarg1_;
3229   (void)jarg3_;
3230   arg1 = *(simgrid::surf::Model **)&jarg1; 
3231   arg2 = 0;
3232   if (jarg2) {
3233     arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
3234     if (!arg2) return 0;
3235   }
3236   arg3 = *(s_xbt_dict **)&jarg3; 
3237   arg4 = (int)jarg4; 
3238   arg5 = (double)jarg5; 
3239   arg6 = (double)jarg6; 
3240   result = (simgrid::surf::Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
3241   *(simgrid::surf::Cpu **)&jresult = result; 
3242   {
3243     
3244   }
3245   return jresult;
3246 }
3247
3248
3249 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Cpu(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3250   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3251   
3252   (void)jenv;
3253   (void)jcls;
3254   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3255   delete arg1;
3256 }
3257
3258
3259 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCurrentPowerPeak(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3260   jdouble jresult = 0 ;
3261   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3262   double result;
3263   
3264   (void)jenv;
3265   (void)jcls;
3266   (void)jarg1_;
3267   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3268   result = (double)(arg1)->getCurrentPowerPeak();
3269   jresult = (jdouble)result; 
3270   return jresult;
3271 }
3272
3273
3274 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCurrentPowerPeakSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3275   jdouble jresult = 0 ;
3276   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3277   double result;
3278   
3279   (void)jenv;
3280   (void)jcls;
3281   (void)jarg1_;
3282   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3283   result = (double)(arg1)->simgrid::surf::Cpu::getCurrentPowerPeak();
3284   jresult = (jdouble)result; 
3285   return jresult;
3286 }
3287
3288
3289 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1execute(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3290   jlong jresult = 0 ;
3291   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3292   double arg2 ;
3293   simgrid::surf::CpuAction *result = 0 ;
3294   
3295   (void)jenv;
3296   (void)jcls;
3297   (void)jarg1_;
3298   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3299   arg2 = (double)jarg2; 
3300   result = (simgrid::surf::CpuAction *)(arg1)->execute(arg2);
3301   *(simgrid::surf::CpuAction **)&jresult = result; 
3302   return jresult;
3303 }
3304
3305
3306 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1sleep(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3307   jlong jresult = 0 ;
3308   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3309   double arg2 ;
3310   simgrid::surf::CpuAction *result = 0 ;
3311   
3312   (void)jenv;
3313   (void)jcls;
3314   (void)jarg1_;
3315   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3316   arg2 = (double)jarg2; 
3317   result = (simgrid::surf::CpuAction *)(arg1)->sleep(arg2);
3318   *(simgrid::surf::CpuAction **)&jresult = result; 
3319   return jresult;
3320 }
3321
3322
3323 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCore(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3324   jint jresult = 0 ;
3325   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3326   int result;
3327   
3328   (void)jenv;
3329   (void)jcls;
3330   (void)jarg1_;
3331   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3332   result = (int)(arg1)->getCore();
3333   jresult = (jint)result; 
3334   return jresult;
3335 }
3336
3337
3338 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCoreSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3339   jint jresult = 0 ;
3340   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3341   int result;
3342   
3343   (void)jenv;
3344   (void)jcls;
3345   (void)jarg1_;
3346   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3347   result = (int)(arg1)->simgrid::surf::Cpu::getCore();
3348   jresult = (jint)result; 
3349   return jresult;
3350 }
3351
3352
3353 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getSpeed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3354   jdouble jresult = 0 ;
3355   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3356   double arg2 ;
3357   double result;
3358   
3359   (void)jenv;
3360   (void)jcls;
3361   (void)jarg1_;
3362   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3363   arg2 = (double)jarg2; 
3364   result = (double)(arg1)->getSpeed(arg2);
3365   jresult = (jdouble)result; 
3366   return jresult;
3367 }
3368
3369
3370 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getSpeedSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3371   jdouble jresult = 0 ;
3372   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3373   double arg2 ;
3374   double result;
3375   
3376   (void)jenv;
3377   (void)jcls;
3378   (void)jarg1_;
3379   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3380   arg2 = (double)jarg2; 
3381   result = (double)(arg1)->simgrid::surf::Cpu::getSpeed(arg2);
3382   jresult = (jdouble)result; 
3383   return jresult;
3384 }
3385
3386
3387 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getAvailableSpeed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3388   jdouble jresult = 0 ;
3389   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3390   double result;
3391   
3392   (void)jenv;
3393   (void)jcls;
3394   (void)jarg1_;
3395   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3396   result = (double)(arg1)->getAvailableSpeed();
3397   jresult = (jdouble)result; 
3398   return jresult;
3399 }
3400
3401
3402 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getAvailableSpeedSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3403   jdouble jresult = 0 ;
3404   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3405   double result;
3406   
3407   (void)jenv;
3408   (void)jcls;
3409   (void)jarg1_;
3410   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3411   result = (double)(arg1)->simgrid::surf::Cpu::getAvailableSpeed();
3412   jresult = (jdouble)result; 
3413   return jresult;
3414 }
3415
3416
3417 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getPowerPeakAt(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
3418   jdouble jresult = 0 ;
3419   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3420   int arg2 ;
3421   double result;
3422   
3423   (void)jenv;
3424   (void)jcls;
3425   (void)jarg1_;
3426   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3427   arg2 = (int)jarg2; 
3428   result = (double)(arg1)->getPowerPeakAt(arg2);
3429   jresult = (jdouble)result; 
3430   return jresult;
3431 }
3432
3433
3434 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getNbPstates(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3435   jint jresult = 0 ;
3436   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3437   int result;
3438   
3439   (void)jenv;
3440   (void)jcls;
3441   (void)jarg1_;
3442   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3443   result = (int)(arg1)->getNbPstates();
3444   jresult = (jint)result; 
3445   return jresult;
3446 }
3447
3448
3449 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1setPstate(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
3450   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3451   int arg2 ;
3452   
3453   (void)jenv;
3454   (void)jcls;
3455   (void)jarg1_;
3456   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3457   arg2 = (int)jarg2; 
3458   (arg1)->setPstate(arg2);
3459 }
3460
3461
3462 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getPstate(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3463   jint jresult = 0 ;
3464   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3465   int result;
3466   
3467   (void)jenv;
3468   (void)jcls;
3469   (void)jarg1_;
3470   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3471   result = (int)(arg1)->getPstate();
3472   jresult = (jint)result; 
3473   return jresult;
3474 }
3475
3476
3477 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1setState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
3478   simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
3479   e_surf_resource_state_t arg2 ;
3480   
3481   (void)jenv;
3482   (void)jcls;
3483   (void)jarg1_;
3484   arg1 = *(simgrid::surf::Cpu **)&jarg1; 
3485   arg2 = (e_surf_resource_state_t)jarg2; 
3486   (arg1)->setState(arg2);
3487 }
3488
3489
3490 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) {
3491   simgrid::surf::Cpu *obj = *((simgrid::surf::Cpu **)&objarg);
3492   (void)jcls;
3493   SwigDirector_Cpu *director = dynamic_cast<SwigDirector_Cpu *>(obj);
3494   if (director) {
3495     director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE));
3496   }
3497 }
3498
3499
3500 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {
3501   simgrid::surf::Cpu *obj = *((simgrid::surf::Cpu **)&objarg);
3502   SwigDirector_Cpu *director = dynamic_cast<SwigDirector_Cpu *>(obj);
3503   (void)jcls;
3504   if (director) {
3505     director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false);
3506   }
3507 }
3508
3509
3510 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Link(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3511   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3512   
3513   (void)jenv;
3514   (void)jcls;
3515   arg1 = *(simgrid::surf::Link **)&jarg1; 
3516   delete arg1;
3517 }
3518
3519
3520 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Link_1getBandwidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3521   jdouble jresult = 0 ;
3522   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3523   double result;
3524   
3525   (void)jenv;
3526   (void)jcls;
3527   (void)jarg1_;
3528   arg1 = *(simgrid::surf::Link **)&jarg1; 
3529   result = (double)(arg1)->getBandwidth();
3530   jresult = (jdouble)result; 
3531   return jresult;
3532 }
3533
3534
3535 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) {
3536   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3537   double arg2 ;
3538   double arg3 ;
3539   
3540   (void)jenv;
3541   (void)jcls;
3542   (void)jarg1_;
3543   arg1 = *(simgrid::surf::Link **)&jarg1; 
3544   arg2 = (double)jarg2; 
3545   arg3 = (double)jarg3; 
3546   (arg1)->updateBandwidth(arg2,arg3);
3547 }
3548
3549
3550 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateBandwidth_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3551   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3552   double arg2 ;
3553   
3554   (void)jenv;
3555   (void)jcls;
3556   (void)jarg1_;
3557   arg1 = *(simgrid::surf::Link **)&jarg1; 
3558   arg2 = (double)jarg2; 
3559   (arg1)->updateBandwidth(arg2);
3560 }
3561
3562
3563 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Link_1getLatency(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3564   jdouble jresult = 0 ;
3565   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3566   double result;
3567   
3568   (void)jenv;
3569   (void)jcls;
3570   (void)jarg1_;
3571   arg1 = *(simgrid::surf::Link **)&jarg1; 
3572   result = (double)(arg1)->getLatency();
3573   jresult = (jdouble)result; 
3574   return jresult;
3575 }
3576
3577
3578 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) {
3579   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3580   double arg2 ;
3581   double arg3 ;
3582   
3583   (void)jenv;
3584   (void)jcls;
3585   (void)jarg1_;
3586   arg1 = *(simgrid::surf::Link **)&jarg1; 
3587   arg2 = (double)jarg2; 
3588   arg3 = (double)jarg3; 
3589   (arg1)->updateLatency(arg2,arg3);
3590 }
3591
3592
3593 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateLatency_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3594   simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
3595   double arg2 ;
3596   
3597   (void)jenv;
3598   (void)jcls;
3599   (void)jarg1_;
3600   arg1 = *(simgrid::surf::Link **)&jarg1; 
3601   arg2 = (double)jarg2; 
3602   (arg1)->updateLatency(arg2);
3603 }
3604
3605
3606 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Action(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jboolean jarg3) {
3607   jlong jresult = 0 ;
3608   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
3609   double arg2 ;
3610   bool arg3 ;
3611   simgrid::surf::Action *result = 0 ;
3612   
3613   (void)jenv;
3614   (void)jcls;
3615   (void)jarg1_;
3616   arg1 = *(simgrid::surf::Model **)&jarg1; 
3617   arg2 = (double)jarg2; 
3618   arg3 = jarg3 ? true : false; 
3619   result = (simgrid::surf::Action *)new simgrid::surf::Action(arg1,arg2,arg3);
3620   *(simgrid::surf::Action **)&jresult = result; 
3621   return jresult;
3622 }
3623
3624
3625 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Action(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3626   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3627   
3628   (void)jenv;
3629   (void)jcls;
3630   arg1 = *(simgrid::surf::Action **)&jarg1; 
3631   delete arg1;
3632 }
3633
3634
3635 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3636   jlong jresult = 0 ;
3637   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3638   simgrid::surf::Model *result = 0 ;
3639   
3640   (void)jenv;
3641   (void)jcls;
3642   (void)jarg1_;
3643   arg1 = *(simgrid::surf::Action **)&jarg1; 
3644   result = (simgrid::surf::Model *)(arg1)->getModel();
3645   *(simgrid::surf::Model **)&jresult = result; 
3646   return jresult;
3647 }
3648
3649
3650 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getVariable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3651   jlong jresult = 0 ;
3652   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3653   lmm_variable *result = 0 ;
3654   
3655   (void)jenv;
3656   (void)jcls;
3657   (void)jarg1_;
3658   arg1 = *(simgrid::surf::Action **)&jarg1; 
3659   result = (lmm_variable *)(arg1)->getVariable();
3660   *(lmm_variable **)&jresult = result; 
3661   return jresult;
3662 }
3663
3664
3665 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3666   jint jresult = 0 ;
3667   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3668   e_surf_action_state_t result;
3669   
3670   (void)jenv;
3671   (void)jcls;
3672   (void)jarg1_;
3673   arg1 = *(simgrid::surf::Action **)&jarg1; 
3674   result = (e_surf_action_state_t)(arg1)->getState();
3675   jresult = (jint)result; 
3676   return jresult;
3677 }
3678
3679
3680 SWIGEXPORT jboolean JNICALL Java_org_simgrid_surf_SurfJNI_Action_1isSuspended(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3681   jboolean jresult = 0 ;
3682   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3683   bool result;
3684   
3685   (void)jenv;
3686   (void)jcls;
3687   (void)jarg1_;
3688   arg1 = *(simgrid::surf::Action **)&jarg1; 
3689   result = (bool)(arg1)->isSuspended();
3690   jresult = (jboolean)result; 
3691   return jresult;
3692 }
3693
3694
3695 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getBound(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3696   jdouble jresult = 0 ;
3697   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3698   double result;
3699   
3700   (void)jenv;
3701   (void)jcls;
3702   (void)jarg1_;
3703   arg1 = *(simgrid::surf::Action **)&jarg1; 
3704   result = (double)(arg1)->getBound();
3705   jresult = (jdouble)result; 
3706   return jresult;
3707 }
3708
3709
3710 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setBound(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3711   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3712   double arg2 ;
3713   
3714   (void)jenv;
3715   (void)jcls;
3716   (void)jarg1_;
3717   arg1 = *(simgrid::surf::Action **)&jarg1; 
3718   arg2 = (double)jarg2; 
3719   (arg1)->setBound(arg2);
3720 }
3721
3722
3723 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1updateRemains(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3724   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3725   double arg2 ;
3726   
3727   (void)jenv;
3728   (void)jcls;
3729   (void)jarg1_;
3730   arg1 = *(simgrid::surf::Action **)&jarg1; 
3731   arg2 = (double)jarg2; 
3732   (arg1)->updateRemains(arg2);
3733 }
3734
3735
3736 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getRemains(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3737   jdouble jresult = 0 ;
3738   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3739   double result;
3740   
3741   (void)jenv;
3742   (void)jcls;
3743   (void)jarg1_;
3744   arg1 = *(simgrid::surf::Action **)&jarg1; 
3745   result = (double)(arg1)->getRemains();
3746   jresult = (jdouble)result; 
3747   return jresult;
3748 }
3749
3750
3751 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setPriority(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
3752   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3753   double arg2 ;
3754   
3755   (void)jenv;
3756   (void)jcls;
3757   (void)jarg1_;
3758   arg1 = *(simgrid::surf::Action **)&jarg1; 
3759   arg2 = (double)jarg2; 
3760   (arg1)->setPriority(arg2);
3761 }
3762
3763
3764 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
3765   simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
3766   e_surf_action_state_t arg2 ;
3767   
3768   (void)jenv;
3769   (void)jcls;
3770   (void)jarg1_;
3771   arg1 = *(simgrid::surf::Action **)&jarg1; 
3772   arg2 = (e_surf_action_state_t)jarg2; 
3773   (arg1)->setState(arg2);
3774 }
3775
3776
3777 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1CpuAction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jboolean jarg3) {
3778   jlong jresult = 0 ;
3779   simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
3780   double arg2 ;
3781   bool arg3 ;
3782   simgrid::surf::CpuAction *result = 0 ;
3783   
3784   (void)jenv;
3785   (void)jcls;
3786   (void)jarg1_;
3787   arg1 = *(simgrid::surf::Model **)&jarg1; 
3788   arg2 = (double)jarg2; 
3789   arg3 = jarg3 ? true : false; 
3790   result = (simgrid::surf::CpuAction *)new SwigDirector_CpuAction(jenv,arg1,arg2,arg3);
3791   *(simgrid::surf::CpuAction **)&jresult = result; 
3792   return jresult;
3793 }
3794
3795
3796 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1getCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3797   jlong jresult = 0 ;
3798   simgrid::surf::CpuAction *arg1 = (simgrid::surf::CpuAction *) 0 ;
3799   simgrid::surf::Cpu *result = 0 ;
3800   
3801   (void)jenv;
3802   (void)jcls;
3803   (void)jarg1_;
3804   arg1 = *(simgrid::surf::CpuAction **)&jarg1; 
3805   result = (simgrid::surf::Cpu *)simgrid_surf_CpuAction_getCpu(arg1);
3806   *(simgrid::surf::Cpu **)&jresult = result; 
3807   return jresult;
3808 }
3809
3810
3811 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1CpuAction(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3812   simgrid::surf::CpuAction *arg1 = (simgrid::surf::CpuAction *) 0 ;
3813   
3814   (void)jenv;
3815   (void)jcls;
3816   arg1 = *(simgrid::surf::CpuAction **)&jarg1; 
3817   delete arg1;
3818 }
3819
3820
3821 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) {
3822   simgrid::surf::CpuAction *obj = *((simgrid::surf::CpuAction **)&objarg);
3823   (void)jcls;
3824   SwigDirector_CpuAction *director = dynamic_cast<SwigDirector_CpuAction *>(obj);
3825   if (director) {
3826     director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE));
3827   }
3828 }
3829
3830
3831 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {
3832   simgrid::surf::CpuAction *obj = *((simgrid::surf::CpuAction **)&objarg);
3833   SwigDirector_CpuAction *director = dynamic_cast<SwigDirector_CpuAction *>(obj);
3834   (void)jcls;
3835   if (director) {
3836     director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false);
3837   }
3838 }
3839
3840
3841 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_NetworkAction_1getLatency(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3842   jdouble jresult = 0 ;
3843   simgrid::surf::NetworkAction *arg1 = (simgrid::surf::NetworkAction *) 0 ;
3844   double result;
3845   
3846   (void)jenv;
3847   (void)jcls;
3848   (void)jarg1_;
3849   arg1 = *(simgrid::surf::NetworkAction **)&jarg1; 
3850   result = (double)simgrid_surf_NetworkAction_getLatency(arg1);
3851   jresult = (jdouble)result; 
3852   return jresult;
3853 }
3854
3855
3856 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1NetworkAction(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3857   simgrid::surf::NetworkAction *arg1 = (simgrid::surf::NetworkAction *) 0 ;
3858   
3859   (void)jenv;
3860   (void)jcls;
3861   arg1 = *(simgrid::surf::NetworkAction **)&jarg1; 
3862   delete arg1;
3863 }
3864
3865
3866 SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_RoutingEdge_1getName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3867   jstring jresult = 0 ;
3868   simgrid::surf::RoutingEdge *arg1 = (simgrid::surf::RoutingEdge *) 0 ;
3869   char *result = 0 ;
3870   
3871   (void)jenv;
3872   (void)jcls;
3873   (void)jarg1_;
3874   arg1 = *(simgrid::surf::RoutingEdge **)&jarg1; 
3875   result = (char *)(arg1)->getName();
3876   if (result) jresult = jenv->NewStringUTF((const char *)result);
3877   return jresult;
3878 }
3879
3880
3881 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1RoutingEdge(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3882   simgrid::surf::RoutingEdge *arg1 = (simgrid::surf::RoutingEdge *) 0 ;
3883   
3884   (void)jenv;
3885   (void)jcls;
3886   arg1 = *(simgrid::surf::RoutingEdge **)&jarg1; 
3887   delete arg1;
3888 }
3889
3890
3891 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_LmmConstraint_1getUsage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3892   jdouble jresult = 0 ;
3893   lmm_constraint *arg1 = (lmm_constraint *) 0 ;
3894   double result;
3895   
3896   (void)jenv;
3897   (void)jcls;
3898   (void)jarg1_;
3899   arg1 = *(lmm_constraint **)&jarg1; 
3900   result = (double)lmm_constraint_getUsage(arg1);
3901   jresult = (jdouble)result; 
3902   return jresult;
3903 }
3904
3905
3906 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1LmmConstraint(JNIEnv *jenv, jclass jcls) {
3907   jlong jresult = 0 ;
3908   lmm_constraint *result = 0 ;
3909   
3910   (void)jenv;
3911   (void)jcls;
3912   result = (lmm_constraint *)new lmm_constraint();
3913   *(lmm_constraint **)&jresult = result; 
3914   return jresult;
3915 }
3916
3917
3918 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1LmmConstraint(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3919   lmm_constraint *arg1 = (lmm_constraint *) 0 ;
3920   
3921   (void)jenv;
3922   (void)jcls;
3923   arg1 = *(lmm_constraint **)&jarg1; 
3924   delete arg1;
3925 }
3926
3927
3928 SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_LmmVariable_1getValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
3929   jdouble jresult = 0 ;
3930   lmm_variable *arg1 = (lmm_variable *) 0 ;
3931   double result;
3932   
3933   (void)jenv;
3934   (void)jcls;
3935   (void)jarg1_;
3936   arg1 = *(lmm_variable **)&jarg1; 
3937   result = (double)lmm_variable_getValue(arg1);
3938   jresult = (jdouble)result; 
3939   return jresult;
3940 }
3941
3942
3943 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1LmmVariable(JNIEnv *jenv, jclass jcls) {
3944   jlong jresult = 0 ;
3945   lmm_variable *result = 0 ;
3946   
3947   (void)jenv;
3948   (void)jcls;
3949   result = (lmm_variable *)new lmm_variable();
3950   *(lmm_variable **)&jresult = result; 
3951   return jresult;
3952 }
3953
3954
3955 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1LmmVariable(JNIEnv *jenv, jclass jcls, jlong jarg1) {
3956   lmm_variable *arg1 = (lmm_variable *) 0 ;
3957   
3958   (void)jenv;
3959   (void)jcls;
3960   arg1 = *(lmm_variable **)&jarg1; 
3961   delete arg1;
3962 }
3963
3964
3965 SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_XbtDict_1getValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) {
3966   jstring jresult = 0 ;
3967   s_xbt_dict *arg1 = (s_xbt_dict *) 0 ;
3968   char *arg2 = (char *) 0 ;
3969   char *result = 0 ;
3970   
3971   (void)jenv;
3972   (void)jcls;
3973   (void)jarg1_;
3974   arg1 = *(s_xbt_dict **)&jarg1; 
3975   arg2 = 0;
3976   if (jarg2) {
3977     arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
3978     if (!arg2) return 0;
3979   }
3980   result = (char *)s_xbt_dict_getValue(arg1,arg2);
3981   if (result) jresult = jenv->NewStringUTF((const char *)result);
3982   if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
3983   return jresult;
3984 }
3985
3986
3987 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1XbtDict(JNIEnv *jenv, jclass jcls) {
3988   jlong jresult = 0 ;
3989   s_xbt_dict *result = 0 ;
3990   
3991   (void)jenv;
3992   (void)jcls;
3993   result = (s_xbt_dict *)new s_xbt_dict();
3994   *(s_xbt_dict **)&jresult = result; 
3995   return jresult;
3996 }
3997
3998
3999 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1XbtDict(JNIEnv *jenv, jclass jcls, jlong jarg1) {
4000   s_xbt_dict *arg1 = (s_xbt_dict *) 0 ;
4001   
4002   (void)jenv;
4003   (void)jcls;
4004   arg1 = *(s_xbt_dict **)&jarg1; 
4005   delete arg1;
4006 }
4007
4008
4009 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_SURF_1ACTION_1READY_1get(JNIEnv *jenv, jclass jcls) {
4010   jint jresult = 0 ;
4011   e_surf_action_state_t result;
4012   
4013   (void)jenv;
4014   (void)jcls;
4015   result = (e_surf_action_state_t)SURF_ACTION_READY;
4016   jresult = (jint)result; 
4017   return jresult;
4018 }
4019
4020
4021 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_SURF_1RESOURCE_1ON_1get(JNIEnv *jenv, jclass jcls) {
4022   jint jresult = 0 ;
4023   e_surf_resource_state_t result;
4024   
4025   (void)jenv;
4026   (void)jcls;
4027   result = (e_surf_resource_state_t)SURF_RESOURCE_ON;
4028   jresult = (jint)result; 
4029   return jresult;
4030 }
4031
4032
4033 SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_SURF_1RESOURCE_1OFF_1get(JNIEnv *jenv, jclass jcls) {
4034   jint jresult = 0 ;
4035   e_surf_resource_state_t result;
4036   
4037   (void)jenv;
4038   (void)jcls;
4039   result = (e_surf_resource_state_t)SURF_RESOURCE_OFF;
4040   jresult = (jint)result; 
4041   return jresult;
4042 }
4043
4044
4045 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
4046     jlong baseptr = 0;
4047     (void)jenv;
4048     (void)jcls;
4049     *(simgrid::surf::Model **)&baseptr = *(simgrid::surf::CpuModel **)&jarg1;
4050     return baseptr;
4051 }
4052
4053 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
4054     jlong baseptr = 0;
4055     (void)jenv;
4056     (void)jcls;
4057     *(simgrid::surf::Resource **)&baseptr = *(simgrid::surf::Cpu **)&jarg1;
4058     return baseptr;
4059 }
4060
4061 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Link_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
4062     jlong baseptr = 0;
4063     (void)jenv;
4064     (void)jcls;
4065     *(simgrid::surf::Resource **)&baseptr = *(simgrid::surf::Link **)&jarg1;
4066     return baseptr;
4067 }
4068
4069 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
4070     jlong baseptr = 0;
4071     (void)jenv;
4072     (void)jcls;
4073     *(simgrid::surf::Action **)&baseptr = *(simgrid::surf::CpuAction **)&jarg1;
4074     return baseptr;
4075 }
4076
4077 SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_NetworkAction_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
4078     jlong baseptr = 0;
4079     (void)jenv;
4080     (void)jcls;
4081     *(simgrid::surf::Action **)&baseptr = *(simgrid::surf::NetworkAction **)&jarg1;
4082     return baseptr;
4083 }
4084
4085 SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_swig_1module_1init(JNIEnv *jenv, jclass jcls) {
4086   int i;
4087   
4088   static struct {
4089     const char *method;
4090     const char *signature;
4091   } methods[34] = {
4092     {
4093       "SwigDirector_Plugin_cpuCreatedCallback", "(Lorg/simgrid/surf/Plugin;J)V" 
4094     },
4095     {
4096       "SwigDirector_Plugin_cpuDestructedCallback", "(Lorg/simgrid/surf/Plugin;J)V" 
4097     },
4098     {
4099       "SwigDirector_Plugin_cpuStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" 
4100     },
4101     {
4102       "SwigDirector_Plugin_cpuActionStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" 
4103     },
4104     {
4105       "SwigDirector_Plugin_networkLinkCreatedCallback", "(Lorg/simgrid/surf/Plugin;J)V" 
4106     },
4107     {
4108       "SwigDirector_Plugin_networkLinkDestructedCallback", "(Lorg/simgrid/surf/Plugin;J)V" 
4109     },
4110     {
4111       "SwigDirector_Plugin_networkLinkStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" 
4112     },
4113     {
4114       "SwigDirector_Plugin_networkActionStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" 
4115     },
4116     {
4117       "SwigDirector_Plugin_networkCommunicateCallback", "(Lorg/simgrid/surf/Plugin;JJJDD)V" 
4118     },
4119     {
4120       "SwigDirector_CpuModel_shareResources", "(Lorg/simgrid/surf/CpuModel;D)D" 
4121     },
4122     {
4123       "SwigDirector_CpuModel_shareResourcesLazy", "(Lorg/simgrid/surf/CpuModel;D)D" 
4124     },
4125     {
4126       "SwigDirector_CpuModel_shareResourcesFull", "(Lorg/simgrid/surf/CpuModel;D)D" 
4127     },
4128     {
4129       "SwigDirector_CpuModel_updateActionsState", "(Lorg/simgrid/surf/CpuModel;DD)V" 
4130     },
4131     {
4132       "SwigDirector_CpuModel_updateActionsStateLazy", "(Lorg/simgrid/surf/CpuModel;DD)V" 
4133     },
4134     {
4135       "SwigDirector_CpuModel_updateActionsStateFull", "(Lorg/simgrid/surf/CpuModel;DD)V" 
4136     },
4137     {
4138       "SwigDirector_CpuModel_getRunningActionSet", "(Lorg/simgrid/surf/CpuModel;)J" 
4139     },
4140     {
4141       "SwigDirector_CpuModel_addTraces", "(Lorg/simgrid/surf/CpuModel;)V" 
4142     },
4143     {
4144       "SwigDirector_CpuModel_createCpu", "(Lorg/simgrid/surf/CpuModel;Ljava/lang/String;[DIDJIIJJ)J" 
4145     },
4146     {
4147       "SwigDirector_Cpu_isUsed", "(Lorg/simgrid/surf/Cpu;)Z" 
4148     },
4149     {
4150       "SwigDirector_Cpu_getState", "(Lorg/simgrid/surf/Cpu;)I" 
4151     },
4152     {
4153       "SwigDirector_Cpu_updateState", "(Lorg/simgrid/surf/Cpu;JDD)V" 
4154     },
4155     {
4156       "SwigDirector_Cpu_getCurrentPowerPeak", "(Lorg/simgrid/surf/Cpu;)D" 
4157     },
4158     {
4159       "SwigDirector_Cpu_execute", "(Lorg/simgrid/surf/Cpu;D)J" 
4160     },
4161     {
4162       "SwigDirector_Cpu_sleep", "(Lorg/simgrid/surf/Cpu;D)J" 
4163     },
4164     {
4165       "SwigDirector_Cpu_getCore", "(Lorg/simgrid/surf/Cpu;)I" 
4166     },
4167     {
4168       "SwigDirector_Cpu_getSpeed", "(Lorg/simgrid/surf/Cpu;D)D" 
4169     },
4170     {
4171       "SwigDirector_Cpu_getAvailableSpeed", "(Lorg/simgrid/surf/Cpu;)D" 
4172     },
4173     {
4174       "SwigDirector_Cpu_getPowerPeakAt", "(Lorg/simgrid/surf/Cpu;I)D" 
4175     },
4176     {
4177       "SwigDirector_Cpu_getNbPstates", "(Lorg/simgrid/surf/Cpu;)I" 
4178     },
4179     {
4180       "SwigDirector_Cpu_setPstate", "(Lorg/simgrid/surf/Cpu;I)V" 
4181     },
4182     {
4183       "SwigDirector_Cpu_getPstate", "(Lorg/simgrid/surf/Cpu;)I" 
4184     },
4185     {
4186       "SwigDirector_CpuAction_getRemains", "(Lorg/simgrid/surf/CpuAction;)D" 
4187     },
4188     {
4189       "SwigDirector_CpuAction_setPriority", "(Lorg/simgrid/surf/CpuAction;D)V" 
4190     },
4191     {
4192       "SwigDirector_CpuAction_setState", "(Lorg/simgrid/surf/CpuAction;I)V" 
4193     }
4194   };
4195   Swig::jclass_SurfJNI = (jclass) jenv->NewGlobalRef(jcls);
4196   if (!Swig::jclass_SurfJNI) return;
4197   for (i = 0; i < (int) (sizeof(methods)/sizeof(methods[0])); ++i) {
4198     Swig::director_methids[i] = jenv->GetStaticMethodID(jcls, methods[i].method, methods[i].signature);
4199     if (!Swig::director_methids[i]) return;
4200   }
4201 }
4202
4203
4204 #ifdef __cplusplus
4205 }
4206 #endif
4207