Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
295a93800bea975a8b738d4914d94b5772fe5b50
[simgrid.git] / src / bindings / java / jmsg.hpp
1 /* Java Wrappers to the MSG API.                                            */
2
3 /* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef JMSG_HPP
9 #define JMSG_HPP
10 #include <jni.h>
11 #include <simgrid/msg.h>
12 #include <unordered_map>
13
14 extern "C" {
15
16 /* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
17 #ifndef JNIEXPORT
18 #define JNIEXPORT
19 #endif
20 #ifndef JNICALL
21 #define JNICALL
22 #endif
23 /* end of eclipse-mandated pimple */
24
25 extern int JAVA_HOST_LEVEL;
26 static std::unordered_map<msg_storage_t, jobject> java_storage_map;
27
28 JavaVM* get_java_VM();
29 JNIEnv* get_current_thread_env();
30 /**
31  * This function throws the correct exception according to the status provided.
32  */
33 void jmsg_throw_status(JNIEnv* env, msg_error_t status);
34
35 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Msg_getClock(JNIEnv* env, jclass cls);
36 JNIEXPORT void JNICALL JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv* env, jclass cls);
37
38 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_init(JNIEnv* env, jclass cls, jobjectArray jargs);
39 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit();
40
41 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_debug(JNIEnv* env, jclass cls, jstring jargs);
42 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_verb(JNIEnv* env, jclass cls, jstring jargs);
43 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_info(JNIEnv* env, jclass cls, jstring jargs);
44 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_warn(JNIEnv* env, jclass cls, jstring jargs);
45 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_error(JNIEnv* env, jclass cls, jstring jargs);
46 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_critical(JNIEnv* env, jclass cls, jstring jargs);
47
48 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_createEnvironment(JNIEnv* env, jclass cls, jstring jplatformFile);
49 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Msg_environmentGetRoutingRoot(JNIEnv* env, jclass cls);
50 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_deployApplication(JNIEnv* env, jclass cls, jstring jdeploymentFile);
51 }
52 #endif