Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cleanups in java bindings
[simgrid.git] / src / bindings / java / jmsg_task.h
1 /* Functions related to the java task instances.                            */
2
3 /* Copyright (c) 2007-2015. The SimGrid Team.
4  * All rights 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 #ifndef MSG_JTASK_H
10 #define MSG_JTASK_H
11
12 #include <jni.h>
13 #include "simgrid/msg.h"
14
15 SG_BEGIN_DECL()
16
17 /**
18  * This function associated a native task to a java task instance.
19  *
20  * @param jtask    The java task instance.
21  * @param task     The native task to bind.
22  * @param env      The environment of the current thread.
23  *
24  * @exception      If the class Task is not found the function throws the ClassNotFoundException. If the field bind of
25  *                 this class is not found the function throws the exception NotSuchFieldException.
26  */
27 void jtask_bind(jobject jtask, msg_task_t task, JNIEnv * env);
28
29 /**
30  * This function returns a native task from a java task instance.
31  *
32  * @param jtask   The java task object from which get the native task.
33  * @param env     The environment of the current thread.
34  *
35  * @return        The function returns the native task associated to the java task object.
36  *
37  * @exception     If the class Task is not found the function throws the ClassNotFoundException. If the field bind of
38  *                this class is not found the function throws the exception NotSuchFieldException.
39  */
40 msg_task_t jtask_to_native_task(jobject jtask, JNIEnv * env);
41
42 /**
43  * This function tests if a java task instance is valid.
44  * A java task object is valid if it is bind to a native task.
45  *
46  * @param jtask    The java task to test the validity.
47  * @param env      The environment of the current thread.
48  *
49  * @return         If the java task is valid the function returns true. Otherwise the function returns false.
50  */
51 jboolean jtask_is_valid(jobject jtask, JNIEnv * env);
52
53 /*
54  * Class    org_simgrid_msg_Task
55  * Method    nativeInit
56  * Signature  ();
57  */
58 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_nativeInit(JNIEnv *env, jclass cls);
59
60 /*
61  * Class    org_simgrid_msg_Task
62  * Method    create
63  */
64 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_create (JNIEnv * env, jobject jtask, jstring jname,
65                                                          jdouble jcomputeDuration, jdouble jmessageSize);
66 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_nativeFinalize(JNIEnv * env, jobject jtask);
67
68 /*
69  * Class    org_simgrid_msg_Task
70  * Method    parallelCreate
71  */
72 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_parallelCreate (JNIEnv *, jobject, jstring, jobjectArray,
73                                                                  jdoubleArray, jdoubleArray);
74
75 /*
76  * Class    org_simgrid_msg_Task
77  * Method    destroy
78  * Signature  (Lsimgrid/msg/Task;)V
79  */
80 /* JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_destroy (JNIEnv *, jobject); */
81
82 /*
83  * Class    org_simgrid_msg_Task
84  * Method    cancel
85  * Signature  ()V
86  */
87 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_cancel (JNIEnv *, jobject);
88
89 /*
90  * Class    org_simgrid_msg_Task
91  * Method    execute
92  * Signature  ()V
93  */
94 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_execute (JNIEnv *, jobject);
95
96 /*
97  * Class    org_simgrid_msg_Task
98  * Method    setBound
99  * Signature  ()V
100  */
101 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBound (JNIEnv *, jobject, jdouble);
102
103 /*
104  * Class    org_simgrid_msg_Task
105  * Method    getName
106  * Signature  ()Ljava/lang/String;
107  */
108 JNIEXPORT jstring JNICALL Java_org_simgrid_msg_Task_getName (JNIEnv *, jobject);
109
110 /*
111  * Class    org_simgrid_msg_Task
112  * Method    getSender
113  * Signature  ()Lsimgrid/msg/Process;
114  */
115 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSender (JNIEnv *, jobject);
116
117 /*
118  * Class    org_simgrid_msg_Task
119  * Method    getSource
120  * Signature  ()Lsimgrid/msg/Host;
121  */
122 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSource (JNIEnv *, jobject);
123
124 /*
125  * Class    org_simgrid_msg_Task
126  * Method    getFlopsAmount
127  * Signature  ()D
128  */
129 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Task_getFlopsAmount (JNIEnv *, jobject);
130
131 /**
132  * Class    org_simgrid_msg_Task
133  * Method    setName
134  * Signature  (Ljava/lang/string;)V
135  */
136 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname);
137
138 /*
139  * Class    org_simgrid_msg_Task
140  * Method    setPriority
141  * Signature  (D)V
142  */
143 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority (JNIEnv *, jobject, jdouble);
144
145 /**
146  * Class    org_simgrid_msg_Task
147  * Method    setComputeDuration
148  * Signature  (D)V
149  */
150 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setFlopsAmount (JNIEnv *env, jobject jtask, jdouble computationAmount);
151
152 /**
153  * Class    org_simgrid_msg_Task
154  * Method    setDataSize
155  * Signature  (D)V
156  */
157 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBytesAmount (JNIEnv *env, jobject jtask, jdouble dataSize);
158
159 /**
160  * Class    org_simgrid_msg_Task
161  * Method    send
162  */
163 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_send (JNIEnv *, jobject, jstring, jdouble);
164
165 /**
166  * Class    org_simgrid_msg_Task
167  * Method    sendBounded
168  */
169 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_sendBounded (JNIEnv *, jobject, jstring, jdouble, jdouble);
170
171 /**
172  * Class    org_simgrid_msg_Task
173  * Method    receive
174  */
175 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receive (JNIEnv *, jclass, jstring, jdouble, jobject);
176
177 /**
178  * Class     org_simgrid_msg_Task
179  * Method    irecv
180  * Signature  (Ljava/lang/String;)Lorg/simgrid/msg/Comm;
181  */
182 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass cls, jstring jmailbox);
183
184 /**
185  * Class     org_simgrid_msg_Task
186  * Method    receiveBounded
187  */
188 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receiveBounded(JNIEnv * env, jclass cls, jstring jalias,
189                                                                    jdouble jtimeout, jobject jhost, jdouble rate);
190
191 /**
192  * Class     org_simgrid_msg_Task
193  * Method    irecvBounded
194  */
195 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, jclass cls, jstring jmailbox,
196                                                                  jdouble rate);
197
198 /**
199  * Class     org_simgrid_msg_Task
200  * Method    isend
201  * Signature  (Lorg/simgrid/msg/Task;Ljava/lang/String;)Lorg/simgrid/msg/Comm;
202  */
203 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_isend(JNIEnv *env, jobject jtask, jstring jmailbox);
204
205 /**
206  * Class     org_simgrid_msg_Task
207  * Method    isendBounded
208  */
209 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_isendBounded(JNIEnv *env, jobject jtask, jstring jmailbox,
210                                                                  jdouble maxrate);
211
212 /**
213  * Class     org_simgrid_msg_Task
214  * Method    dsend
215  */
216 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_dsend(JNIEnv * env, jobject jtask, jstring jalias);
217
218 /**
219  * Class     org_simgrid_msg_Task
220  * Method    dsendBounded
221  */
222 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_dsendBounded(JNIEnv * env, jobject jtask, jstring jalias,
223                                                               jdouble maxrate);
224
225 /**
226  * Class     org_simgrid_msg_Task
227  * Method    listen
228  */
229 JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Task_listen(JNIEnv *, jclass, jstring);
230
231 /**
232  * Class     org_simgrid_msg_Task
233  * Method    listenFromHost
234  */
235 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFromHost(JNIEnv *, jclass, jstring, jobject);
236
237 /**
238  * Class     org_simgrid_msg_Task
239  * Method    listenFrom
240  */
241 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFrom(JNIEnv *, jclass, jstring);
242
243 SG_END_DECL()
244 #endif                          /* !MSG_JTASK_H */