Logo AND Algorithmique Numérique Distribuée

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