A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove 2 (out of 3) horrible hacks around Java contexts
[simgrid.git]
/
src
/
bindings
/
java
/
jmsg_as.cpp
diff --git
a/src/bindings/java/jmsg_as.cpp
b/src/bindings/java/jmsg_as.cpp
index
2bf2499
..
5d9b460
100644
(file)
--- a/
src/bindings/java/jmsg_as.cpp
+++ b/
src/bindings/java/jmsg_as.cpp
@@
-1,6
+1,6
@@
/* Java bindings of the NetZones. */
/* Java bindings of the NetZones. */
-/* Copyright (c) 2007-201
8
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-201
9
. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
@@
-69,14
+69,14
@@
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv * env, job
if (not cls)
return nullptr;
if (not cls)
return nullptr;
- jtable = env->NewObjectArray(static_cast<jsize>(self_as->get
Children()->
size()), cls, nullptr);
+ jtable = env->NewObjectArray(static_cast<jsize>(self_as->get
_children().
size()), cls, nullptr);
if (not jtable) {
jxbt_throw_jni(env, "Hosts table allocation failed");
return nullptr;
}
if (not jtable) {
jxbt_throw_jni(env, "Hosts table allocation failed");
return nullptr;
}
- for (auto const& tmp_as :
*self_as->getC
hildren()) {
+ for (auto const& tmp_as :
self_as->get_c
hildren()) {
jobject tmp_jas = jnetzone_new_instance(env);
if (not tmp_jas) {
jxbt_throw_jni(env, "java As instantiation failed");
jobject tmp_jas = jnetzone_new_instance(env);
if (not tmp_jas) {
jxbt_throw_jni(env, "java As instantiation failed");
@@
-127,8
+127,7
@@
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jo
if (not cls)
return nullptr;
if (not cls)
return nullptr;
- std::vector<sg_host_t> table;
- as->getHosts(&table);
+ std::vector<simgrid::s4u::Host*> table = as->get_all_hosts();
jtable = env->NewObjectArray(static_cast<jsize>(table.size()), cls, nullptr);
jtable = env->NewObjectArray(static_cast<jsize>(table.size()), cls, nullptr);