Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines.
[simgrid.git] / src / bindings / java / jmsg.hpp
1 /* Java Wrappers to the MSG API.                                            */
2
3 /* Copyright (c) 2007-2021. 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 JNIEnv* get_current_thread_env();
29 /**
30  * This function throws the correct exception according to the status provided.
31  */
32 void jmsg_throw_status(JNIEnv* env, msg_error_t status);
33
34 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Msg_getClock(JNIEnv* env, jclass cls);
35 JNIEXPORT void JNICALL JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv* env, jclass cls);
36
37 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_init(JNIEnv* env, jclass cls, jobjectArray jargs);
38 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit();
39 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_liveMigrationInit();
40 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_fileSystemInit();
41 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_loadInit();
42
43 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_debug(JNIEnv* env, jclass cls, jstring jargs);
44 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_verb(JNIEnv* env, jclass cls, jstring jargs);
45 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_info(JNIEnv* env, jclass cls, jstring jargs);
46 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_warn(JNIEnv* env, jclass cls, jstring jargs);
47 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_error(JNIEnv* env, jclass cls, jstring jargs);
48 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_critical(JNIEnv* env, jclass cls, jstring jargs);
49
50 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_createEnvironment(JNIEnv* env, jclass cls, jstring jplatformFile);
51 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Msg_environmentGetRoutingRoot(JNIEnv* env, jclass cls);
52 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_deployApplication(JNIEnv* env, jclass cls, jstring jdeploymentFile);
53 }
54 #endif