Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New version of the java bindings by Malek, passing all [existing] tests
[simgrid.git] / src / java / jmsg.h
1 /*
2  * $Id$
3  *
4  * Copyright 2006,2007 Martin Quinson, Malek Cherier All right reserved. 
5  *
6  * This program is free software; you can redistribute it and/or modify it 
7  * under the terms of the license (GNU LGPL) which comes with this package.
8  *
9  * This contains the declarations of the wrapper functions used to interface
10  * the java object with the native functions of the MSG API.
11  */
12
13 #ifndef MSG4JAVA_H
14 #define MSG4JAVA_H
15
16 #include <jni.h>
17
18 int
19 is_main_thread(void);
20
21 JavaVM *
22 get_java_VM(void);
23
24 JNIEnv *
25 get_current_thread_env(void);
26
27 /*
28  * Class                simgrid_msg_Msg
29  * Method               processCreate
30  * Signature    (Lsimgrid/msg/Process;Lsimgrid/msg/Host;)V
31  */
32 JNIEXPORT void JNICALL 
33 Java_simgrid_msg_Msg_processCreate(JNIEnv* env,jclass cls,jobject jprocess,jobject jhost);
34
35 /*
36  * Class                simgrid_msg_Msg
37  * Method               processSuspend
38  * Signature    (Lsimgrid/msg/Process;)V
39  */
40 JNIEXPORT void JNICALL 
41 Java_simgrid_msg_Msg_processSuspend(JNIEnv* env, jclass cls, jobject jprocess);
42
43 /*
44  * Class                simgrid_msg_Msg
45  * Method               processResume
46  * Signature    (Lsimgrid/msg/Process;)V
47  */
48 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_processResume
49   (JNIEnv *, jclass, jobject);
50
51 /*
52  * Class                simgrid_msg_Msg
53  * Method               processIsSuspended
54  * Signature    (Lsimgrid/msg/Process;)Z
55  */
56 JNIEXPORT jboolean JNICALL Java_simgrid_msg_Msg_processIsSuspended
57   (JNIEnv *, jclass, jobject);
58
59 /*
60  * Class                simgrid_msg_Msg
61  * Method               processKill
62  * Signature    (Lsimgrid/msg/Process;)V
63  */
64 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_processKill
65   (JNIEnv *, jclass, jobject);
66
67 /*
68  * Class                simgrid_msg_Msg
69  * Method               processGetHost
70  * Signature    (Lsimgrid/msg/Process;)Lsimgrid/msg/Host;
71  */
72 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_processGetHost
73   (JNIEnv *, jclass, jobject);
74
75 /*
76  * Class                simgrid_msg_Msg
77  * Method               processFromPID
78  * Signature    (I)Lsimgrid/msg/Process;
79  */
80 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_processFromPID
81   (JNIEnv *, jclass, jint);
82
83 /*
84  * Class                simgrid_msg_Msg
85  * Method               processGetPID
86  * Signature    (Lsimgrid/msg/Process;)I
87  */
88 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_processGetPID
89   (JNIEnv *, jclass, jobject);
90
91 /*
92  * Class                simgrid_msg_Msg
93  * Method               processGetPPID
94  * Signature    (Lsimgrid/msg/Process;)I
95  */
96 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_processGetPPID
97   (JNIEnv *, jclass, jobject);
98
99 /*
100  * Class                simgrid_msg_Msg
101  * Method               processSelf
102  * Signature    ()Lsimgrid/msg/Process;
103  */
104 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_processSelf
105   (JNIEnv *, jclass);
106
107 /*
108  * Class                simgrid_msg_Msg
109  * Method               processSelfPID
110  * Signature    ()I
111  */
112 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_processSelfPID
113   (JNIEnv *, jclass);
114
115 /*
116  * Class                simgrid_msg_Msg
117  * Method               processSelfPPID
118  * Signature    ()I
119  */
120 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_processSelfPPID
121   (JNIEnv *, jclass);
122
123 /*
124  * Class                simgrid_msg_Msg
125  * Method               processChangeHost
126  * Signature    (Lsimgrid/msg/Process;Lsimgrid/msg/Host;)V
127  */
128 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_processChangeHost
129   (JNIEnv *, jclass, jobject, jobject);
130
131 /*
132  * Class                simgrid_msg_Msg
133  * Method               processWaitFor
134  * Signature    (D)V
135  */
136 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_processWaitFor
137   (JNIEnv *, jclass, jdouble);
138
139 /*
140  * Class                simgrid_msg_Msg
141  * Method               hostGetByName
142  * Signature    (Ljava/lang/String;)Lsimgrid/msg/Host;
143  */
144 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_hostGetByName
145   (JNIEnv *, jclass, jstring);
146
147 /*
148  * Class                simgrid_msg_Msg
149  * Method               hostGetName
150  * Signature    (Lsimgrid/msg/Host;)Ljava/lang/String;
151  */
152 JNIEXPORT jstring JNICALL Java_simgrid_msg_Msg_hostGetName
153   (JNIEnv *, jclass, jobject);
154
155 /*
156  * Class                simgrid_msg_Msg
157  * Method               hostGetNumber
158  * Signature    ()I
159  */
160 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_hostGetNumber
161   (JNIEnv *, jclass);
162
163 /*
164  * Class                simgrid_msg_Msg
165  * Method               hostSelf
166  * Signature    ()Lsimgrid/msg/Host;
167  */
168 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_hostSelf
169   (JNIEnv *, jclass);
170
171 /*
172  * Class                simgrid_msg_Msg
173  * Method               hostGetSpeed
174  * Signature    (Lsimgrid/msg/Host;)D
175  */
176 JNIEXPORT jdouble JNICALL Java_simgrid_msg_Msg_hostGetSpeed
177   (JNIEnv *, jclass, jobject);
178
179 JNIEXPORT jint JNICALL 
180 Java_simgrid_msg_Msg_hostGetLoad(JNIEnv* env, jclass cls, jobject jhost);
181
182 /*
183  * Class                simgrid_msg_Msg
184  * Method               hostIsAvail
185  * Signature    (Lsimgrid/msg/Host;)Z
186  */
187 JNIEXPORT jboolean JNICALL Java_simgrid_msg_Msg_hostIsAvail
188   (JNIEnv *, jclass, jobject);
189
190 /*
191  * Class                simgrid_msg_Msg
192  * Method               taskCreate
193  * Signature    (Lsimgrid/msg/Task;Ljava/lang/String;DD)V
194  */
195 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_taskCreate
196   (JNIEnv *, jclass, jobject, jstring, jdouble, jdouble);
197
198 JNIEXPORT void JNICALL 
199 Java_simgrid_msg_Msg_parallel_taskCreate(JNIEnv*, jclass, jobject, jstring, jobjectArray,jdoubleArray, jdoubleArray);
200
201 /*
202  * Class                simgrid_msg_Msg
203  * Method               taskGetSender
204  * Signature    (Lsimgrid/msg/Task;)Lsimgrid/msg/Process;
205  */
206 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_taskGetSender
207   (JNIEnv *, jclass, jobject);
208
209 JNIEXPORT jobject JNICALL 
210 Java_simgrid_msg_Msg_parallelTaskGetSender(JNIEnv* env , jclass cls , jobject jparallel_task);
211
212 /*
213  * Class                simgrid_msg_Msg
214  * Method               taskGetSource
215  * Signature    (Lsimgrid/msg/Task;)Lsimgrid/msg/Host;
216  */
217 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_taskGetSource
218   (JNIEnv *, jclass, jobject);
219
220 JNIEXPORT jobject JNICALL 
221 Java_simgrid_msg_Msg_parallelTaskGetSource(JNIEnv* env , jclass cls, jobject jparallel_task);
222
223 /*
224  * Class                simgrid_msg_Msg
225  * Method               taskGetName
226  * Signature    (Lsimgrid/msg/Task;)Ljava/lang/String;
227  */
228 JNIEXPORT jstring JNICALL Java_simgrid_msg_Msg_taskGetName
229   (JNIEnv *, jclass, jobject);
230
231 JNIEXPORT jstring JNICALL 
232 Java_simgrid_msg_Msg_parallelTaskGetName(JNIEnv* env, jclass cls, jobject jparallel_task);
233
234 /*
235  * Class                simgrid_msg_Msg
236  * Method               taskCancel
237  * Signature    (Lsimgrid/msg/Task;)V
238  */
239 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_taskCancel
240   (JNIEnv *, jclass, jobject);
241
242 JNIEXPORT void JNICALL 
243 Java_simgrid_msg_Msg_parallelTaskCancel(JNIEnv* env, jclass cls, jobject jparallel_task);
244
245 /*
246  * Class                simgrid_msg_Msg
247  * Method               taskGetComputeDuration
248  * Signature    (Lsimgrid/msg/Task;)D
249  */
250 JNIEXPORT jdouble JNICALL Java_simgrid_msg_Msg_taskGetComputeDuration
251   (JNIEnv *, jclass, jobject);
252
253 JNIEXPORT jdouble JNICALL 
254 Java_simgrid_msg_Msg_parallelTaskGetComputeDuration(JNIEnv* env, jclass cls, jobject jparallel_task);
255
256 /*
257  * Class                simgrid_msg_Msg
258  * Method               taskGetRemainingDuration
259  * Signature    (Lsimgrid/msg/Task;)D
260  */
261 JNIEXPORT jdouble JNICALL Java_simgrid_msg_Msg_taskGetRemainingDuration
262   (JNIEnv *, jclass, jobject);
263
264 JNIEXPORT jdouble JNICALL 
265 Java_simgrid_msg_Msg_paralleTaskGetRemainingDuration(JNIEnv* env, jclass cls, jobject jparallel_task);
266
267 /*
268  * Class                simgrid_msg_Msg
269  * Method               taskSetPriority
270  * Signature    (Lsimgrid/msg/Task;D)V
271  */
272 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_taskSetPriority
273   (JNIEnv *, jclass, jobject, jdouble);
274
275 JNIEXPORT void JNICALL 
276 Java_simgrid_msg_Msg_parallelTaskSetPriority(JNIEnv* env, jclass cls, jobject jparallel_task, jdouble priority);
277
278 /*
279  * Class                simgrid_msg_Msg
280  * Method               taskDestroy
281  * Signature    (Lsimgrid/msg/Task;)V
282  */
283 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_taskDestroy
284   (JNIEnv *, jclass, jobject);
285
286 JNIEXPORT void JNICALL 
287 Java_simgrid_msg_Msg_parallelTaskDestroy(JNIEnv* env, jclass cls, jobject jparallel_task);
288
289 /*
290  * Class                simgrid_msg_Msg
291  * Method               taskExecute
292  * Signature    (Lsimgrid/msg/Task;)V
293  */
294 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_taskExecute
295   (JNIEnv *, jclass, jobject);
296
297 JNIEXPORT void JNICALL 
298 Java_simgrid_msg_Msg_parallelTaskExecute(JNIEnv* env, jclass cls, jobject jparallel_task);
299
300 /*
301  * Class                simgrid_msg_Msg
302  * Method               channelGet
303  * Signature    (Lsimgrid/msg/Channel;)Lsimgrid/msg/Task;
304  */
305 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_channelGet
306   (JNIEnv *, jclass, jobject);
307
308 /*
309  * Class                simgrid_msg_Msg
310  * Method               channelGetWithTimeout
311  * Signature    (Lsimgrid/msg/Channel;D)Lsimgrid/msg/Task;
312  */
313 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_channelGetWithTimeout
314   (JNIEnv *, jclass, jobject, jdouble);
315
316 /*
317  * Class                simgrid_msg_Msg
318  * Method               channelGetFromHost
319  * Signature    (Lsimgrid/msg/Channel;Lsimgrid/msg/Host;)Lsimgrid/msg/Task;
320  */
321 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_channelGetFromHost
322   (JNIEnv *, jclass, jobject, jobject);
323
324 /*
325  * Class                simgrid_msg_Msg
326  * Method               channelHasPendingCommunication
327  * Signature    (Lsimgrid/msg/Channel;)Z
328  */
329 JNIEXPORT jboolean JNICALL Java_simgrid_msg_Msg_channelHasPendingCommunication
330   (JNIEnv *, jclass, jobject);
331
332 /*
333  * Class                simgrid_msg_Msg
334  * Method               channelGetCommunicatingProcess
335  * Signature    (Lsimgrid/msg/Channel;)I
336  */
337 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_channelGetCommunicatingProcess
338   (JNIEnv *, jclass, jobject);
339
340 /*
341  * Class                simgrid_msg_Msg
342  * Method               channelGetHostWaitingTasks
343  * Signature    (Lsimgrid/msg/Channel;Lsimgrid/msg/Host;)I
344  */
345 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_channelGetHostWaitingTasks
346   (JNIEnv *, jclass, jobject, jobject);
347
348 /*
349  * Class                simgrid_msg_Msg
350  * Method               channelPut
351  * Signature    (Lsimgrid/msg/Channel;Lsimgrid/msg/Task;Lsimgrid/msg/Host;)V
352  */
353 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_channelPut
354   (JNIEnv *, jclass, jobject, jobject, jobject);
355
356 /*
357  * Class                simgrid_msg_Msg
358  * Method               channelPutWithTimeout
359  * Signature    (Lsimgrid/msg/Channel;Lsimgrid/msg/Task;Lsimgrid/msg/Host;D)V
360  */
361 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_channelPutWithTimeout
362   (JNIEnv *, jclass, jobject, jobject, jobject, jdouble);
363
364 /*
365  * Class                simgrid_msg_Msg
366  * Method               channelPutBounded
367  * Signature    (Lsimgrid/msg/Channel;Lsimgrid/msg/Task;Lsimgrid/msg/Host;D)V
368  */
369 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_channelPutBounded
370   (JNIEnv *, jclass, jobject, jobject, jobject, jdouble);
371
372 /*
373  * Class                simgrid_msg_Msg
374  * Method               channelWait
375  * Signature    (Lsimgrid/msg/Channel;D)I
376  */
377 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_channelWait
378   (JNIEnv *, jclass, jobject, jdouble);
379
380 /*
381  * Class                simgrid_msg_Msg
382  * Method               channelSetNumber
383  * Signature    (I)V
384  */
385 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_channelSetNumber
386   (JNIEnv *, jclass, jint);
387
388 /*
389  * Class                simgrid_msg_Msg
390  * Method               channelGetNumber
391  * Signature    ()I
392  */
393 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_channelGetNumber
394   (JNIEnv *, jclass);
395
396 /*
397  * Class                simgrid_msg_Msg
398  * Method               getErrCode
399  * Signature    ()I
400  */
401 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_getErrCode
402   (JNIEnv *, jclass);
403
404 /*
405  * Class                simgrid_msg_Msg
406  * Method               getClock
407  * Signature    ()D
408  */
409 JNIEXPORT jdouble JNICALL Java_simgrid_msg_Msg_getClock
410   (JNIEnv *, jclass);
411
412
413 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_init
414   (JNIEnv *, jclass, jobjectArray);
415
416
417 JNIEXPORT void JNICALL
418 JNICALL Java_simgrid_msg_Msg_run(JNIEnv* env, jclass cls);
419
420 JNIEXPORT void JNICALL 
421 Java_simgrid_msg_Msg_init(JNIEnv* env, jclass cls, jobjectArray jargs);
422
423 /*
424  * Class                simgrid_msg_Msg
425  * Method               processKillAll
426  * Signature    (I)I
427  */
428 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_processKillAll
429   (JNIEnv *, jclass, jint);
430
431 /*
432  * Class                simgrid_msg_Msg
433  * Method               processExit
434  * Signature    (Lsimgrid/msg/Process;)V
435  */
436 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_processExit
437   (JNIEnv *, jclass, jobject);
438
439
440 JNIEXPORT void JNICALL 
441 Java_simgrid_msg_Msg_pajeOutput(JNIEnv* env, jclass cls, jstring jpajeFile);
442
443 /*
444  * Class                simgrid_msg_Msg
445  * Method               waitSignal
446  * Signature    (Lsimgrid/msg/Process;)V
447  */
448 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_waitSignal
449   (JNIEnv *, jclass, jobject);
450
451 JNIEXPORT void JNICALL 
452 Java_simgrid_msg_Msg_info(JNIEnv * , jclass , jstring );
453
454 JNIEXPORT jobjectArray JNICALL
455 Java_simgrid_msg_Msg_allHosts(JNIEnv * , jclass );
456
457 JNIEXPORT void JNICALL 
458 Java_simgrid_msg_Msg_createEnvironment(JNIEnv* env, jclass cls,jstring jplatformFile);
459
460 JNIEXPORT void JNICALL 
461 Java_simgrid_msg_Msg_platformLoad(JNIEnv* env, jclass cls, jobject jplatform);
462
463 #endif /* !MSG4JAVA_H */