Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make SIMIX_context_self() useless and use Context::self() instead
[simgrid.git] / src / bindings / java / jmsg_storage.h
1 /* Java bindings of the Storage API.                                        */
2
3 /* Copyright (c) 2012-2018. 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 MSG_JSTORAGE_H
9 #define MSG_JSTORAGE_H
10
11 #include "simgrid/msg.h"
12 #include <jni.h>
13
14 SG_BEGIN_DECL()
15
16 /** Returns a new java instance of a storage. */
17 jobject jstorage_new_instance(JNIEnv * env);
18
19 /** Binds a native instance to a java instance. */
20 void jstorage_bind(jobject jstorage, msg_storage_t storage, JNIEnv * env);
21
22 /** Extracts the native instance associated to a java instance. */
23 msg_storage_t jstorage_get_native(JNIEnv * env, jobject jstorage);
24
25 /** Initialize the native world, called from the Java world at startup */
26 JNIEXPORT void JNICALL Java_org_simgrid_msg_Storage_nativeInit(JNIEnv *env, jclass cls);
27
28 /** Take a ref onto the java instance (to prevent its collection) */
29 jobject jstorage_ref(JNIEnv * env, jobject jstorage);
30
31 /** Release a ref onto the java instance */
32 void jstorage_unref(JNIEnv * env, jobject jstorage);
33
34 /* Implement the Java API */
35
36 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv* env, jclass cls, jstring jname);
37 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getSize(JNIEnv *env, jobject jstorage);
38 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getFreeSize(JNIEnv *env, jobject jstorage);
39 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getUsedSize(JNIEnv *env, jobject jstorage);
40 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getProperty(JNIEnv *env, jobject jstorage, jobject jname);
41 JNIEXPORT void JNICALL Java_org_simgrid_msg_Storage_setProperty(JNIEnv* env, jobject jstorage, jobject jname,
42                                                                 jobject jvalue);
43 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getHost(JNIEnv * env,jobject jstorage);
44 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Storage_all(JNIEnv *env, jclass cls);
45
46 SG_END_DECL()
47 #endif