From: Martin Quinson Date: Mon, 21 Dec 2015 15:53:08 +0000 (+0100) Subject: Remove the ability to write internal plugins in Java X-Git-Tag: v3_13~1420 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/77d095374d3f966ce0f54f3837116c73bc3e52e4 Remove the ability to write internal plugins in Java It may be reintroduced once the ongoing cleanup is done, but it was really too difficult to maintain this unused feature during the change. --- diff --git a/ChangeLog b/ChangeLog index 136a2c58ca..66289ff4bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,10 +4,13 @@ SimGrid (3.13) UNRELEASED; urgency=low * BC breaks: - The option smpi/async_small_thres was renamed to smpi/async_small_thresh as we attempt to unify our naming schemes -> smpi/send_is_detached_thresh - XBT * Kill the setset datacontainer: it's unused since a while. + + JAVA: + * Remove the ability to write internal plugins in Java. + It may be reintroduced once the ongoing cleanup is done. -- $date Da SimGrid team diff --git a/examples/java/reservationSurfPlugin/CMakeLists.txt b/examples/java/reservationSurfPlugin/CMakeLists.txt deleted file mode 100644 index b712ab0f24..0000000000 --- a/examples/java/reservationSurfPlugin/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -set(example java_reservation_surf_plugin) -set(sources - ${CMAKE_CURRENT_SOURCE_DIR}/TestPlugin.java - ${CMAKE_CURRENT_SOURCE_DIR}/ReservationPlugin.java - ${CMAKE_CURRENT_SOURCE_DIR}/Sender.java - ${CMAKE_CURRENT_SOURCE_DIR}/Receiver.java - ) - -if(enable_java) - add_custom_command( - COMMENT "Building ${example}..." - OUTPUT ${example}_compiled - DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR} - COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} - -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources} - COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled - COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled - ) - add_custom_target(${example} ALL DEPENDS ${example}_compiled) -endif() - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/reservation_surf_plugin.tesh - PARENT_SCOPE - ) -set(xml_files - ${xml_files} - ${CMAKE_CURRENT_SOURCE_DIR}/reservationSurfPluginDeployment.xml - PARENT_SCOPE - ) -set(examples_src - ${examples_src} - ${sources} - PARENT_SCOPE - ) -set(bin_files - ${bin_files} - PARENT_SCOPE - ) -set(txt_files - ${txt_files} - PARENT_SCOPE - ) diff --git a/examples/java/reservationSurfPlugin/Receiver.java b/examples/java/reservationSurfPlugin/Receiver.java deleted file mode 100644 index 7097e5bcf2..0000000000 --- a/examples/java/reservationSurfPlugin/Receiver.java +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (c) 2006-2014. 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. */ - -package reservationSurfPlugin; -import org.simgrid.msg.Host; -import org.simgrid.msg.Msg; -import org.simgrid.msg.MsgException; -import org.simgrid.msg.Task; -import org.simgrid.msg.Process; - -public class Receiver extends Process { - public Receiver(Host host, String name, String[]args) { - super(host,name,args); - } - final double commSizeLat = 1; - final double commSizeBw = 100000000; - - public void main(String[] args) throws MsgException { - - Msg.info("helloo!"); - - Task task; - task = Task.receive(getHost().getName()); - task = Task.receive(getHost().getName()); - task = Task.receive(getHost().getName()); - - Msg.info("goodbye!"); - } -} diff --git a/examples/java/reservationSurfPlugin/ReservationPlugin.java b/examples/java/reservationSurfPlugin/ReservationPlugin.java deleted file mode 100644 index c23c31d5de..0000000000 --- a/examples/java/reservationSurfPlugin/ReservationPlugin.java +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) 2014. 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. */ - -package reservationSurfPlugin; - -import org.simgrid.surf.*; -import org.simgrid.msg.Msg; -import java.util.HashMap; - -public class ReservationPlugin extends Plugin { - - public ReservationPlugin() { - activateNetworkCommunicateCallback(); - } - - //HashMap reservations; - double bandwidth = 0; - String src = ""; - String dst = ""; - - public void limitBandwidthActions(String src, String dst, double bandwidth){ - this.bandwidth = bandwidth; - this.src = src; - this.dst = dst; - } - - public void updateBandwidthRoute(String src, String dst, double bandwidth){ - Link[] route = Surf.getRoute(src, dst); - for (int i =0; i - - - - - - - diff --git a/examples/java/reservationSurfPlugin/reservation_surf_plugin.tesh b/examples/java/reservationSurfPlugin/reservation_surf_plugin.tesh deleted file mode 100644 index d7d52c9876..0000000000 --- a/examples/java/reservationSurfPlugin/reservation_surf_plugin.tesh +++ /dev/null @@ -1,21 +0,0 @@ -#! tesh - -$ java -classpath ${classpath:=.} reservationSurfPlugin/TestPlugin ${srcdir:=.}/../platforms/small_platform.xml ${srcdir:=.}/reservationSurfPlugin/reservationSurfPluginDeployment.xml -> [0.000000] [jmsg/INFO] Using regular java threads. -> [Tremblay:reservationSurfPlugin.Sender:(1) 0.000000] [jmsg/INFO] helloo! -> [Ginette:reservationSurfPlugin.Receiver:(2) 0.000000] [jmsg/INFO] helloo! -> [0.000000] [jmsg/INFO] Trace: Communicate message of size 1.0 with rate -1.0 and bound 1.648342855615789E9 from Tremblay to Ginette -> [Tremblay:reservationSurfPlugin.Sender:(1) 0.016552] [jmsg/INFO] Send duration: 0.016552456969645458 -> [Tremblay:reservationSurfPlugin.Sender:(1) 0.016552] [jmsg/INFO] Trace: bandwidth of 4 before 1.0099625E7 -> [Tremblay:reservationSurfPlugin.Sender:(1) 0.016552] [jmsg/INFO] Trace: bandwidth of 4 after 1000.0 -> [Tremblay:reservationSurfPlugin.Sender:(1) 0.016552] [jmsg/INFO] Trace: bandwidth of 3 before 3.4285625E7 -> [Tremblay:reservationSurfPlugin.Sender:(1) 0.016552] [jmsg/INFO] Trace: bandwidth of 3 after 1000.0 -> [Tremblay:reservationSurfPlugin.Sender:(1) 0.016552] [jmsg/INFO] Trace: bandwidth of 5 before 2.794625E7 -> [Tremblay:reservationSurfPlugin.Sender:(1) 0.016552] [jmsg/INFO] Trace: bandwidth of 5 after 1000.0 -> [0.016552] [jmsg/INFO] Trace: Communicate message of size 1.0 with rate -1.0 and bound 1.648342855615789E9 from Tremblay to Ginette -> [Tremblay:reservationSurfPlugin.Sender:(1) 0.034187] [jmsg/INFO] Send duration with update bandwidth: 0.017634824016804124 -> [0.034187] [jmsg/INFO] Trace: Communicate message of size 1.0 with rate -1.0 and bound 100.0 from Tremblay to Ginette -> [Ginette:reservationSurfPlugin.Receiver:(2) 0.060740] [jmsg/INFO] goodbye! -> [Tremblay:reservationSurfPlugin.Sender:(1) 0.060740] [jmsg/INFO] Send normal duration with limited bandwidth: 0.02655234979 -> [Tremblay:reservationSurfPlugin.Sender:(1) 0.060740] [jmsg/INFO] goodbye! -> [0.060740] [jmsg/INFO] MSG_main finished; Cleaning up the simulation... diff --git a/examples/java/surfCpuModel/CMakeLists.txt b/examples/java/surfCpuModel/CMakeLists.txt deleted file mode 100644 index 4353388cf3..0000000000 --- a/examples/java/surfCpuModel/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -set(example java_surf_cpu_model) -set(sources - ${CMAKE_CURRENT_SOURCE_DIR}/TestCpuModel.java - ${CMAKE_CURRENT_SOURCE_DIR}/CpuConstantModel.java - ${CMAKE_CURRENT_SOURCE_DIR}/Sender.java - ${CMAKE_CURRENT_SOURCE_DIR}/Receiver.java - ) - -if(enable_java) - add_custom_command( - COMMENT "Building ${example}..." - OUTPUT ${example}_compiled - DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR} - COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} - -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources} - COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled - COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled - ) - add_custom_target(${example} ALL DEPENDS ${example}_compiled) -endif() - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/surf_cpu_model.tesh - PARENT_SCOPE - ) -set(xml_files - ${xml_files} - ${CMAKE_CURRENT_SOURCE_DIR}/surfCpuModelDeployment.xml - PARENT_SCOPE - ) -set(examples_src - ${examples_src} - ${sources} - PARENT_SCOPE - ) -set(bin_files - ${bin_files} - PARENT_SCOPE - ) -set(txt_files - ${txt_files} - PARENT_SCOPE - ) diff --git a/examples/java/surfCpuModel/CpuConstantModel.java b/examples/java/surfCpuModel/CpuConstantModel.java deleted file mode 100644 index 7118ff4c5e..0000000000 --- a/examples/java/surfCpuModel/CpuConstantModel.java +++ /dev/null @@ -1,115 +0,0 @@ -package surfCpuModel; - -import org.simgrid.surf.*; -import org.simgrid.msg.Msg; -import java.util.List; -import java.util.ArrayList; - -public class CpuConstantModel extends CpuModel { - - private List cpus = new ArrayList(); - - public CpuConstantModel() { - Msg.info("Initialize Cpu Constant Model"); - } - - public Cpu createCpu(String name, double[] power_peak, int pstate, double power_scale, TmgrTrace power_trace, int core, ResourceState state_initial, TmgrTrace state_trace) { - Msg.info("New Cpu("+name+", "+power_peak[pstate]+", "+power_scale+")"); - - CpuConstant res = new CpuConstant(this, name, core, power_peak[pstate], power_scale); - cpus.add(res); - return res; - } - - public double shareResources(double now) { - double res = -1; - for (int i=0; i actions = new ArrayList(); - - public CpuConstant(CpuConstantModel model, String name, - int core, double powerPeak, double powerScale) { - super(model, name, core, powerPeak, powerScale); - } - - public void remove(CpuConstantAction action){ - actions.remove(action); - } - - public CpuAction execute(double size) { - CpuConstantAction res = new CpuConstantAction(getModel(), size, false, false, this); - Msg.info("Execute action of size "+size+" sleeping "+res.sleeping()); - actions.add(res); - return res; - } - - public CpuAction sleep(double duration) { - CpuConstantAction res = new CpuConstantAction(getModel(), duration, false, true, this); - Msg.info("Sleep action of duration "+duration+" sleeping "+res.sleeping()); - return res; - } - - public double share(double now){ - double res = -1; - for (int i=0; i - - - - - - - diff --git a/examples/java/surfCpuModel/surf_cpu_model.tesh b/examples/java/surfCpuModel/surf_cpu_model.tesh deleted file mode 100644 index f3c4726f8d..0000000000 --- a/examples/java/surfCpuModel/surf_cpu_model.tesh +++ /dev/null @@ -1,31 +0,0 @@ -#! tesh - -$ java -classpath ${classpath:=.} surfCpuModel/TestCpuModel ${srcdir:=.}/../platforms/small_platform.xml ${srcdir:=.}/surfCpuModel/surfCpuModelDeployment.xml --cfg=host/model:compound -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'host/model' to 'compound' -> [0.000000] [jmsg/INFO] Using regular java threads. -> [0.000000] [jmsg/INFO] Initialize Cpu Constant Model -> [0.000000] [jmsg/INFO] New Cpu(Tremblay, 9.8095E7, 1.0) -> [0.000000] [jmsg/INFO] New Cpu(Jupiter, 7.6296E7, 1.0) -> [0.000000] [jmsg/INFO] New Cpu(Fafard, 7.6296E7, 1.0) -> [0.000000] [jmsg/INFO] New Cpu(Ginette, 4.8492E7, 1.0) -> [0.000000] [jmsg/INFO] New Cpu(Bourassa, 4.8492E7, 1.0) -> [0.000000] [jmsg/INFO] UpdateActionState of 0 actions -> [0.000000] [jmsg/INFO] Cpu Loaded: org.simgrid.surf.CpuModel -> [Tremblay:surfCpuModel.Sender:(1) 0.000000] [jmsg/INFO] helloo! -> [Jupiter:surfCpuModel.Receiver:(2) 0.000000] [jmsg/INFO] helloo! -> [0.000000] [jmsg/INFO] Sleep action of duration -1.0 sleeping true -> [0.000000] [jmsg/INFO] Sleep action of duration -1.0 sleeping true -> [0.000000] [jmsg/INFO] ShareResources at time -1.0 -> [0.019014] [jmsg/INFO] UpdateActionState of 2 actions -> [0.019014] [jmsg/INFO] ShareResources at time -1.0 -> [0.019014] [jmsg/INFO] UpdateActionState of 2 actions -> [Tremblay:surfCpuModel.Sender:(1) 0.019014] [jmsg/INFO] Send duration: 0.019014479160788175 -> [Tremblay:surfCpuModel.Sender:(1) 0.019014] [jmsg/INFO] goodbye! -> [0.019014] [jmsg/INFO] Execute action of size 1.0E9 sleeping false -> [0.019014] [jmsg/INFO] Share action with new time 13.10684701688162 -> [0.019014] [jmsg/INFO] ShareResources at time 13.10684701688162 -> [13.125861] [jmsg/INFO] UpdateActionState of 1 actions -> [13.125861] [jmsg/INFO] action remains 0.0 after delta of 13.10684701688162 -> [13.125861] [jmsg/INFO] action DONE -> [Jupiter:surfCpuModel.Receiver:(2) 13.125861] [jmsg/INFO] goodbye! -> [13.125861] [jmsg/INFO] MSG_main finished; Cleaning up the simulation... diff --git a/examples/java/surfPlugin/CMakeLists.txt b/examples/java/surfPlugin/CMakeLists.txt deleted file mode 100644 index 85a399a426..0000000000 --- a/examples/java/surfPlugin/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -set(example java_surf_plugin) -set(sources - ${CMAKE_CURRENT_SOURCE_DIR}/TestPlugin.java - ${CMAKE_CURRENT_SOURCE_DIR}/TracePlugin.java - ${CMAKE_CURRENT_SOURCE_DIR}/Sender.java - ${CMAKE_CURRENT_SOURCE_DIR}/Receiver.java - ) - -if(enable_java) - add_custom_command( - COMMENT "Building ${example}..." - OUTPUT ${example}_compiled - DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR} - COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} - -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources} - COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled - COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled - ) - add_custom_target(${example} ALL DEPENDS ${example}_compiled) -endif() - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/surf_plugin.tesh - PARENT_SCOPE - ) -set(xml_files - ${xml_files} - ${CMAKE_CURRENT_SOURCE_DIR}/surfPluginDeployment.xml - PARENT_SCOPE - ) -set(examples_src - ${examples_src} - ${sources} - PARENT_SCOPE - ) -set(bin_files - ${bin_files} - PARENT_SCOPE - ) -set(txt_files - ${txt_files} - PARENT_SCOPE - ) diff --git a/examples/java/surfPlugin/Receiver.java b/examples/java/surfPlugin/Receiver.java deleted file mode 100644 index 8d8158f8a6..0000000000 --- a/examples/java/surfPlugin/Receiver.java +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (c) 2006-2014. 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. */ - -package surfPlugin; -import org.simgrid.msg.Host; -import org.simgrid.msg.Msg; -import org.simgrid.msg.MsgException; -import org.simgrid.msg.Task; -import org.simgrid.msg.Process; - -public class Receiver extends Process { - public Receiver(Host host, String name, String[]args) { - super(host,name,args); - } - final double commSizeLat = 1; - final double commSizeBw = 100000000; - - public void main(String[] args) throws MsgException { - - Msg.info("helloo!"); - double communicationTime=0; - - Msg.info("try to get a task"); - - Task task = Task.receive(getHost().getName()); - double timeGot = Msg.getClock(); - - Msg.info("Got at time "+ timeGot); - task.execute(); - - Msg.info("goodbye!"); - } -} diff --git a/examples/java/surfPlugin/Sender.java b/examples/java/surfPlugin/Sender.java deleted file mode 100644 index 2f4a38268f..0000000000 --- a/examples/java/surfPlugin/Sender.java +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (c) 2006-2014. 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. */ - -package surfPlugin; -import org.simgrid.msg.Host; -import org.simgrid.msg.HostNotFoundException; -import org.simgrid.msg.Msg; -import org.simgrid.msg.MsgException; -import org.simgrid.msg.Process; -import org.simgrid.msg.Task; - -public class Sender extends Process { - public Sender(Host host, String name, String[] args) { - super(host,name,args); - } - private final double commSizeLat = 1; - final double commSizeBw = 100000000; - - public void main(String[] args) throws MsgException { - - Msg.info("helloo!"); - - int hostCount = args.length; - - Msg.info("host count: " + hostCount); - String mailboxes[] = new String[hostCount]; - double time; - double computeDuration = 10000; - Task task; - - for(int pos = 0; pos < args.length ; pos++) { - try { - mailboxes[pos] = Host.getByName(args[pos]).getName(); - } catch (HostNotFoundException e) { - Msg.info("Invalid deployment file: " + e.toString()); - System.exit(1); - } - } - - for (int pos = 0; pos < hostCount; pos++) { - time = Msg.getClock(); - - Msg.info("sender time: " + time); - - task = new Task("no name",computeDuration,commSizeLat); - - task.send(mailboxes[pos]); - } - - Msg.info("goodbye!"); - } -} diff --git a/examples/java/surfPlugin/TestPlugin.java b/examples/java/surfPlugin/TestPlugin.java deleted file mode 100644 index a4b334c7c9..0000000000 --- a/examples/java/surfPlugin/TestPlugin.java +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (c) 2006-2014. 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. */ - -package surfPlugin; -import org.simgrid.msg.Msg; -import org.simgrid.msg.NativeException; -import org.simgrid.surf.Surf; -import org.simgrid.surf.Cpu; - -public class TestPlugin { - - /* This only contains the launcher. If you do nothing more than than you can run - * java simgrid.msg.Msg - * which also contains such a launcher - */ - static TracePlugin tp = new TracePlugin(); - - public static void main(String[] args) throws NativeException { - /* initialize the MSG simulation. Must be done before anything else (even logging). */ - Msg.init(args); - if(args.length < 2) { - Msg.info("Usage : TestPlugin platform_file deployment_file"); - Msg.info("example : TestPlugin ping_pong_platform.xml ping_pong_deployment.xml"); - System.exit(1); - } - - /* construct the platform and deploy the application */ - Msg.createEnvironment(args[0]); - Msg.deployApplication(args[1]); - /* execute the simulation. */ - Msg.run(); - } -} diff --git a/examples/java/surfPlugin/TracePlugin.java b/examples/java/surfPlugin/TracePlugin.java deleted file mode 100644 index e2329f5ae0..0000000000 --- a/examples/java/surfPlugin/TracePlugin.java +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (c) 2014. 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. */ - -package surfPlugin; - -import org.simgrid.surf.*; -import org.simgrid.msg.Msg; -import java.util.HashMap; - -public class TracePlugin extends Plugin { - - public TracePlugin() { - activateCpuCreatedCallback(); - activateCpuDestructedCallback(); - activateCpuStateChangedCallback(); - activateCpuActionStateChangedCallback(); - - activateLinkCreatedCallback(); - activateLinkDestructedCallback(); - activateLinkStateChangedCallback(); - activateNetworkActionStateChangedCallback(); - } - - @Override - public void cpuCreatedCallback(Cpu cpu) { - Msg.info("Trace: Cpu created "+cpu.getName()); - } - - @Override - public void cpuDestructedCallback(Cpu cpu) { - Msg.info("Trace: Cpu destructed "+cpu.getName()); - } - - @Override - public void cpuStateChangedCallback(Cpu cpu, ResourceState old, ResourceState cur){ - Msg.info("Trace: Cpu state changed "+cpu.getName()); - } - - @Override - public void cpuActionStateChangedCallback(CpuAction action, ActionState old, ActionState cur){ - Msg.info("Trace: CpuAction state changed"); - } - - @Override - public void networkLinkCreatedCallback(Link link) { - Msg.info("Trace: Link created "+link.getName()); - } - - @Override - public void networkLinkDestructedCallback(Link link) { - Msg.info("Trace: Link destructed "+link.getName()); - } - - @Override - public void networkLinkStateChangedCallback(Link link, ResourceState old, ResourceState cur){ - Msg.info("Trace: Link state changed "+link.getName()); - } - - @Override - public void networkActionStateChangedCallback(NetworkAction action, ActionState old, ActionState cur){ - Msg.info("Trace: NetworkAction state changed"); - } - -} diff --git a/examples/java/surfPlugin/surfPluginDeployment.xml b/examples/java/surfPlugin/surfPluginDeployment.xml deleted file mode 100644 index 125d854746..0000000000 --- a/examples/java/surfPlugin/surfPluginDeployment.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/examples/java/surfPlugin/surf_plugin.tesh b/examples/java/surfPlugin/surf_plugin.tesh deleted file mode 100644 index 423cb4af84..0000000000 --- a/examples/java/surfPlugin/surf_plugin.tesh +++ /dev/null @@ -1,74 +0,0 @@ -#! tesh - -# -# DONT GIVE A SORT LENGTH PREFIX HERE. -# -# we want to sort on the whole line so that link destruction events -# (that are delivered in the order of map traversal) become reproducible -# -! output sort -# -$ java -classpath ${classpath:=.} surfPlugin/TestPlugin ${srcdir:=.}/../platforms/small_platform.xml ${srcdir:=.}/surfPlugin/surfPluginDeployment.xml -> [0.000000] [jmsg/INFO] Using regular java threads. -> [0.000000] [jmsg/INFO] Trace: Link created __loopback__ -> [0.000000] [jmsg/INFO] Trace: Link state changed __loopback__ -> [0.000000] [jmsg/INFO] Trace: Cpu created Tremblay -> [0.000000] [jmsg/INFO] Trace: Cpu state changed Tremblay -> [0.000000] [jmsg/INFO] Trace: Cpu created Jupiter -> [0.000000] [jmsg/INFO] Trace: Cpu state changed Jupiter -> [0.000000] [jmsg/INFO] Trace: Cpu created Fafard -> [0.000000] [jmsg/INFO] Trace: Cpu state changed Fafard -> [0.000000] [jmsg/INFO] Trace: Cpu created Ginette -> [0.000000] [jmsg/INFO] Trace: Cpu state changed Ginette -> [0.000000] [jmsg/INFO] Trace: Cpu created Bourassa -> [0.000000] [jmsg/INFO] Trace: Cpu state changed Bourassa -> [0.000000] [jmsg/INFO] Trace: Link created 6 -> [0.000000] [jmsg/INFO] Trace: Link state changed 6 -> [0.000000] [jmsg/INFO] Trace: Link created 3 -> [0.000000] [jmsg/INFO] Trace: Link state changed 3 -> [0.000000] [jmsg/INFO] Trace: Link created 7 -> [0.000000] [jmsg/INFO] Trace: Link state changed 7 -> [0.000000] [jmsg/INFO] Trace: Link created 9 -> [0.000000] [jmsg/INFO] Trace: Link state changed 9 -> [0.000000] [jmsg/INFO] Trace: Link created 2 -> [0.000000] [jmsg/INFO] Trace: Link state changed 2 -> [0.000000] [jmsg/INFO] Trace: Link created 8 -> [0.000000] [jmsg/INFO] Trace: Link state changed 8 -> [0.000000] [jmsg/INFO] Trace: Link created 1 -> [0.000000] [jmsg/INFO] Trace: Link state changed 1 -> [0.000000] [jmsg/INFO] Trace: Link created 4 -> [0.000000] [jmsg/INFO] Trace: Link state changed 4 -> [0.000000] [jmsg/INFO] Trace: Link created 0 -> [0.000000] [jmsg/INFO] Trace: Link state changed 0 -> [0.000000] [jmsg/INFO] Trace: Link created 5 -> [0.000000] [jmsg/INFO] Trace: Link state changed 5 -> [0.000000] [jmsg/INFO] Trace: Link created loopback -> [0.000000] [jmsg/INFO] Trace: Link state changed loopback -> [Tremblay:surfPlugin.Sender:(1) 0.000000] [jmsg/INFO] helloo! -> [Tremblay:surfPlugin.Sender:(1) 0.000000] [jmsg/INFO] host count: 1 -> [Tremblay:surfPlugin.Sender:(1) 0.000000] [jmsg/INFO] sender time: 0.0 -> [Jupiter:surfPlugin.Receiver:(2) 0.000000] [jmsg/INFO] helloo! -> [Jupiter:surfPlugin.Receiver:(2) 0.000000] [jmsg/INFO] try to get a task -> [0.019014] [jmsg/INFO] Trace: NetworkAction state changed -> [Jupiter:surfPlugin.Receiver:(2) 0.019014] [jmsg/INFO] Got at time 0.019014486310327584 -> [Tremblay:surfPlugin.Sender:(1) 0.019014] [jmsg/INFO] goodbye! -> [0.019146] [jmsg/INFO] Trace: CpuAction state changed -> [Jupiter:surfPlugin.Receiver:(2) 0.019146] [jmsg/INFO] goodbye! -> [0.019146] [jmsg/INFO] MSG_main finished; Cleaning up the simulation... -> [0.019146] [jmsg/INFO] Trace: Cpu destructed Fafard -> [0.019146] [jmsg/INFO] Trace: Cpu destructed Tremblay -> [0.019146] [jmsg/INFO] Trace: Cpu destructed Bourassa -> [0.019146] [jmsg/INFO] Trace: Cpu destructed Jupiter -> [0.019146] [jmsg/INFO] Trace: Cpu destructed Ginette -> [0.019146] [jmsg/INFO] Trace: Link destructed loopback -> [0.019146] [jmsg/INFO] Trace: Link destructed 5 -> [0.019146] [jmsg/INFO] Trace: Link destructed 0 -> [0.019146] [jmsg/INFO] Trace: Link destructed 1 -> [0.019146] [jmsg/INFO] Trace: Link destructed 9 -> [0.019146] [jmsg/INFO] Trace: Link destructed 4 -> [0.019146] [jmsg/INFO] Trace: Link destructed 7 -> [0.019146] [jmsg/INFO] Trace: Link destructed 3 -> [0.019146] [jmsg/INFO] Trace: Link destructed 8 -> [0.019146] [jmsg/INFO] Trace: Link destructed 6 -> [0.019146] [jmsg/INFO] Trace: Link destructed 2 -> [0.019146] [jmsg/INFO] Trace: Link destructed __loopback__ diff --git a/src/bindings/java/org/simgrid/NativeLib.java b/src/bindings/java/org/simgrid/NativeLib.java index daef72f6f5..7c08bc267b 100644 --- a/src/bindings/java/org/simgrid/NativeLib.java +++ b/src/bindings/java/org/simgrid/NativeLib.java @@ -27,7 +27,6 @@ public final class NativeLib { NativeLib.nativeInit("boost_context"); } catch (Exception e) {/* Dont care */} NativeLib.nativeInit("simgrid"); - NativeLib.nativeInit("surf-java"); NativeLib.nativeInit("simgrid-java"); isNativeInited = true; } diff --git a/src/bindings/java/org/simgrid/surf/Action.java b/src/bindings/java/org/simgrid/surf/Action.java deleted file mode 100644 index 4a5755f438..0000000000 --- a/src/bindings/java/org/simgrid/surf/Action.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package org.simgrid.surf; - -public class Action { - private long swigCPtr; - protected boolean swigCMemOwn; - - protected Action(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(Action obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - SurfJNI.delete_Action(swigCPtr); - } - swigCPtr = 0; - } - } - - public Action(Model model, double cost, boolean failed) { - this(SurfJNI.new_Action(Model.getCPtr(model), model, cost, failed), true); - } - - public Model getModel() { - long cPtr = SurfJNI.Action_getModel(swigCPtr, this); - return (cPtr == 0) ? null : new Model(cPtr, false); - } - - public LmmVariable getVariable() { - long cPtr = SurfJNI.Action_getVariable(swigCPtr, this); - return (cPtr == 0) ? null : new LmmVariable(cPtr, false); - } - - public ActionState getState() { - return ActionState.swigToEnum(SurfJNI.Action_getState(swigCPtr, this)); - } - - public boolean isSuspended() { - return SurfJNI.Action_isSuspended(swigCPtr, this); - } - - public double getBound() { - return SurfJNI.Action_getBound(swigCPtr, this); - } - - public void setBound(double bound) { - SurfJNI.Action_setBound(swigCPtr, this, bound); - } - - public void updateRemains(double delta) { - SurfJNI.Action_updateRemains(swigCPtr, this, delta); - } - - public double getRemains() { - return SurfJNI.Action_getRemains(swigCPtr, this); - } - - public void setPriority(double priority) { - SurfJNI.Action_setPriority(swigCPtr, this, priority); - } - - public void setState(ActionState state) { - SurfJNI.Action_setState(swigCPtr, this, state.swigValue()); - } - -} diff --git a/src/bindings/java/org/simgrid/surf/ActionList.java b/src/bindings/java/org/simgrid/surf/ActionList.java deleted file mode 100644 index 515ad2d63a..0000000000 --- a/src/bindings/java/org/simgrid/surf/ActionList.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package org.simgrid.surf; - -public class ActionList { - private long swigCPtr; - protected boolean swigCMemOwn; - - protected ActionList(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(ActionList obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - SurfJNI.delete_ActionList(swigCPtr); - } - swigCPtr = 0; - } - } - - public Action[] getArray() { - long[] cArray = SurfJNI.ActionList_getArray(swigCPtr, this); - Action[] arrayWrapper = new Action[cArray.length]; - for (int i=0; i= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + ActionState.class + " with value " + swigValue); - } - - private ActionState(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private ActionState(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private ActionState(String swigName, ActionState swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static ActionState[] swigValues = { SURF_ACTION_READY, SURF_ACTION_RUNNING, SURF_ACTION_FAILED, SURF_ACTION_DONE, SURF_ACTION_TO_FREE, SURF_ACTION_NOT_IN_THE_SYSTEM }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/src/bindings/java/org/simgrid/surf/Cpu.java b/src/bindings/java/org/simgrid/surf/Cpu.java deleted file mode 100644 index 179c60f287..0000000000 --- a/src/bindings/java/org/simgrid/surf/Cpu.java +++ /dev/null @@ -1,109 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package org.simgrid.surf; - -public class Cpu extends Resource { - private long swigCPtr; - - protected Cpu(long cPtr, boolean cMemoryOwn) { - super(SurfJNI.Cpu_SWIGUpcast(cPtr), cMemoryOwn); - swigCPtr = cPtr; - } - - protected static long getCPtr(Cpu obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - SurfJNI.delete_Cpu(swigCPtr); - } - swigCPtr = 0; - } - super.delete(); - } - - protected void swigDirectorDisconnect() { - swigCMemOwn = false; - delete(); - } - - public void swigReleaseOwnership() { - swigCMemOwn = false; - SurfJNI.Cpu_change_ownership(this, swigCPtr, false); - } - - public void swigTakeOwnership() { - swigCMemOwn = true; - SurfJNI.Cpu_change_ownership(this, swigCPtr, true); - } - - public Cpu(Model model, String name, LmmConstraint constraint, int core, double powerPeak, double powerScale) { - this(SurfJNI.new_Cpu__SWIG_0(Model.getCPtr(model), model, name, LmmConstraint.getCPtr(constraint), constraint, core, powerPeak, powerScale), true); - SurfJNI.Cpu_director_connect(this, swigCPtr, swigCMemOwn, true); - } - - public Cpu(Model model, String name, int core, double powerPeak, double powerScale) { - this(SurfJNI.new_Cpu__SWIG_1(Model.getCPtr(model), model, name, core, powerPeak, powerScale), true); - SurfJNI.Cpu_director_connect(this, swigCPtr, swigCMemOwn, true); - } - - public double getCurrentPowerPeak() { - return (getClass() == Cpu.class) ? SurfJNI.Cpu_getCurrentPowerPeak(swigCPtr, this) : SurfJNI.Cpu_getCurrentPowerPeakSwigExplicitCpu(swigCPtr, this); - } - - public CpuAction execute(double size) { - long cPtr = SurfJNI.Cpu_execute(swigCPtr, this, size); - return (cPtr == 0) ? null : new CpuAction(cPtr, false); - } - - public CpuAction sleep(double duration) { - long cPtr = SurfJNI.Cpu_sleep(swigCPtr, this, duration); - return (cPtr == 0) ? null : new CpuAction(cPtr, false); - } - - public int getCore() { - return (getClass() == Cpu.class) ? SurfJNI.Cpu_getCore(swigCPtr, this) : SurfJNI.Cpu_getCoreSwigExplicitCpu(swigCPtr, this); - } - - public double getSpeed(double load) { - return (getClass() == Cpu.class) ? SurfJNI.Cpu_getSpeed(swigCPtr, this, load) : SurfJNI.Cpu_getSpeedSwigExplicitCpu(swigCPtr, this, load); - } - - public double getAvailableSpeed() { - return (getClass() == Cpu.class) ? SurfJNI.Cpu_getAvailableSpeed(swigCPtr, this) : SurfJNI.Cpu_getAvailableSpeedSwigExplicitCpu(swigCPtr, this); - } - - public double getPowerPeakAt(int pstate_index) { - return SurfJNI.Cpu_getPowerPeakAt(swigCPtr, this, pstate_index); - } - - public int getNbPstates() { - return SurfJNI.Cpu_getNbPstates(swigCPtr, this); - } - - public void setPstate(int pstate_index) { - SurfJNI.Cpu_setPstate(swigCPtr, this, pstate_index); - } - - public int getPstate() { - return SurfJNI.Cpu_getPstate(swigCPtr, this); - } - - public void setState(ResourceState state) { - SurfJNI.Cpu_setState(swigCPtr, this, state.swigValue()); - } - -} diff --git a/src/bindings/java/org/simgrid/surf/CpuAction.java b/src/bindings/java/org/simgrid/surf/CpuAction.java deleted file mode 100644 index 509408793c..0000000000 --- a/src/bindings/java/org/simgrid/surf/CpuAction.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package org.simgrid.surf; - -public class CpuAction extends Action { - private long swigCPtr; - - protected CpuAction(long cPtr, boolean cMemoryOwn) { - super(SurfJNI.CpuAction_SWIGUpcast(cPtr), cMemoryOwn); - swigCPtr = cPtr; - } - - protected static long getCPtr(CpuAction obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - SurfJNI.delete_CpuAction(swigCPtr); - } - swigCPtr = 0; - } - super.delete(); - } - - protected void swigDirectorDisconnect() { - swigCMemOwn = false; - delete(); - } - - public void swigReleaseOwnership() { - swigCMemOwn = false; - SurfJNI.CpuAction_change_ownership(this, swigCPtr, false); - } - - public void swigTakeOwnership() { - swigCMemOwn = true; - SurfJNI.CpuAction_change_ownership(this, swigCPtr, true); - } - - public CpuAction(Model model, double cost, boolean failed) { - this(SurfJNI.new_CpuAction(Model.getCPtr(model), model, cost, failed), true); - SurfJNI.CpuAction_director_connect(this, swigCPtr, swigCMemOwn, true); - } - - public Cpu getCpu() { - long cPtr = SurfJNI.CpuAction_getCpu(swigCPtr, this); - return (cPtr == 0) ? null : new Cpu(cPtr, false); - } - -} diff --git a/src/bindings/java/org/simgrid/surf/CpuModel.java b/src/bindings/java/org/simgrid/surf/CpuModel.java deleted file mode 100644 index 4063ee137f..0000000000 --- a/src/bindings/java/org/simgrid/surf/CpuModel.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package org.simgrid.surf; - -public class CpuModel extends Model { - private long swigCPtr; - - protected CpuModel(long cPtr, boolean cMemoryOwn) { - super(SurfJNI.CpuModel_SWIGUpcast(cPtr), cMemoryOwn); - swigCPtr = cPtr; - } - - protected static long getCPtr(CpuModel obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - SurfJNI.delete_CpuModel(swigCPtr); - } - swigCPtr = 0; - } - super.delete(); - } - - protected void swigDirectorDisconnect() { - swigCMemOwn = false; - delete(); - } - - public void swigReleaseOwnership() { - swigCMemOwn = false; - SurfJNI.CpuModel_change_ownership(this, swigCPtr, false); - } - - public void swigTakeOwnership() { - swigCMemOwn = true; - SurfJNI.CpuModel_change_ownership(this, swigCPtr, true); - } - - public CpuModel() { - this(SurfJNI.new_CpuModel(), true); - SurfJNI.CpuModel_director_connect(this, swigCPtr, swigCMemOwn, true); - } - - public Cpu createCpu(String name, double[] power_peak, int pstate, double power_scale, TmgrTrace power_trace, int core, ResourceState state_initial, TmgrTrace state_trace) { - long cPtr = SurfJNI.CpuModel_createCpu(swigCPtr, this, name, power_peak, pstate, power_scale, TmgrTrace.getCPtr(power_trace), power_trace, core, state_initial.swigValue(), TmgrTrace.getCPtr(state_trace), state_trace); - return (cPtr == 0) ? null : new Cpu(cPtr, false); - } - -} diff --git a/src/bindings/java/org/simgrid/surf/Link.java b/src/bindings/java/org/simgrid/surf/Link.java deleted file mode 100644 index e61699536d..0000000000 --- a/src/bindings/java/org/simgrid/surf/Link.java +++ /dev/null @@ -1,81 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package org.simgrid.surf; - -public class Link extends Resource { - private long swigCPtr; - - protected Link(long cPtr, boolean cMemoryOwn) { - super(SurfJNI.Link_SWIGUpcast(cPtr), cMemoryOwn); - swigCPtr = cPtr; - } - - protected static long getCPtr(Link obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - SurfJNI.delete_Link(swigCPtr); - } - swigCPtr = 0; - } - super.delete(); - } - - protected static long[] cArrayUnwrap(Link[] arrayWrapper) { - long[] cArray = new long[arrayWrapper.length]; - for (int i=0; i= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + ResourceState.class + " with value " + swigValue); - } - - private ResourceState(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private ResourceState(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private ResourceState(String swigName, ResourceState swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static ResourceState[] swigValues = { SURF_RESOURCE_ON, SURF_RESOURCE_OFF }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/src/bindings/java/org/simgrid/surf/RoutingEdge.java b/src/bindings/java/org/simgrid/surf/RoutingEdge.java deleted file mode 100644 index a112d4bb10..0000000000 --- a/src/bindings/java/org/simgrid/surf/RoutingEdge.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package org.simgrid.surf; - -public class RoutingEdge { - private long swigCPtr; - protected boolean swigCMemOwn; - - protected RoutingEdge(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(RoutingEdge obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - SurfJNI.delete_RoutingEdge(swigCPtr); - } - swigCPtr = 0; - } - } - - public String getName() { - return SurfJNI.RoutingEdge_getName(swigCPtr, this); - } - -} diff --git a/src/bindings/java/org/simgrid/surf/Surf.java b/src/bindings/java/org/simgrid/surf/Surf.java deleted file mode 100644 index e58ee89b4d..0000000000 --- a/src/bindings/java/org/simgrid/surf/Surf.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package org.simgrid.surf; - -public class Surf { - public static Object getAction(long jarg1) { - return SurfJNI.getAction(jarg1); - } - - public static Object getCpuModelDirector(long jarg1) { - return SurfJNI.getCpuModelDirector(jarg1); - } - - public static Object getCpuDirector(long jarg1) { - return SurfJNI.getCpuDirector(jarg1); - } - - public static Object getCpuActionDirector(long jarg1) { - return SurfJNI.getCpuActionDirector(jarg1); - } - - - /** - * @return The current simulated time - */ - public static double getClock() { - return SurfJNI.getClock(); - } - - public static void clean() { - SurfJNI.clean(); - } - - public static CpuModel getCpuModel() { - long cPtr = SurfJNI.getCpuModel(); - return (cPtr == 0) ? null : new CpuModel(cPtr, false); - } - - public static void setCpuModel(CpuModel cpuModel) { - SurfJNI.setCpuModel(CpuModel.getCPtr(cpuModel), cpuModel); - } - - public static void setCpu(String name, Cpu cpu) { - SurfJNI.setCpu(name, Cpu.getCPtr(cpu), cpu); - } - - public static Link[] getRoute(String srcName, String dstName) { - return Link.cArrayWrap(SurfJNI.getRoute(srcName, dstName), false); -} - -} diff --git a/src/bindings/java/org/simgrid/surf/SurfJNI.java b/src/bindings/java/org/simgrid/surf/SurfJNI.java deleted file mode 100644 index d50a270340..0000000000 --- a/src/bindings/java/org/simgrid/surf/SurfJNI.java +++ /dev/null @@ -1,269 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package org.simgrid.surf; - -import org.simgrid.NativeLib; - -public class SurfJNI { - - static { - org.simgrid.NativeLib.nativeInit(); - Runtime.getRuntime().addShutdownHook( - new Thread() { - public void run() { - Thread.currentThread().setName( "Destroyer" ); - Surf.clean(); - } - } - ); - } - - public final static native long[] ActionList_getArray(long jarg1, ActionList jarg1_); - public final static native long new_ActionList(); - public final static native void delete_ActionList(long jarg1); - public final static native Object getAction(long jarg1); - public final static native Object getCpuModelDirector(long jarg1); - public final static native Object getCpuDirector(long jarg1); - public final static native Object getCpuActionDirector(long jarg1); - public final static native double getClock(); - public final static native void clean(); - public final static native long getCpuModel(); - public final static native void setCpuModel(long jarg1, CpuModel jarg1_); - public final static native void setCpu(String jarg1, long jarg2, Cpu jarg2_); - public final static native long[] getRoute(String jarg1, String jarg2); - public final static native void delete_Plugin(long jarg1); - public final static native void Plugin_activateCpuCreatedCallback(long jarg1, Plugin jarg1_); - public final static native void Plugin_cpuCreatedCallback(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_); - public final static native void Plugin_cpuCreatedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_); - public final static native void Plugin_activateCpuDestructedCallback(long jarg1, Plugin jarg1_); - public final static native void Plugin_cpuDestructedCallback(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_); - public final static native void Plugin_cpuDestructedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_); - public final static native void Plugin_activateCpuStateChangedCallback(long jarg1, Plugin jarg1_); - public final static native void Plugin_cpuStateChangedCallback(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_, int jarg3, int jarg4); - public final static native void Plugin_cpuStateChangedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_, int jarg3, int jarg4); - public final static native void Plugin_activateCpuActionStateChangedCallback(long jarg1, Plugin jarg1_); - public final static native void Plugin_cpuActionStateChangedCallback(long jarg1, Plugin jarg1_, long jarg2, CpuAction jarg2_, int jarg3, int jarg4); - public final static native void Plugin_cpuActionStateChangedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, CpuAction jarg2_, int jarg3, int jarg4); - public final static native void Plugin_activateLinkCreatedCallback(long jarg1, Plugin jarg1_); - public final static native void Plugin_networkLinkCreatedCallback(long jarg1, Plugin jarg1_, long jarg2, Link jarg2_); - public final static native void Plugin_networkLinkCreatedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, Link jarg2_); - public final static native void Plugin_activateLinkDestructedCallback(long jarg1, Plugin jarg1_); - public final static native void Plugin_networkLinkDestructedCallback(long jarg1, Plugin jarg1_, long jarg2, Link jarg2_); - public final static native void Plugin_networkLinkDestructedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, Link jarg2_); - public final static native void Plugin_activateLinkStateChangedCallback(long jarg1, Plugin jarg1_); - public final static native void Plugin_networkLinkStateChangedCallback(long jarg1, Plugin jarg1_, long jarg2, Link jarg2_, int jarg3, int jarg4); - public final static native void Plugin_networkLinkStateChangedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, Link jarg2_, int jarg3, int jarg4); - public final static native void Plugin_activateNetworkActionStateChangedCallback(long jarg1, Plugin jarg1_); - public final static native void Plugin_networkActionStateChangedCallback(long jarg1, Plugin jarg1_, long jarg2, NetworkAction jarg2_, int jarg3, int jarg4); - public final static native void Plugin_networkActionStateChangedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, NetworkAction jarg2_, int jarg3, int jarg4); - public final static native void Plugin_activateNetworkCommunicateCallback(long jarg1, Plugin jarg1_); - public final static native void Plugin_networkCommunicateCallback(long jarg1, Plugin jarg1_, long jarg2, NetworkAction jarg2_, long jarg3, RoutingEdge jarg3_, long jarg4, RoutingEdge jarg4_, double jarg5, double jarg6); - public final static native void Plugin_networkCommunicateCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, NetworkAction jarg2_, long jarg3, RoutingEdge jarg3_, long jarg4, RoutingEdge jarg4_, double jarg5, double jarg6); - public final static native long new_Plugin(); - public final static native void Plugin_director_connect(Plugin obj, long cptr, boolean mem_own, boolean weak_global); - public final static native void Plugin_change_ownership(Plugin obj, long cptr, boolean take_or_release); - public final static native void delete_TmgrTrace(long jarg1); - public final static native long TmgrTraceEvent_getIdx(long jarg1, TmgrTraceEvent jarg1_); - public final static native void delete_TmgrTraceEvent(long jarg1); - public final static native double Model_shareResources(long jarg1, Model jarg1_, double jarg2); - public final static native double Model_shareResourcesLazy(long jarg1, Model jarg1_, double jarg2); - public final static native double Model_shareResourcesFull(long jarg1, Model jarg1_, double jarg2); - public final static native void Model_updateActionsState(long jarg1, Model jarg1_, double jarg2, double jarg3); - public final static native void Model_updateActionsStateLazy(long jarg1, Model jarg1_, double jarg2, double jarg3); - public final static native void Model_updateActionsStateFull(long jarg1, Model jarg1_, double jarg2, double jarg3); - public final static native long Model_getRunningActionSet(long jarg1, Model jarg1_); - public final static native void Model_addTraces(long jarg1, Model jarg1_); - public final static native void delete_Model(long jarg1); - public final static native long new_CpuModel(); - public final static native void delete_CpuModel(long jarg1); - public final static native long CpuModel_createCpu(long jarg1, CpuModel jarg1_, String jarg2, double[] jarg3, int jarg4, double jarg5, long jarg6, TmgrTrace jarg6_, int jarg7, int jarg8, long jarg9, TmgrTrace jarg9_); - public final static native void CpuModel_director_connect(CpuModel obj, long cptr, boolean mem_own, boolean weak_global); - public final static native void CpuModel_change_ownership(CpuModel obj, long cptr, boolean take_or_release); - public final static native String Resource_getName(long jarg1, Resource jarg1_); - public final static native boolean Resource_isUsed(long jarg1, Resource jarg1_); - public final static native long Resource_getModel(long jarg1, Resource jarg1_); - public final static native int Resource_getState(long jarg1, Resource jarg1_); - public final static native long Resource_getConstraint(long jarg1, Resource jarg1_); - public final static native void Resource_updateState(long jarg1, Resource jarg1_, long jarg2, TmgrTraceEvent jarg2_, double jarg3, double jarg4); - public final static native void delete_Resource(long jarg1); - public final static native long new_Cpu__SWIG_0(long jarg1, Model jarg1_, String jarg2, long jarg3, LmmConstraint jarg3_, int jarg4, double jarg5, double jarg6); - public final static native long new_Cpu__SWIG_1(long jarg1, Model jarg1_, String jarg2, int jarg3, double jarg4, double jarg5); - public final static native void delete_Cpu(long jarg1); - public final static native double Cpu_getCurrentPowerPeak(long jarg1, Cpu jarg1_); - public final static native double Cpu_getCurrentPowerPeakSwigExplicitCpu(long jarg1, Cpu jarg1_); - public final static native long Cpu_execute(long jarg1, Cpu jarg1_, double jarg2); - public final static native long Cpu_sleep(long jarg1, Cpu jarg1_, double jarg2); - public final static native int Cpu_getCore(long jarg1, Cpu jarg1_); - public final static native int Cpu_getCoreSwigExplicitCpu(long jarg1, Cpu jarg1_); - public final static native double Cpu_getSpeed(long jarg1, Cpu jarg1_, double jarg2); - public final static native double Cpu_getSpeedSwigExplicitCpu(long jarg1, Cpu jarg1_, double jarg2); - public final static native double Cpu_getAvailableSpeed(long jarg1, Cpu jarg1_); - public final static native double Cpu_getAvailableSpeedSwigExplicitCpu(long jarg1, Cpu jarg1_); - public final static native double Cpu_getPowerPeakAt(long jarg1, Cpu jarg1_, int jarg2); - public final static native int Cpu_getNbPstates(long jarg1, Cpu jarg1_); - public final static native void Cpu_setPstate(long jarg1, Cpu jarg1_, int jarg2); - public final static native int Cpu_getPstate(long jarg1, Cpu jarg1_); - public final static native void Cpu_setState(long jarg1, Cpu jarg1_, int jarg2); - public final static native void Cpu_director_connect(Cpu obj, long cptr, boolean mem_own, boolean weak_global); - public final static native void Cpu_change_ownership(Cpu obj, long cptr, boolean take_or_release); - public final static native void delete_Link(long jarg1); - public final static native double Link_getBandwidth(long jarg1, Link jarg1_); - public final static native void Link_updateBandwidth__SWIG_0(long jarg1, Link jarg1_, double jarg2, double jarg3); - public final static native void Link_updateBandwidth__SWIG_1(long jarg1, Link jarg1_, double jarg2); - public final static native double Link_getLatency(long jarg1, Link jarg1_); - public final static native void Link_updateLatency__SWIG_0(long jarg1, Link jarg1_, double jarg2, double jarg3); - public final static native void Link_updateLatency__SWIG_1(long jarg1, Link jarg1_, double jarg2); - public final static native long Link_getProperties(long jarg1, Link jarg1_); - public final static native long new_Action(long jarg1, Model jarg1_, double jarg2, boolean jarg3); - public final static native void delete_Action(long jarg1); - public final static native long Action_getModel(long jarg1, Action jarg1_); - public final static native long Action_getVariable(long jarg1, Action jarg1_); - public final static native int Action_getState(long jarg1, Action jarg1_); - public final static native boolean Action_isSuspended(long jarg1, Action jarg1_); - public final static native double Action_getBound(long jarg1, Action jarg1_); - public final static native void Action_setBound(long jarg1, Action jarg1_, double jarg2); - public final static native void Action_updateRemains(long jarg1, Action jarg1_, double jarg2); - public final static native double Action_getRemains(long jarg1, Action jarg1_); - public final static native void Action_setPriority(long jarg1, Action jarg1_, double jarg2); - public final static native void Action_setState(long jarg1, Action jarg1_, int jarg2); - public final static native long new_CpuAction(long jarg1, Model jarg1_, double jarg2, boolean jarg3); - public final static native long CpuAction_getCpu(long jarg1, CpuAction jarg1_); - public final static native void delete_CpuAction(long jarg1); - public final static native void CpuAction_director_connect(CpuAction obj, long cptr, boolean mem_own, boolean weak_global); - public final static native void CpuAction_change_ownership(CpuAction obj, long cptr, boolean take_or_release); - public final static native double NetworkAction_getLatency(long jarg1, NetworkAction jarg1_); - public final static native void delete_NetworkAction(long jarg1); - public final static native String RoutingEdge_getName(long jarg1, RoutingEdge jarg1_); - public final static native void delete_RoutingEdge(long jarg1); - public final static native double LmmConstraint_getUsage(long jarg1, LmmConstraint jarg1_); - public final static native long new_LmmConstraint(); - public final static native void delete_LmmConstraint(long jarg1); - public final static native double LmmVariable_getValue(long jarg1, LmmVariable jarg1_); - public final static native long new_LmmVariable(); - public final static native void delete_LmmVariable(long jarg1); - public final static native String XbtDict_getValue(long jarg1, XbtDict jarg1_, String jarg2); - public final static native long new_XbtDict(); - public final static native void delete_XbtDict(long jarg1); - public final static native int SURF_ACTION_READY_get(); - public final static native int SURF_RESOURCE_ON_get(); - public final static native int SURF_RESOURCE_OFF_get(); - public final static native long CpuModel_SWIGUpcast(long jarg1); - public final static native long Cpu_SWIGUpcast(long jarg1); - public final static native long Link_SWIGUpcast(long jarg1); - public final static native long CpuAction_SWIGUpcast(long jarg1); - public final static native long NetworkAction_SWIGUpcast(long jarg1); - - public static void SwigDirector_Plugin_cpuCreatedCallback(Plugin self, long cpu) { - self.cpuCreatedCallback((cpu == 0) ? null : new Cpu(cpu, false)); - } - public static void SwigDirector_Plugin_cpuDestructedCallback(Plugin self, long cpu) { - self.cpuDestructedCallback((cpu == 0) ? null : new Cpu(cpu, false)); - } - public static void SwigDirector_Plugin_cpuStateChangedCallback(Plugin self, long cpu, int arg1, int arg2) { - self.cpuStateChangedCallback((cpu == 0) ? null : new Cpu(cpu, false), ResourceState.swigToEnum(arg1), ResourceState.swigToEnum(arg2)); - } - public static void SwigDirector_Plugin_cpuActionStateChangedCallback(Plugin self, long action, int arg1, int arg2) { - self.cpuActionStateChangedCallback((action == 0) ? null : new CpuAction(action, false), ActionState.swigToEnum(arg1), ActionState.swigToEnum(arg2)); - } - public static void SwigDirector_Plugin_networkLinkCreatedCallback(Plugin self, long link) { - self.networkLinkCreatedCallback((link == 0) ? null : new Link(link, false)); - } - public static void SwigDirector_Plugin_networkLinkDestructedCallback(Plugin self, long link) { - self.networkLinkDestructedCallback((link == 0) ? null : new Link(link, false)); - } - public static void SwigDirector_Plugin_networkLinkStateChangedCallback(Plugin self, long link, int arg1, int arg2) { - self.networkLinkStateChangedCallback((link == 0) ? null : new Link(link, false), ResourceState.swigToEnum(arg1), ResourceState.swigToEnum(arg2)); - } - public static void SwigDirector_Plugin_networkActionStateChangedCallback(Plugin self, long action, int old, int cur) { - self.networkActionStateChangedCallback((action == 0) ? null : new NetworkAction(action, false), ActionState.swigToEnum(old), ActionState.swigToEnum(cur)); - } - public static void SwigDirector_Plugin_networkCommunicateCallback(Plugin self, long action, long src, long dst, double size, double rate) { - self.networkCommunicateCallback((action == 0) ? null : new NetworkAction(action, false), (src == 0) ? null : new RoutingEdge(src, false), (dst == 0) ? null : new RoutingEdge(dst, false), size, rate); - } - public static double SwigDirector_CpuModel_shareResources(CpuModel self, double now) { - return self.shareResources(now); - } - public static double SwigDirector_CpuModel_shareResourcesLazy(CpuModel self, double now) { - return self.shareResourcesLazy(now); - } - public static double SwigDirector_CpuModel_shareResourcesFull(CpuModel self, double now) { - return self.shareResourcesFull(now); - } - public static void SwigDirector_CpuModel_updateActionsState(CpuModel self, double now, double delta) { - self.updateActionsState(now, delta); - } - public static void SwigDirector_CpuModel_updateActionsStateLazy(CpuModel self, double now, double delta) { - self.updateActionsStateLazy(now, delta); - } - public static void SwigDirector_CpuModel_updateActionsStateFull(CpuModel self, double now, double delta) { - self.updateActionsStateFull(now, delta); - } - public static long SwigDirector_CpuModel_getRunningActionSet(CpuModel self) { - return ActionList.getCPtr(self.getRunningActionSet()); - } - public static void SwigDirector_CpuModel_addTraces(CpuModel self) { - self.addTraces(); - } - public static long SwigDirector_CpuModel_createCpu(CpuModel self, String name, double[] power_peak, int pstate, double power_scale, long power_trace, int core, int state_initial, long state_trace) { - return Cpu.getCPtr(self.createCpu(name, power_peak, pstate, power_scale, (power_trace == 0) ? null : new TmgrTrace(power_trace, false), core, ResourceState.swigToEnum(state_initial), (state_trace == 0) ? null : new TmgrTrace(state_trace, false))); - } - public static boolean SwigDirector_Cpu_isUsed(Cpu self) { - return self.isUsed(); - } - public static int SwigDirector_Cpu_getState(Cpu self) { - return (self.getState()).swigValue(); - } - public static void SwigDirector_Cpu_updateState(Cpu self, long event_type, double value, double date) { - self.updateState((event_type == 0) ? null : new TmgrTraceEvent(event_type, false), value, date); - } - public static double SwigDirector_Cpu_getCurrentPowerPeak(Cpu self) { - return self.getCurrentPowerPeak(); - } - public static long SwigDirector_Cpu_execute(Cpu self, double size) { - return CpuAction.getCPtr(self.execute(size)); - } - public static long SwigDirector_Cpu_sleep(Cpu self, double duration) { - return CpuAction.getCPtr(self.sleep(duration)); - } - public static int SwigDirector_Cpu_getCore(Cpu self) { - return self.getCore(); - } - public static double SwigDirector_Cpu_getSpeed(Cpu self, double load) { - return self.getSpeed(load); - } - public static double SwigDirector_Cpu_getAvailableSpeed(Cpu self) { - return self.getAvailableSpeed(); - } - public static double SwigDirector_Cpu_getPowerPeakAt(Cpu self, int pstate_index) { - return self.getPowerPeakAt(pstate_index); - } - public static int SwigDirector_Cpu_getNbPstates(Cpu self) { - return self.getNbPstates(); - } - public static void SwigDirector_Cpu_setPstate(Cpu self, int pstate_index) { - self.setPstate(pstate_index); - } - public static int SwigDirector_Cpu_getPstate(Cpu self) { - return self.getPstate(); - } - public static double SwigDirector_CpuAction_getRemains(CpuAction self) { - return self.getRemains(); - } - public static void SwigDirector_CpuAction_setPriority(CpuAction self, double priority) { - self.setPriority(priority); - } - public static void SwigDirector_CpuAction_setState(CpuAction self, int state) { - self.setState(ActionState.swigToEnum(state)); - } - - private final static native void swig_module_init(); - static { - swig_module_init(); - } -} diff --git a/src/bindings/java/org/simgrid/surf/TmgrTrace.java b/src/bindings/java/org/simgrid/surf/TmgrTrace.java deleted file mode 100644 index 9402242bb2..0000000000 --- a/src/bindings/java/org/simgrid/surf/TmgrTrace.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package org.simgrid.surf; - -public class TmgrTrace { - private long swigCPtr; - protected boolean swigCMemOwn; - - protected TmgrTrace(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(TmgrTrace obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - SurfJNI.delete_TmgrTrace(swigCPtr); - } - swigCPtr = 0; - } - } - -} diff --git a/src/bindings/java/org/simgrid/surf/TmgrTraceEvent.java b/src/bindings/java/org/simgrid/surf/TmgrTraceEvent.java deleted file mode 100644 index 08eee1d0a2..0000000000 --- a/src/bindings/java/org/simgrid/surf/TmgrTraceEvent.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package org.simgrid.surf; - -public class TmgrTraceEvent { - private long swigCPtr; - protected boolean swigCMemOwn; - - protected TmgrTraceEvent(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(TmgrTraceEvent obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - SurfJNI.delete_TmgrTraceEvent(swigCPtr); - } - swigCPtr = 0; - } - } - - public long getIdx() { - return SurfJNI.TmgrTraceEvent_getIdx(swigCPtr, this); - } - -} diff --git a/src/bindings/java/org/simgrid/surf/XbtDict.java b/src/bindings/java/org/simgrid/surf/XbtDict.java deleted file mode 100644 index 71450b422d..0000000000 --- a/src/bindings/java/org/simgrid/surf/XbtDict.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package org.simgrid.surf; - -public class XbtDict { - private long swigCPtr; - protected boolean swigCMemOwn; - - protected XbtDict(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(XbtDict obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - SurfJNI.delete_XbtDict(swigCPtr); - } - swigCPtr = 0; - } - } - - public String getValue(String key) { - return SurfJNI.XbtDict_getValue(swigCPtr, this, key); - } - - public XbtDict() { - this(SurfJNI.new_XbtDict(), true); - } - -} diff --git a/src/bindings/java/org/simgrid/surf/surfJAVA_wrap.cxx b/src/bindings/java/org/simgrid/surf/surfJAVA_wrap.cxx deleted file mode 100644 index 8701e69d71..0000000000 --- a/src/bindings/java/org/simgrid/surf/surfJAVA_wrap.cxx +++ /dev/null @@ -1,4196 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * This file is not intended to be easily readable and contains a number of - * coding conventions designed to improve portability and efficiency. Do not make - * changes to this file unless you know what you are doing--modify the SWIG - * interface file instead. - * ----------------------------------------------------------------------------- */ - -#define SWIGJAVA -#define SWIG_DIRECTORS - - -#ifdef __cplusplus -/* SwigValueWrapper is described in swig.swg */ -template class SwigValueWrapper { - struct SwigMovePointer { - T *ptr; - SwigMovePointer(T *p) : ptr(p) { } - ~SwigMovePointer() { delete ptr; } - SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } - } pointer; - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); - SwigValueWrapper(const SwigValueWrapper& rhs); -public: - SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } - operator T&() const { return *pointer.ptr; } - T *operator&() { return pointer.ptr; } -}; - -template T SwigValueInit() { - return T(); -} -#endif - -/* ----------------------------------------------------------------------------- - * This section contains generic SWIG labels for method/variable - * declarations/attributes, and other compiler dependent labels. - * ----------------------------------------------------------------------------- */ - -/* template workaround for compilers that cannot correctly implement the C++ standard */ -#ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# elif defined(__HP_aCC) -/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ -/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif -#endif - -/* inline attribute */ -#ifndef SWIGINLINE -# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) -# define SWIGINLINE inline -# else -# define SWIGINLINE -# endif -#endif - -/* attribute recognised by some compilers to avoid 'unused' warnings */ -#ifndef SWIGUNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -# elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -#endif - -#ifndef SWIG_MSC_UNSUPPRESS_4505 -# if defined(_MSC_VER) -# pragma warning(disable : 4505) /* unreferenced local function has been removed */ -# endif -#endif - -#ifndef SWIGUNUSEDPARM -# ifdef __cplusplus -# define SWIGUNUSEDPARM(p) -# else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED -# endif -#endif - -/* internal SWIG method */ -#ifndef SWIGINTERN -# define SWIGINTERN static SWIGUNUSED -#endif - -/* internal inline SWIG method */ -#ifndef SWIGINTERNINLINE -# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE -#endif - -/* exporting methods */ -#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY -# endif -#endif - -#ifndef SWIGEXPORT -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT -# else -# define SWIGEXPORT __declspec(dllexport) -# endif -# else -# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) -# define SWIGEXPORT __attribute__ ((visibility("default"))) -# else -# define SWIGEXPORT -# endif -# endif -#endif - -/* calling conventions for Windows */ -#ifndef SWIGSTDCALL -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# define SWIGSTDCALL __stdcall -# else -# define SWIGSTDCALL -# endif -#endif - -/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ -#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -# define _CRT_SECURE_NO_DEPRECATE -#endif - -/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ -#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) -# define _SCL_SECURE_NO_DEPRECATE -#endif - - - -/* Fix for jlong on some versions of gcc on Windows */ -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) - typedef long long __int64; -#endif - -/* Fix for jlong on 64-bit x86 Solaris */ -#if defined(__x86_64) -# ifdef _LP64 -# undef _LP64 -# endif -#endif - -#include -#include -#include - - -/* Support for throwing Java exceptions */ -typedef enum { - SWIG_JavaOutOfMemoryError = 1, - SWIG_JavaIOException, - SWIG_JavaRuntimeException, - SWIG_JavaIndexOutOfBoundsException, - SWIG_JavaArithmeticException, - SWIG_JavaIllegalArgumentException, - SWIG_JavaNullPointerException, - SWIG_JavaDirectorPureVirtual, - SWIG_JavaUnknownError -} SWIG_JavaExceptionCodes; - -typedef struct { - SWIG_JavaExceptionCodes code; - const char *java_exception; -} SWIG_JavaExceptions_t; - - -static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) { - jclass excep; - static const SWIG_JavaExceptions_t java_exceptions[] = { - { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" }, - { SWIG_JavaIOException, "java/io/IOException" }, - { SWIG_JavaRuntimeException, "java/lang/RuntimeException" }, - { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" }, - { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" }, - { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" }, - { SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, - { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" }, - { SWIG_JavaUnknownError, "java/lang/UnknownError" }, - { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } - }; - const SWIG_JavaExceptions_t *except_ptr = java_exceptions; - - while (except_ptr->code != code && except_ptr->code) - except_ptr++; - - jenv->ExceptionClear(); - excep = jenv->FindClass(except_ptr->java_exception); - if (excep) - jenv->ThrowNew(excep, msg); -} - - -/* Contract support */ - -#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else - -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes that proxy - * method calls from C++ to Java extensions. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus - -#if defined(DEBUG_DIRECTOR_OWNED) -#include -#endif - -namespace Swig { - /* Java object wrapper */ - class JObjectWrapper { - public: - JObjectWrapper() : jthis_(NULL), weak_global_(true) { - } - - ~JObjectWrapper() { - jthis_ = NULL; - weak_global_ = true; - } - - bool set(JNIEnv *jenv, jobject jobj, bool mem_own, bool weak_global) { - if (!jthis_) { - weak_global_ = weak_global || !mem_own; // hold as weak global if explicitly requested or not owned - if (jobj) - jthis_ = weak_global_ ? jenv->NewWeakGlobalRef(jobj) : jenv->NewGlobalRef(jobj); -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> " << jthis_ << std::endl; -#endif - return true; - } else { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> already set" << std::endl; -#endif - return false; - } - } - - jobject get(JNIEnv *jenv) const { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::get("; - if (jthis_) - std::cout << jthis_; - else - std::cout << "null"; - std::cout << ") -> return new local ref" << std::endl; -#endif - return (jthis_ ? jenv->NewLocalRef(jthis_) : jthis_); - } - - void release(JNIEnv *jenv) { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::release(" << jthis_ << "): " << (weak_global_ ? "weak global ref" : "global ref") << std::endl; -#endif - if (jthis_) { - if (weak_global_) { - if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE) - jenv->DeleteWeakGlobalRef((jweak)jthis_); - } else - jenv->DeleteGlobalRef(jthis_); - } - - jthis_ = NULL; - weak_global_ = true; - } - - /* Only call peek if you know what you are doing wrt to weak/global references */ - jobject peek() { - return jthis_; - } - - /* Java proxy releases ownership of C++ object, C++ object is now - responsible for destruction (creates NewGlobalRef to pin Java - proxy) */ - void java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) { - if (take_or_release) { /* Java takes ownership of C++ object's lifetime. */ - if (!weak_global_) { - jenv->DeleteGlobalRef(jthis_); - jthis_ = jenv->NewWeakGlobalRef(jself); - weak_global_ = true; - } - } else { /* Java releases ownership of C++ object's lifetime */ - if (weak_global_) { - jenv->DeleteWeakGlobalRef((jweak)jthis_); - jthis_ = jenv->NewGlobalRef(jself); - weak_global_ = false; - } - } - } - - private: - /* pointer to Java object */ - jobject jthis_; - /* Local or global reference flag */ - bool weak_global_; - }; - - /* director base class */ - class Director { - /* pointer to Java virtual machine */ - JavaVM *swig_jvm_; - - protected: -#if defined (_MSC_VER) && (_MSC_VER<1300) - class JNIEnvWrapper; - friend class JNIEnvWrapper; -#endif - /* Utility class for managing the JNI environment */ - class JNIEnvWrapper { - const Director *director_; - JNIEnv *jenv_; - int env_status; - public: - JNIEnvWrapper(const Director *director) : director_(director), jenv_(0), env_status(0) { -#if defined(__ANDROID__) - JNIEnv **jenv = &jenv_; -#else - void **jenv = (void **)&jenv_; -#endif - env_status = director_->swig_jvm_->GetEnv((void **)&jenv_, JNI_VERSION_1_2); -#if defined(SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON) - // Attach a daemon thread to the JVM. Useful when the JVM should not wait for - // the thread to exit upon shutdown. Only for jdk-1.4 and later. - director_->swig_jvm_->AttachCurrentThreadAsDaemon(jenv, NULL); -#else - director_->swig_jvm_->AttachCurrentThread(jenv, NULL); -#endif - } - ~JNIEnvWrapper() { -#if !defined(SWIG_JAVA_NO_DETACH_CURRENT_THREAD) - // Some JVMs, eg jdk-1.4.2 and lower on Solaris have a bug and crash with the DetachCurrentThread call. - // However, without this call, the JVM hangs on exit when the thread was not created by the JVM and creates a memory leak. - if (env_status == JNI_EDETACHED) - director_->swig_jvm_->DetachCurrentThread(); -#endif - } - JNIEnv *getJNIEnv() const { - return jenv_; - } - }; - - /* Java object wrapper */ - JObjectWrapper swig_self_; - - /* Disconnect director from Java object */ - void swig_disconnect_director_self(const char *disconn_method) { - JNIEnvWrapper jnienv(this) ; - JNIEnv *jenv = jnienv.getJNIEnv() ; - jobject jobj = swig_self_.get(jenv); -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "Swig::Director::disconnect_director_self(" << jobj << ")" << std::endl; -#endif - if (jobj && jenv->IsSameObject(jobj, NULL) == JNI_FALSE) { - jmethodID disconn_meth = jenv->GetMethodID(jenv->GetObjectClass(jobj), disconn_method, "()V"); - if (disconn_meth) { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "Swig::Director::disconnect_director_self upcall to " << disconn_method << std::endl; -#endif - jenv->CallVoidMethod(jobj, disconn_meth); - } - } - jenv->DeleteLocalRef(jobj); - } - - public: - Director(JNIEnv *jenv) : swig_jvm_((JavaVM *) NULL), swig_self_() { - /* Acquire the Java VM pointer */ - jenv->GetJavaVM(&swig_jvm_); - } - - virtual ~Director() { - JNIEnvWrapper jnienv(this) ; - JNIEnv *jenv = jnienv.getJNIEnv() ; - swig_self_.release(jenv); - } - - bool swig_set_self(JNIEnv *jenv, jobject jself, bool mem_own, bool weak_global) { - return swig_self_.set(jenv, jself, mem_own, weak_global); - } - - jobject swig_get_self(JNIEnv *jenv) const { - return swig_self_.get(jenv); - } - - // Change C++ object's ownership, relative to Java - void swig_java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) { - swig_self_.java_change_ownership(jenv, jself, take_or_release); - } - }; -} - -#endif /* __cplusplus */ - - -namespace Swig { - namespace { - jclass jclass_SurfJNI = NULL; - jmethodID director_methids[34]; - } -} - -#if defined(SWIG_NOINCLUDE) || defined(SWIG_NOARRAYS) - - -static int SWIG_JavaArrayInBool (JNIEnv *jenv, jboolean **jarr, bool **carr, jbooleanArray input); -static void SWIG_JavaArrayArgoutBool (JNIEnv *jenv, jboolean *jarr, bool *carr, jbooleanArray input); -static jbooleanArray SWIG_JavaArrayOutBool (JNIEnv *jenv, bool *result, jsize sz); - - -static int SWIG_JavaArrayInSchar (JNIEnv *jenv, jbyte **jarr, signed char **carr, jbyteArray input); -static void SWIG_JavaArrayArgoutSchar (JNIEnv *jenv, jbyte *jarr, signed char *carr, jbyteArray input); -static jbyteArray SWIG_JavaArrayOutSchar (JNIEnv *jenv, signed char *result, jsize sz); - - -static int SWIG_JavaArrayInUchar (JNIEnv *jenv, jshort **jarr, unsigned char **carr, jshortArray input); -static void SWIG_JavaArrayArgoutUchar (JNIEnv *jenv, jshort *jarr, unsigned char *carr, jshortArray input); -static jshortArray SWIG_JavaArrayOutUchar (JNIEnv *jenv, unsigned char *result, jsize sz); - - -static int SWIG_JavaArrayInShort (JNIEnv *jenv, jshort **jarr, short **carr, jshortArray input); -static void SWIG_JavaArrayArgoutShort (JNIEnv *jenv, jshort *jarr, short *carr, jshortArray input); -static jshortArray SWIG_JavaArrayOutShort (JNIEnv *jenv, short *result, jsize sz); - - -static int SWIG_JavaArrayInUshort (JNIEnv *jenv, jint **jarr, unsigned short **carr, jintArray input); -static void SWIG_JavaArrayArgoutUshort (JNIEnv *jenv, jint *jarr, unsigned short *carr, jintArray input); -static jintArray SWIG_JavaArrayOutUshort (JNIEnv *jenv, unsigned short *result, jsize sz); - - -static int SWIG_JavaArrayInInt (JNIEnv *jenv, jint **jarr, int **carr, jintArray input); -static void SWIG_JavaArrayArgoutInt (JNIEnv *jenv, jint *jarr, int *carr, jintArray input); -static jintArray SWIG_JavaArrayOutInt (JNIEnv *jenv, int *result, jsize sz); - - -static int SWIG_JavaArrayInUint (JNIEnv *jenv, jlong **jarr, unsigned int **carr, jlongArray input); -static void SWIG_JavaArrayArgoutUint (JNIEnv *jenv, jlong *jarr, unsigned int *carr, jlongArray input); -static jlongArray SWIG_JavaArrayOutUint (JNIEnv *jenv, unsigned int *result, jsize sz); - - -static int SWIG_JavaArrayInLong (JNIEnv *jenv, jint **jarr, long **carr, jintArray input); -static void SWIG_JavaArrayArgoutLong (JNIEnv *jenv, jint *jarr, long *carr, jintArray input); -static jintArray SWIG_JavaArrayOutLong (JNIEnv *jenv, long *result, jsize sz); - - -static int SWIG_JavaArrayInUlong (JNIEnv *jenv, jlong **jarr, unsigned long **carr, jlongArray input); -static void SWIG_JavaArrayArgoutUlong (JNIEnv *jenv, jlong *jarr, unsigned long *carr, jlongArray input); -static jlongArray SWIG_JavaArrayOutUlong (JNIEnv *jenv, unsigned long *result, jsize sz); - - -static int SWIG_JavaArrayInLonglong (JNIEnv *jenv, jlong **jarr, jlong **carr, jlongArray input); -static void SWIG_JavaArrayArgoutLonglong (JNIEnv *jenv, jlong *jarr, jlong *carr, jlongArray input); -static jlongArray SWIG_JavaArrayOutLonglong (JNIEnv *jenv, jlong *result, jsize sz); - - -static int SWIG_JavaArrayInFloat (JNIEnv *jenv, jfloat **jarr, float **carr, jfloatArray input); -static void SWIG_JavaArrayArgoutFloat (JNIEnv *jenv, jfloat *jarr, float *carr, jfloatArray input); -static jfloatArray SWIG_JavaArrayOutFloat (JNIEnv *jenv, float *result, jsize sz); - - -static int SWIG_JavaArrayInDouble (JNIEnv *jenv, jdouble **jarr, double **carr, jdoubleArray input); -static void SWIG_JavaArrayArgoutDouble (JNIEnv *jenv, jdouble *jarr, double *carr, jdoubleArray input); -static jdoubleArray SWIG_JavaArrayOutDouble (JNIEnv *jenv, double *result, jsize sz); - - -#else - - -/* bool[] support */ -static int SWIG_JavaArrayInBool (JNIEnv *jenv, jboolean **jarr, bool **carr, jbooleanArray input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = jenv->GetArrayLength(input); - *jarr = jenv->GetBooleanArrayElements(input, 0); - if (!*jarr) - return 0; - *carr = new bool[sz]; - if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; iGetArrayLength(input); - for (i=0; iReleaseBooleanArrayElements(input, jarr, 0); -} - -static jbooleanArray SWIG_JavaArrayOutBool (JNIEnv *jenv, bool *result, jsize sz) { - jboolean *arr; - int i; - jbooleanArray jresult = jenv->NewBooleanArray(sz); - if (!jresult) - return NULL; - arr = jenv->GetBooleanArrayElements(jresult, 0); - if (!arr) - return NULL; - for (i=0; iReleaseBooleanArrayElements(jresult, arr, 0); - return jresult; -} - - -/* signed char[] support */ -static int SWIG_JavaArrayInSchar (JNIEnv *jenv, jbyte **jarr, signed char **carr, jbyteArray input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = jenv->GetArrayLength(input); - *jarr = jenv->GetByteArrayElements(input, 0); - if (!*jarr) - return 0; - *carr = new signed char[sz]; - if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; iGetArrayLength(input); - for (i=0; iReleaseByteArrayElements(input, jarr, 0); -} - -static jbyteArray SWIG_JavaArrayOutSchar (JNIEnv *jenv, signed char *result, jsize sz) { - jbyte *arr; - int i; - jbyteArray jresult = jenv->NewByteArray(sz); - if (!jresult) - return NULL; - arr = jenv->GetByteArrayElements(jresult, 0); - if (!arr) - return NULL; - for (i=0; iReleaseByteArrayElements(jresult, arr, 0); - return jresult; -} - - -/* unsigned char[] support */ -static int SWIG_JavaArrayInUchar (JNIEnv *jenv, jshort **jarr, unsigned char **carr, jshortArray input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = jenv->GetArrayLength(input); - *jarr = jenv->GetShortArrayElements(input, 0); - if (!*jarr) - return 0; - *carr = new unsigned char[sz]; - if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; iGetArrayLength(input); - for (i=0; iReleaseShortArrayElements(input, jarr, 0); -} - -static jshortArray SWIG_JavaArrayOutUchar (JNIEnv *jenv, unsigned char *result, jsize sz) { - jshort *arr; - int i; - jshortArray jresult = jenv->NewShortArray(sz); - if (!jresult) - return NULL; - arr = jenv->GetShortArrayElements(jresult, 0); - if (!arr) - return NULL; - for (i=0; iReleaseShortArrayElements(jresult, arr, 0); - return jresult; -} - - -/* short[] support */ -static int SWIG_JavaArrayInShort (JNIEnv *jenv, jshort **jarr, short **carr, jshortArray input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = jenv->GetArrayLength(input); - *jarr = jenv->GetShortArrayElements(input, 0); - if (!*jarr) - return 0; - *carr = new short[sz]; - if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; iGetArrayLength(input); - for (i=0; iReleaseShortArrayElements(input, jarr, 0); -} - -static jshortArray SWIG_JavaArrayOutShort (JNIEnv *jenv, short *result, jsize sz) { - jshort *arr; - int i; - jshortArray jresult = jenv->NewShortArray(sz); - if (!jresult) - return NULL; - arr = jenv->GetShortArrayElements(jresult, 0); - if (!arr) - return NULL; - for (i=0; iReleaseShortArrayElements(jresult, arr, 0); - return jresult; -} - - -/* unsigned short[] support */ -static int SWIG_JavaArrayInUshort (JNIEnv *jenv, jint **jarr, unsigned short **carr, jintArray input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = jenv->GetArrayLength(input); - *jarr = jenv->GetIntArrayElements(input, 0); - if (!*jarr) - return 0; - *carr = new unsigned short[sz]; - if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; iGetArrayLength(input); - for (i=0; iReleaseIntArrayElements(input, jarr, 0); -} - -static jintArray SWIG_JavaArrayOutUshort (JNIEnv *jenv, unsigned short *result, jsize sz) { - jint *arr; - int i; - jintArray jresult = jenv->NewIntArray(sz); - if (!jresult) - return NULL; - arr = jenv->GetIntArrayElements(jresult, 0); - if (!arr) - return NULL; - for (i=0; iReleaseIntArrayElements(jresult, arr, 0); - return jresult; -} - - -/* int[] support */ -static int SWIG_JavaArrayInInt (JNIEnv *jenv, jint **jarr, int **carr, jintArray input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = jenv->GetArrayLength(input); - *jarr = jenv->GetIntArrayElements(input, 0); - if (!*jarr) - return 0; - *carr = new int[sz]; - if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; iGetArrayLength(input); - for (i=0; iReleaseIntArrayElements(input, jarr, 0); -} - -static jintArray SWIG_JavaArrayOutInt (JNIEnv *jenv, int *result, jsize sz) { - jint *arr; - int i; - jintArray jresult = jenv->NewIntArray(sz); - if (!jresult) - return NULL; - arr = jenv->GetIntArrayElements(jresult, 0); - if (!arr) - return NULL; - for (i=0; iReleaseIntArrayElements(jresult, arr, 0); - return jresult; -} - - -/* unsigned int[] support */ -static int SWIG_JavaArrayInUint (JNIEnv *jenv, jlong **jarr, unsigned int **carr, jlongArray input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = jenv->GetArrayLength(input); - *jarr = jenv->GetLongArrayElements(input, 0); - if (!*jarr) - return 0; - *carr = new unsigned int[sz]; - if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; iGetArrayLength(input); - for (i=0; iReleaseLongArrayElements(input, jarr, 0); -} - -static jlongArray SWIG_JavaArrayOutUint (JNIEnv *jenv, unsigned int *result, jsize sz) { - jlong *arr; - int i; - jlongArray jresult = jenv->NewLongArray(sz); - if (!jresult) - return NULL; - arr = jenv->GetLongArrayElements(jresult, 0); - if (!arr) - return NULL; - for (i=0; iReleaseLongArrayElements(jresult, arr, 0); - return jresult; -} - - -/* long[] support */ -static int SWIG_JavaArrayInLong (JNIEnv *jenv, jint **jarr, long **carr, jintArray input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = jenv->GetArrayLength(input); - *jarr = jenv->GetIntArrayElements(input, 0); - if (!*jarr) - return 0; - *carr = new long[sz]; - if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; iGetArrayLength(input); - for (i=0; iReleaseIntArrayElements(input, jarr, 0); -} - -static jintArray SWIG_JavaArrayOutLong (JNIEnv *jenv, long *result, jsize sz) { - jint *arr; - int i; - jintArray jresult = jenv->NewIntArray(sz); - if (!jresult) - return NULL; - arr = jenv->GetIntArrayElements(jresult, 0); - if (!arr) - return NULL; - for (i=0; iReleaseIntArrayElements(jresult, arr, 0); - return jresult; -} - - -/* unsigned long[] support */ -static int SWIG_JavaArrayInUlong (JNIEnv *jenv, jlong **jarr, unsigned long **carr, jlongArray input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = jenv->GetArrayLength(input); - *jarr = jenv->GetLongArrayElements(input, 0); - if (!*jarr) - return 0; - *carr = new unsigned long[sz]; - if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; iGetArrayLength(input); - for (i=0; iReleaseLongArrayElements(input, jarr, 0); -} - -static jlongArray SWIG_JavaArrayOutUlong (JNIEnv *jenv, unsigned long *result, jsize sz) { - jlong *arr; - int i; - jlongArray jresult = jenv->NewLongArray(sz); - if (!jresult) - return NULL; - arr = jenv->GetLongArrayElements(jresult, 0); - if (!arr) - return NULL; - for (i=0; iReleaseLongArrayElements(jresult, arr, 0); - return jresult; -} - - -/* jlong[] support */ -static int SWIG_JavaArrayInLonglong (JNIEnv *jenv, jlong **jarr, jlong **carr, jlongArray input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = jenv->GetArrayLength(input); - *jarr = jenv->GetLongArrayElements(input, 0); - if (!*jarr) - return 0; - *carr = new jlong[sz]; - if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; iGetArrayLength(input); - for (i=0; iReleaseLongArrayElements(input, jarr, 0); -} - -static jlongArray SWIG_JavaArrayOutLonglong (JNIEnv *jenv, jlong *result, jsize sz) { - jlong *arr; - int i; - jlongArray jresult = jenv->NewLongArray(sz); - if (!jresult) - return NULL; - arr = jenv->GetLongArrayElements(jresult, 0); - if (!arr) - return NULL; - for (i=0; iReleaseLongArrayElements(jresult, arr, 0); - return jresult; -} - - -/* float[] support */ -static int SWIG_JavaArrayInFloat (JNIEnv *jenv, jfloat **jarr, float **carr, jfloatArray input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = jenv->GetArrayLength(input); - *jarr = jenv->GetFloatArrayElements(input, 0); - if (!*jarr) - return 0; - *carr = new float[sz]; - if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; iGetArrayLength(input); - for (i=0; iReleaseFloatArrayElements(input, jarr, 0); -} - -static jfloatArray SWIG_JavaArrayOutFloat (JNIEnv *jenv, float *result, jsize sz) { - jfloat *arr; - int i; - jfloatArray jresult = jenv->NewFloatArray(sz); - if (!jresult) - return NULL; - arr = jenv->GetFloatArrayElements(jresult, 0); - if (!arr) - return NULL; - for (i=0; iReleaseFloatArrayElements(jresult, arr, 0); - return jresult; -} - - -/* double[] support */ -static int SWIG_JavaArrayInDouble (JNIEnv *jenv, jdouble **jarr, double **carr, jdoubleArray input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = jenv->GetArrayLength(input); - *jarr = jenv->GetDoubleArrayElements(input, 0); - if (!*jarr) - return 0; - *carr = new double[sz]; - if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; iGetArrayLength(input); - for (i=0; iReleaseDoubleArrayElements(input, jarr, 0); -} - -static jdoubleArray SWIG_JavaArrayOutDouble (JNIEnv *jenv, double *result, jsize sz) { - jdouble *arr; - int i; - jdoubleArray jresult = jenv->NewDoubleArray(sz); - if (!jresult) - return NULL; - arr = jenv->GetDoubleArrayElements(jresult, 0); - if (!arr) - return NULL; - for (i=0; iReleaseDoubleArrayElements(jresult, arr, 0); - return jresult; -} - - -#endif - - -#include - - -#include "src/surf/surf_interface.hpp" -#include "src/surf/cpu_interface.hpp" -#include "src/surf/network_interface.hpp" -#include "src/surf/trace_mgr_private.h" -#include "src/bindings/java/surf_swig.hpp" -#include "src/xbt/dict_private.h" - -typedef struct lmm_constraint *lmm_constraint_t; -typedef xbt_dynar_t DoubleDynar; - -SWIGINTERN ActionArrayPtr simgrid_surf_ActionList_getArray(simgrid::surf::ActionList *self){ - return self; - } -SWIGINTERN unsigned int tmgr_trace_event_getIdx(tmgr_trace_event *self){return 0;} -SWIGINTERN simgrid::surf::Cpu *simgrid_surf_CpuAction_getCpu(simgrid::surf::CpuAction *self){return getActionCpu(self);} -SWIGINTERN double simgrid_surf_NetworkAction_getLatency(simgrid::surf::NetworkAction *self){return self->m_latency;} -SWIGINTERN double lmm_constraint_getUsage(lmm_constraint *self){return lmm_constraint_get_usage(self);} -SWIGINTERN double lmm_variable_getValue(lmm_variable *self){return lmm_variable_getvalue(self);} -SWIGINTERN char *s_xbt_dict_getValue(s_xbt_dict *self,char *key){return (char*)xbt_dict_get_or_null(self, key);} - - -/* --------------------------------------------------- - * C++ director class methods - * --------------------------------------------------- */ - -#include "surfJAVA_wrap.h" - -SwigDirector_Plugin::SwigDirector_Plugin(JNIEnv *jenv) : Plugin(), Swig::Director(jenv) { -} - -SwigDirector_Plugin::~SwigDirector_Plugin() { - swig_disconnect_director_self("swigDirectorDisconnect"); -} - - -void SwigDirector_Plugin::cpuCreatedCallback(simgrid::surf::Cpu *cpu) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jlong jcpu = 0 ; - - if (!swig_override[0]) { - Plugin::cpuCreatedCallback(cpu); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - *((simgrid::surf::Cpu **)&jcpu) = (simgrid::surf::Cpu *) cpu; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[0], swigjobj, jcpu); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_Plugin::cpuDestructedCallback(simgrid::surf::Cpu *cpu) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jlong jcpu = 0 ; - - if (!swig_override[1]) { - Plugin::cpuDestructedCallback(cpu); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - *((simgrid::surf::Cpu **)&jcpu) = (simgrid::surf::Cpu *) cpu; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[1], swigjobj, jcpu); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_Plugin::cpuStateChangedCallback(simgrid::surf::Cpu *cpu, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jlong jcpu = 0 ; - jint jarg1 ; - jint jarg2 ; - - if (!swig_override[2]) { - Plugin::cpuStateChangedCallback(cpu,arg1,arg2); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - *((simgrid::surf::Cpu **)&jcpu) = (simgrid::surf::Cpu *) cpu; - jarg1 = (jint) arg1; - jarg2 = (jint) arg2; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[2], swigjobj, jcpu, jarg1, jarg2); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_Plugin::cpuActionStateChangedCallback(simgrid::surf::CpuAction *action, e_surf_action_state_t arg1, e_surf_action_state_t arg2) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jlong jaction = 0 ; - jint jarg1 ; - jint jarg2 ; - - if (!swig_override[3]) { - Plugin::cpuActionStateChangedCallback(action,arg1,arg2); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - *((simgrid::surf::CpuAction **)&jaction) = (simgrid::surf::CpuAction *) action; - jarg1 = (jint) arg1; - jarg2 = (jint) arg2; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[3], swigjobj, jaction, jarg1, jarg2); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_Plugin::networkLinkCreatedCallback(simgrid::surf::Link *link) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jlong jlink = 0 ; - - if (!swig_override[4]) { - Plugin::networkLinkCreatedCallback(link); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - *((simgrid::surf::Link **)&jlink) = (simgrid::surf::Link *) link; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[4], swigjobj, jlink); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_Plugin::networkLinkDestructedCallback(simgrid::surf::Link *link) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jlong jlink = 0 ; - - if (!swig_override[5]) { - Plugin::networkLinkDestructedCallback(link); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - *((simgrid::surf::Link **)&jlink) = (simgrid::surf::Link *) link; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[5], swigjobj, jlink); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_Plugin::networkLinkStateChangedCallback(simgrid::surf::Link *link, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jlong jlink = 0 ; - jint jarg1 ; - jint jarg2 ; - - if (!swig_override[6]) { - Plugin::networkLinkStateChangedCallback(link,arg1,arg2); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - *((simgrid::surf::Link **)&jlink) = (simgrid::surf::Link *) link; - jarg1 = (jint) arg1; - jarg2 = (jint) arg2; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[6], swigjobj, jlink, jarg1, jarg2); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_Plugin::networkActionStateChangedCallback(simgrid::surf::NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jlong jaction = 0 ; - jint jold ; - jint jcur ; - - if (!swig_override[7]) { - Plugin::networkActionStateChangedCallback(action,old,cur); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - *((simgrid::surf::NetworkAction **)&jaction) = (simgrid::surf::NetworkAction *) action; - jold = (jint) old; - jcur = (jint) cur; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[7], swigjobj, jaction, jold, jcur); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_Plugin::networkCommunicateCallback(simgrid::surf::NetworkAction *action, simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst, double size, double rate) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jlong jaction = 0 ; - jlong jsrc = 0 ; - jlong jdst = 0 ; - jdouble jsize ; - jdouble jrate ; - - if (!swig_override[8]) { - Plugin::networkCommunicateCallback(action,src,dst,size,rate); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - *((simgrid::surf::NetworkAction **)&jaction) = (simgrid::surf::NetworkAction *) action; - *((simgrid::surf::RoutingEdge **)&jsrc) = (simgrid::surf::RoutingEdge *) src; - *((simgrid::surf::RoutingEdge **)&jdst) = (simgrid::surf::RoutingEdge *) dst; - jsize = (jdouble) size; - jrate = (jdouble) rate; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[8], swigjobj, jaction, jsrc, jdst, jsize, jrate); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_Plugin::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) { - static struct { - const char *mname; - const char *mdesc; - jmethodID base_methid; - } methods[] = { - { - "cpuCreatedCallback", "(Lorg/simgrid/surf/Cpu;)V", NULL - }, - { - "cpuDestructedCallback", "(Lorg/simgrid/surf/Cpu;)V", NULL - }, - { - "cpuStateChangedCallback", "(Lorg/simgrid/surf/Cpu;Lorg/simgrid/surf/ResourceState;Lorg/simgrid/surf/ResourceState;)V", NULL - }, - { - "cpuActionStateChangedCallback", "(Lorg/simgrid/surf/CpuAction;Lorg/simgrid/surf/ActionState;Lorg/simgrid/surf/ActionState;)V", NULL - }, - { - "networkLinkCreatedCallback", "(Lorg/simgrid/surf/Link;)V", NULL - }, - { - "networkLinkDestructedCallback", "(Lorg/simgrid/surf/Link;)V", NULL - }, - { - "networkLinkStateChangedCallback", "(Lorg/simgrid/surf/Link;Lorg/simgrid/surf/ResourceState;Lorg/simgrid/surf/ResourceState;)V", NULL - }, - { - "networkActionStateChangedCallback", "(Lorg/simgrid/surf/NetworkAction;Lorg/simgrid/surf/ActionState;Lorg/simgrid/surf/ActionState;)V", NULL - }, - { - "networkCommunicateCallback", "(Lorg/simgrid/surf/NetworkAction;Lorg/simgrid/surf/RoutingEdge;Lorg/simgrid/surf/RoutingEdge;DD)V", NULL - } - }; - - static jclass baseclass = 0 ; - - if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) { - if (!baseclass) { - baseclass = jenv->FindClass("org/simgrid/surf/Plugin"); - if (!baseclass) return; - baseclass = (jclass) jenv->NewGlobalRef(baseclass); - } - bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true); - for (int i = 0; i < 9; ++i) { - if (!methods[i].base_methid) { - methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc); - if (!methods[i].base_methid) return; - } - swig_override[i] = false; - if (derived) { - jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc); - swig_override[i] = (methid != methods[i].base_methid); - jenv->ExceptionClear(); - } - } - } -} - - -SwigDirector_CpuModel::SwigDirector_CpuModel(JNIEnv *jenv) : simgrid::surf::CpuModel(), Swig::Director(jenv) { -} - -double SwigDirector_CpuModel::shareResources(double now) { - double c_result = SwigValueInit< double >() ; - jdouble jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jdouble jnow ; - - if (!swig_override[0]) { - return simgrid::surf::Model::shareResources(now); - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jnow = (jdouble) now; - jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[9], swigjobj, jnow); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = (double)jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -double SwigDirector_CpuModel::shareResourcesLazy(double now) { - double c_result = SwigValueInit< double >() ; - jdouble jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jdouble jnow ; - - if (!swig_override[1]) { - return simgrid::surf::Model::shareResourcesLazy(now); - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jnow = (jdouble) now; - jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[10], swigjobj, jnow); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = (double)jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -double SwigDirector_CpuModel::shareResourcesFull(double now) { - double c_result = SwigValueInit< double >() ; - jdouble jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jdouble jnow ; - - if (!swig_override[2]) { - return simgrid::surf::Model::shareResourcesFull(now); - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jnow = (jdouble) now; - jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[11], swigjobj, jnow); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = (double)jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -void SwigDirector_CpuModel::updateActionsState(double now, double delta) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jdouble jnow ; - jdouble jdelta ; - - if (!swig_override[3]) { - simgrid::surf::Model::updateActionsState(now,delta); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jnow = (jdouble) now; - jdelta = (jdouble) delta; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[12], swigjobj, jnow, jdelta); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_CpuModel::updateActionsStateLazy(double now, double delta) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jdouble jnow ; - jdouble jdelta ; - - if (!swig_override[4]) { - simgrid::surf::Model::updateActionsStateLazy(now,delta); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jnow = (jdouble) now; - jdelta = (jdouble) delta; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[13], swigjobj, jnow, jdelta); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_CpuModel::updateActionsStateFull(double now, double delta) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jdouble jnow ; - jdouble jdelta ; - - if (!swig_override[5]) { - simgrid::surf::Model::updateActionsStateFull(now,delta); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jnow = (jdouble) now; - jdelta = (jdouble) delta; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[14], swigjobj, jnow, jdelta); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -simgrid::surf::ActionList *SwigDirector_CpuModel::getRunningActionSet() { - simgrid::surf::ActionList *c_result = 0 ; - jlong jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - - if (!swig_override[6]) { - return simgrid::surf::Model::getRunningActionSet(); - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[15], swigjobj); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = *(simgrid::surf::ActionList **)&jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -void SwigDirector_CpuModel::addTraces() { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - - if (!swig_override[7]) { - SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::CpuModel::addTraces."); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[16], swigjobj); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -SwigDirector_CpuModel::~SwigDirector_CpuModel() { - swig_disconnect_director_self("swigDirectorDisconnect"); -} - - -simgrid::surf::Cpu *SwigDirector_CpuModel::createCpu(char const *name, DoubleDynar power_peak, int pstate, double power_scale, tmgr_trace *power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace *state_trace) { - simgrid::surf::Cpu *c_result = 0 ; - jlong jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jstring jname = 0 ; - jdoubleArray jpower_peak ; - jint jpstate ; - jdouble jpower_scale ; - jlong jpower_trace = 0 ; - jint jcore ; - jint jstate_initial ; - jlong jstate_trace = 0 ; - - if (!swig_override[8]) { - SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::CpuModel::createCpu."); - return c_result; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jname = 0; - if (name) { - jname = jenv->NewStringUTF((const char *)name); - if (!jname) return c_result; - } - - long l = xbt_dynar_length(power_peak); - jpower_peak = jenv->NewDoubleArray(l); - double *lout = (double *) xbt_dynar_get_ptr(power_peak, 0); - jenv->SetDoubleArrayRegion(jpower_peak, 0, l, (jdouble*)lout); - - jpstate = (jint) pstate; - jpower_scale = (jdouble) power_scale; - *((tmgr_trace **)&jpower_trace) = (tmgr_trace *) power_trace; - jcore = (jint) core; - jstate_initial = (jint) state_initial; - *((tmgr_trace **)&jstate_trace) = (tmgr_trace *) state_trace; - jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[17], swigjobj, jname, jpower_peak, jpstate, jpower_scale, jpower_trace, jcore, jstate_initial, jstate_trace); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = *(simgrid::surf::Cpu **)&jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -void SwigDirector_CpuModel::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) { - static struct { - const char *mname; - const char *mdesc; - jmethodID base_methid; - } methods[] = { - { - "shareResources", "(D)D", NULL - }, - { - "shareResourcesLazy", "(D)D", NULL - }, - { - "shareResourcesFull", "(D)D", NULL - }, - { - "updateActionsState", "(DD)V", NULL - }, - { - "updateActionsStateLazy", "(DD)V", NULL - }, - { - "updateActionsStateFull", "(DD)V", NULL - }, - { - "getRunningActionSet", "()Lorg/simgrid/surf/ActionList;", NULL - }, - { - "addTraces", "()V", NULL - }, - { - "createCpu", "(Ljava/lang/String;[DIDLorg/simgrid/surf/TmgrTrace;ILorg/simgrid/surf/ResourceState;Lorg/simgrid/surf/TmgrTrace;)Lorg/simgrid/surf/Cpu;", NULL - } - }; - - static jclass baseclass = 0 ; - - if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) { - if (!baseclass) { - baseclass = jenv->FindClass("org/simgrid/surf/CpuModel"); - if (!baseclass) return; - baseclass = (jclass) jenv->NewGlobalRef(baseclass); - } - bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true); - for (int i = 0; i < 9; ++i) { - if (!methods[i].base_methid) { - methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc); - if (!methods[i].base_methid) return; - } - swig_override[i] = false; - if (derived) { - jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc); - swig_override[i] = (methid != methods[i].base_methid); - jenv->ExceptionClear(); - } - } - } -} - - -SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, lmm_constraint *constraint, int core, double powerPeak, double powerScale) : simgrid::surf::Cpu(model, name, constraint, core, powerPeak, powerScale), Swig::Director(jenv) { -} - -SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, int core, double powerPeak, double powerScale) : simgrid::surf::Cpu(model, name, core, powerPeak, powerScale), Swig::Director(jenv) { -} - -bool SwigDirector_Cpu::isUsed() { - bool c_result = SwigValueInit< bool >() ; - jboolean jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - - if (!swig_override[0]) { - SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::isUsed."); - return c_result; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_SurfJNI, Swig::director_methids[18], swigjobj); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = jresult ? true : false; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -e_surf_resource_state_t SwigDirector_Cpu::getState() { - e_surf_resource_state_t c_result = SwigValueInit< e_surf_resource_state_t >() ; - jint jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - - if (!swig_override[1]) { - return simgrid::surf::Resource::getState(); - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[19], swigjobj); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = (e_surf_resource_state_t)jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -void SwigDirector_Cpu::updateState(tmgr_trace_event *event_type, double value, double date) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jlong jevent_type = 0 ; - jdouble jvalue ; - jdouble jdate ; - - if (!swig_override[2]) { - SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::updateState."); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - *((tmgr_trace_event **)&jevent_type) = (tmgr_trace_event *) event_type; - jvalue = (jdouble) value; - jdate = (jdouble) date; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[20], swigjobj, jevent_type, jvalue, jdate); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -SwigDirector_Cpu::~SwigDirector_Cpu() { - swig_disconnect_director_self("swigDirectorDisconnect"); -} - - -double SwigDirector_Cpu::getCurrentPowerPeak() { - double c_result = SwigValueInit< double >() ; - jdouble jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - - if (!swig_override[3]) { - return simgrid::surf::Cpu::getCurrentPowerPeak(); - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[21], swigjobj); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = (double)jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -simgrid::surf::CpuAction *SwigDirector_Cpu::execute(double size) { - simgrid::surf::CpuAction *c_result = 0 ; - jlong jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jdouble jsize ; - - if (!swig_override[4]) { - SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::execute."); - return c_result; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jsize = (jdouble) size; - jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[22], swigjobj, jsize); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = *(simgrid::surf::CpuAction **)&jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -simgrid::surf::CpuAction *SwigDirector_Cpu::sleep(double duration) { - simgrid::surf::CpuAction *c_result = 0 ; - jlong jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jdouble jduration ; - - if (!swig_override[5]) { - SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::sleep."); - return c_result; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jduration = (jdouble) duration; - jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[23], swigjobj, jduration); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = *(simgrid::surf::CpuAction **)&jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -int SwigDirector_Cpu::getCore() { - int c_result = SwigValueInit< int >() ; - jint jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - - if (!swig_override[6]) { - return simgrid::surf::Cpu::getCore(); - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[24], swigjobj); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = (int)jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -double SwigDirector_Cpu::getSpeed(double load) { - double c_result = SwigValueInit< double >() ; - jdouble jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jdouble jload ; - - if (!swig_override[7]) { - return simgrid::surf::Cpu::getSpeed(load); - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jload = (jdouble) load; - jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[25], swigjobj, jload); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = (double)jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -double SwigDirector_Cpu::getAvailableSpeed() { - double c_result = SwigValueInit< double >() ; - jdouble jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - - if (!swig_override[8]) { - return simgrid::surf::Cpu::getAvailableSpeed(); - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[26], swigjobj); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = (double)jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -double SwigDirector_Cpu::getPowerPeakAt(int pstate_index) { - double c_result = SwigValueInit< double >() ; - jdouble jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jint jpstate_index ; - - if (!swig_override[9]) { - SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::getPowerPeakAt."); - return c_result; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jpstate_index = (jint) pstate_index; - jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[27], swigjobj, jpstate_index); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = (double)jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -int SwigDirector_Cpu::getNbPstates() { - int c_result = SwigValueInit< int >() ; - jint jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - - if (!swig_override[10]) { - SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::getNbPstates."); - return c_result; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[28], swigjobj); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = (int)jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -void SwigDirector_Cpu::setPstate(int pstate_index) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jint jpstate_index ; - - if (!swig_override[11]) { - SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::setPstate."); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jpstate_index = (jint) pstate_index; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[29], swigjobj, jpstate_index); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -int SwigDirector_Cpu::getPstate() { - int c_result = SwigValueInit< int >() ; - jint jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - - if (!swig_override[12]) { - SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::getPstate."); - return c_result; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[30], swigjobj); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = (int)jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -void SwigDirector_Cpu::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) { - static struct { - const char *mname; - const char *mdesc; - jmethodID base_methid; - } methods[] = { - { - "isUsed", "()Z", NULL - }, - { - "getState", "()Lorg/simgrid/surf/ResourceState;", NULL - }, - { - "updateState", "(Lorg/simgrid/surf/TmgrTraceEvent;DD)V", NULL - }, - { - "getCurrentPowerPeak", "()D", NULL - }, - { - "execute", "(D)Lorg/simgrid/surf/CpuAction;", NULL - }, - { - "sleep", "(D)Lorg/simgrid/surf/CpuAction;", NULL - }, - { - "getCore", "()I", NULL - }, - { - "getSpeed", "(D)D", NULL - }, - { - "getAvailableSpeed", "()D", NULL - }, - { - "getPowerPeakAt", "(I)D", NULL - }, - { - "getNbPstates", "()I", NULL - }, - { - "setPstate", "(I)V", NULL - }, - { - "getPstate", "()I", NULL - } - }; - - static jclass baseclass = 0 ; - - if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) { - if (!baseclass) { - baseclass = jenv->FindClass("org/simgrid/surf/Cpu"); - if (!baseclass) return; - baseclass = (jclass) jenv->NewGlobalRef(baseclass); - } - bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true); - for (int i = 0; i < 13; ++i) { - if (!methods[i].base_methid) { - methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc); - if (!methods[i].base_methid) return; - } - swig_override[i] = false; - if (derived) { - jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc); - swig_override[i] = (methid != methods[i].base_methid); - jenv->ExceptionClear(); - } - } - } -} - - -SwigDirector_CpuAction::SwigDirector_CpuAction(JNIEnv *jenv, simgrid::surf::Model *model, double cost, bool failed) : simgrid::surf::CpuAction(model, cost, failed), Swig::Director(jenv) { -} - -SwigDirector_CpuAction::~SwigDirector_CpuAction() { - swig_disconnect_director_self("swigDirectorDisconnect"); -} - - -double SwigDirector_CpuAction::getRemains() { - double c_result = SwigValueInit< double >() ; - jdouble jresult = 0 ; - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - - if (!swig_override[0]) { - return simgrid::surf::Action::getRemains(); - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[31], swigjobj); - if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; - c_result = (double)jresult; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); - return c_result; -} - -void SwigDirector_CpuAction::setPriority(double priority) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jdouble jpriority ; - - if (!swig_override[1]) { - simgrid::surf::Action::setPriority(priority); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jpriority = (jdouble) priority; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[32], swigjobj, jpriority); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_CpuAction::setState(e_surf_action_state_t state) { - JNIEnvWrapper swigjnienv(this) ; - JNIEnv * jenv = swigjnienv.getJNIEnv() ; - jobject swigjobj = (jobject) NULL ; - jint jstate ; - - if (!swig_override[2]) { - simgrid::surf::Action::setState(state); - return; - } - swigjobj = swig_get_self(jenv); - if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jstate = (jint) state; - jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[33], swigjobj, jstate); - if (jenv->ExceptionCheck() == JNI_TRUE) return ; - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); - } - if (swigjobj) jenv->DeleteLocalRef(swigjobj); -} - -void SwigDirector_CpuAction::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) { - static struct { - const char *mname; - const char *mdesc; - jmethodID base_methid; - } methods[] = { - { - "getRemains", "()D", NULL - }, - { - "setPriority", "(D)V", NULL - }, - { - "setState", "(Lorg/simgrid/surf/ActionState;)V", NULL - } - }; - - static jclass baseclass = 0 ; - - if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) { - if (!baseclass) { - baseclass = jenv->FindClass("org/simgrid/surf/CpuAction"); - if (!baseclass) return; - baseclass = (jclass) jenv->NewGlobalRef(baseclass); - } - bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true); - for (int i = 0; i < 3; ++i) { - if (!methods[i].base_methid) { - methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc); - if (!methods[i].base_methid) return; - } - swig_override[i] = false; - if (derived) { - jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc); - swig_override[i] = (methid != methods[i].base_methid); - jenv->ExceptionClear(); - } - } - } -} - - - -#ifdef __cplusplus -extern "C" { -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_getAction(JNIEnv *env, jclass cls, jlong jarg1) { - simgrid::surf::Action * action = (simgrid::surf::Action *)jarg1; - jobject res; - simgrid::surf::CpuAction *cpu_action = - dynamic_cast(action); - if (cpu_action) { - SwigDirector_CpuAction *dir_cpu_action = - dynamic_cast(cpu_action); - if (dir_cpu_action) { - res = dir_cpu_action->swig_get_self(env);\ - } else { - jclass clss = env->FindClass("org/simgrid/surf/CpuAction");\ - jmethodID constru = env->GetMethodID(clss, "", "()V");\ - res = env->NewObject(clss, constru);\ - res = env->NewGlobalRef(res);\ - } - } else { - jclass clss = env->FindClass("org/simgrid/surf/Action");\ - jmethodID constru = env->GetMethodID(clss, "", "()V");\ - res = env->NewObject(clss, constru);\ - res = env->NewGlobalRef(res);\ - } - return res; -} - -#define GETDIRECTOR(NAME) \ -JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_get## NAME ## Director(JNIEnv *env, jclass cls, jlong jarg1)\ -{\ - simgrid::surf::NAME * arg1 = (simgrid::surf::NAME*)jarg1;\ - SwigDirector_ ##NAME *director = dynamic_cast(arg1);\ - jobject res;\ - if (director) {\ - res = director->swig_get_self(env);\ - } else {\ - jclass clss = env->FindClass("org/simgrid/surf/NAME");\ - jmethodID constru = env->GetMethodID(clss, "", "()V");\ - res = env->NewObject(clss, constru);\ - res = env->NewGlobalRef(res);\ - }\ - return res;\ -} - -GETDIRECTOR(CpuModel) -GETDIRECTOR(Cpu) -GETDIRECTOR(CpuAction) - -#ifdef __cplusplus -} -#endif - - -SWIGEXPORT jlongArray JNICALL Java_org_simgrid_surf_SurfJNI_ActionList_1getArray(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlongArray jresult = 0 ; - simgrid::surf::ActionList *arg1 = (simgrid::surf::ActionList *) 0 ; - ActionArrayPtr result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::ActionList **)&jarg1; - result = (ActionArrayPtr)simgrid_surf_ActionList_getArray(arg1); - { - long l = 0; - for(simgrid::surf::ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) { - l++; - } - jresult = jenv->NewLongArray(l); - jlong *elts = jenv->GetLongArrayElements(jresult, NULL); - l = 0; - for(simgrid::surf::ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) { - elts[l++] = (jlong)static_cast(&*it); - } - jenv->ReleaseLongArrayElements(jresult, elts, 0); - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1ActionList(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - simgrid::surf::ActionList *result = 0 ; - - (void)jenv; - (void)jcls; - result = (simgrid::surf::ActionList *)new simgrid::surf::ActionList(); - *(simgrid::surf::ActionList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1ActionList(JNIEnv *jenv, jclass jcls, jlong jarg1) { - simgrid::surf::ActionList *arg1 = (simgrid::surf::ActionList *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(simgrid::surf::ActionList **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_getClock(JNIEnv *jenv, jclass jcls) { - jdouble jresult = 0 ; - double result; - - (void)jenv; - (void)jcls; - result = (double)getClock(); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_clean(JNIEnv *jenv, jclass jcls) { - (void)jenv; - (void)jcls; - clean(); -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_getCpuModel(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - simgrid::surf::CpuModel *result = 0 ; - - (void)jenv; - (void)jcls; - result = (simgrid::surf::CpuModel *)getCpuModel(); - *(simgrid::surf::CpuModel **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_setCpuModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::CpuModel **)&jarg1; - setCpuModel(arg1); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_setCpu(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2, jobject jarg2_) { - char *arg1 = (char *) 0 ; - simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg2_; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return ; - } - arg2 = *(simgrid::surf::Cpu **)&jarg2; - setCpu(arg1,arg2); - { - - } -} - - -SWIGEXPORT jlongArray JNICALL Java_org_simgrid_surf_SurfJNI_getRoute(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2) { - jlongArray jresult = 0 ; - char *arg1 = (char *) 0 ; - char *arg2 = (char *) 0 ; - LinkDynar result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = getRoute(arg1,arg2); - { - long l = xbt_dynar_length(result); - jresult = jenv->NewLongArray(l); - unsigned i; - Link *link; - jlong *elts = jenv->GetLongArrayElements(jresult, NULL); - xbt_dynar_foreach(result, i, link) { - elts[i] = (jlong)link; - } - jenv->ReleaseLongArrayElements(jresult, elts, 0); - xbt_dynar_free(&result); - } - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Plugin(JNIEnv *jenv, jclass jcls, jlong jarg1) { - Plugin *arg1 = (Plugin *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(Plugin **)&jarg1; - delete arg1; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - Plugin *arg1 = (Plugin *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(Plugin **)&jarg1; - (arg1)->activateCpuCreatedCallback(); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::Cpu **)&jarg2; - (arg1)->cpuCreatedCallback(arg2); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuCreatedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::Cpu **)&jarg2; - (arg1)->Plugin::cpuCreatedCallback(arg2); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - Plugin *arg1 = (Plugin *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(Plugin **)&jarg1; - (arg1)->activateCpuDestructedCallback(); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::Cpu **)&jarg2; - (arg1)->cpuDestructedCallback(arg2); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuDestructedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::Cpu **)&jarg2; - (arg1)->Plugin::cpuDestructedCallback(arg2); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - Plugin *arg1 = (Plugin *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(Plugin **)&jarg1; - (arg1)->activateCpuStateChangedCallback(); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ; - e_surf_resource_state_t arg3 ; - e_surf_resource_state_t arg4 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::Cpu **)&jarg2; - arg3 = (e_surf_resource_state_t)jarg3; - arg4 = (e_surf_resource_state_t)jarg4; - (arg1)->cpuStateChangedCallback(arg2,arg3,arg4); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ; - e_surf_resource_state_t arg3 ; - e_surf_resource_state_t arg4 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::Cpu **)&jarg2; - arg3 = (e_surf_resource_state_t)jarg3; - arg4 = (e_surf_resource_state_t)jarg4; - (arg1)->Plugin::cpuStateChangedCallback(arg2,arg3,arg4); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - Plugin *arg1 = (Plugin *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(Plugin **)&jarg1; - (arg1)->activateCpuActionStateChangedCallback(); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::CpuAction *arg2 = (simgrid::surf::CpuAction *) 0 ; - e_surf_action_state_t arg3 ; - e_surf_action_state_t arg4 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::CpuAction **)&jarg2; - arg3 = (e_surf_action_state_t)jarg3; - arg4 = (e_surf_action_state_t)jarg4; - (arg1)->cpuActionStateChangedCallback(arg2,arg3,arg4); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuActionStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::CpuAction *arg2 = (simgrid::surf::CpuAction *) 0 ; - e_surf_action_state_t arg3 ; - e_surf_action_state_t arg4 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::CpuAction **)&jarg2; - arg3 = (e_surf_action_state_t)jarg3; - arg4 = (e_surf_action_state_t)jarg4; - (arg1)->Plugin::cpuActionStateChangedCallback(arg2,arg3,arg4); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateLinkCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - Plugin *arg1 = (Plugin *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(Plugin **)&jarg1; - (arg1)->activateLinkCreatedCallback(); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::Link **)&jarg2; - (arg1)->networkLinkCreatedCallback(arg2); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkCreatedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::Link **)&jarg2; - (arg1)->Plugin::networkLinkCreatedCallback(arg2); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateLinkDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - Plugin *arg1 = (Plugin *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(Plugin **)&jarg1; - (arg1)->activateLinkDestructedCallback(); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::Link **)&jarg2; - (arg1)->networkLinkDestructedCallback(arg2); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkDestructedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::Link **)&jarg2; - (arg1)->Plugin::networkLinkDestructedCallback(arg2); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateLinkStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - Plugin *arg1 = (Plugin *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(Plugin **)&jarg1; - (arg1)->activateLinkStateChangedCallback(); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ; - e_surf_resource_state_t arg3 ; - e_surf_resource_state_t arg4 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::Link **)&jarg2; - arg3 = (e_surf_resource_state_t)jarg3; - arg4 = (e_surf_resource_state_t)jarg4; - (arg1)->networkLinkStateChangedCallback(arg2,arg3,arg4); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ; - e_surf_resource_state_t arg3 ; - e_surf_resource_state_t arg4 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::Link **)&jarg2; - arg3 = (e_surf_resource_state_t)jarg3; - arg4 = (e_surf_resource_state_t)jarg4; - (arg1)->Plugin::networkLinkStateChangedCallback(arg2,arg3,arg4); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateNetworkActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - Plugin *arg1 = (Plugin *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(Plugin **)&jarg1; - (arg1)->activateNetworkActionStateChangedCallback(); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ; - e_surf_action_state_t arg3 ; - e_surf_action_state_t arg4 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::NetworkAction **)&jarg2; - arg3 = (e_surf_action_state_t)jarg3; - arg4 = (e_surf_action_state_t)jarg4; - (arg1)->networkActionStateChangedCallback(arg2,arg3,arg4); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkActionStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ; - e_surf_action_state_t arg3 ; - e_surf_action_state_t arg4 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::NetworkAction **)&jarg2; - arg3 = (e_surf_action_state_t)jarg3; - arg4 = (e_surf_action_state_t)jarg4; - (arg1)->Plugin::networkActionStateChangedCallback(arg2,arg3,arg4); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateNetworkCommunicateCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - Plugin *arg1 = (Plugin *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(Plugin **)&jarg1; - (arg1)->activateNetworkCommunicateCallback(); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkCommunicateCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jdouble jarg5, jdouble jarg6) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ; - simgrid::surf::RoutingEdge *arg3 = (simgrid::surf::RoutingEdge *) 0 ; - simgrid::surf::RoutingEdge *arg4 = (simgrid::surf::RoutingEdge *) 0 ; - double arg5 ; - double arg6 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::NetworkAction **)&jarg2; - arg3 = *(simgrid::surf::RoutingEdge **)&jarg3; - arg4 = *(simgrid::surf::RoutingEdge **)&jarg4; - arg5 = (double)jarg5; - arg6 = (double)jarg6; - (arg1)->networkCommunicateCallback(arg2,arg3,arg4,arg5,arg6); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkCommunicateCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jdouble jarg5, jdouble jarg6) { - Plugin *arg1 = (Plugin *) 0 ; - simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ; - simgrid::surf::RoutingEdge *arg3 = (simgrid::surf::RoutingEdge *) 0 ; - simgrid::surf::RoutingEdge *arg4 = (simgrid::surf::RoutingEdge *) 0 ; - double arg5 ; - double arg6 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(Plugin **)&jarg1; - arg2 = *(simgrid::surf::NetworkAction **)&jarg2; - arg3 = *(simgrid::surf::RoutingEdge **)&jarg3; - arg4 = *(simgrid::surf::RoutingEdge **)&jarg4; - arg5 = (double)jarg5; - arg6 = (double)jarg6; - (arg1)->Plugin::networkCommunicateCallback(arg2,arg3,arg4,arg5,arg6); -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Plugin(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - Plugin *result = 0 ; - - (void)jenv; - (void)jcls; - result = (Plugin *)new SwigDirector_Plugin(jenv); - *(Plugin **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) { - Plugin *obj = *((Plugin **)&objarg); - (void)jcls; - SwigDirector_Plugin *director = dynamic_cast(obj); - if (director) { - director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE)); - } -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) { - Plugin *obj = *((Plugin **)&objarg); - SwigDirector_Plugin *director = dynamic_cast(obj); - (void)jcls; - if (director) { - director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false); - } -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1TmgrTrace(JNIEnv *jenv, jclass jcls, jlong jarg1) { - tmgr_trace *arg1 = (tmgr_trace *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(tmgr_trace **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_TmgrTraceEvent_1getIdx(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - tmgr_trace_event *arg1 = (tmgr_trace_event *) 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(tmgr_trace_event **)&jarg1; - result = (unsigned int)tmgr_trace_event_getIdx(arg1); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1TmgrTraceEvent(JNIEnv *jenv, jclass jcls, jlong jarg1) { - tmgr_trace_event *arg1 = (tmgr_trace_event *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(tmgr_trace_event **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResources(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - jdouble jresult = 0 ; - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - double arg2 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Model **)&jarg1; - arg2 = (double)jarg2; - result = (double)(arg1)->shareResources(arg2); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResourcesLazy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - jdouble jresult = 0 ; - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - double arg2 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Model **)&jarg1; - arg2 = (double)jarg2; - result = (double)(arg1)->shareResourcesLazy(arg2); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResourcesFull(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - jdouble jresult = 0 ; - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - double arg2 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Model **)&jarg1; - arg2 = (double)jarg2; - result = (double)(arg1)->shareResourcesFull(arg2); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) { - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - double arg2 ; - double arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Model **)&jarg1; - arg2 = (double)jarg2; - arg3 = (double)jarg3; - (arg1)->updateActionsState(arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsStateLazy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) { - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - double arg2 ; - double arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Model **)&jarg1; - arg2 = (double)jarg2; - arg3 = (double)jarg3; - (arg1)->updateActionsStateLazy(arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsStateFull(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) { - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - double arg2 ; - double arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Model **)&jarg1; - arg2 = (double)jarg2; - arg3 = (double)jarg3; - (arg1)->updateActionsStateFull(arg2,arg3); -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Model_1getRunningActionSet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - simgrid::surf::ActionList *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Model **)&jarg1; - result = (simgrid::surf::ActionList *)(arg1)->getRunningActionSet(); - *(simgrid::surf::ActionList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1addTraces(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Model **)&jarg1; - (arg1)->addTraces(); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Model(JNIEnv *jenv, jclass jcls, jlong jarg1) { - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(simgrid::surf::Model **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1CpuModel(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - simgrid::surf::CpuModel *result = 0 ; - - (void)jenv; - (void)jcls; - result = (simgrid::surf::CpuModel *)new SwigDirector_CpuModel(jenv); - *(simgrid::surf::CpuModel **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1CpuModel(JNIEnv *jenv, jclass jcls, jlong jarg1) { - simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(simgrid::surf::CpuModel **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1createCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jdoubleArray jarg3, jint jarg4, jdouble jarg5, jlong jarg6, jobject jarg6_, jint jarg7, jint jarg8, jlong jarg9, jobject jarg9_) { - jlong jresult = 0 ; - simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ; - char *arg2 = (char *) 0 ; - DoubleDynar arg3 ; - int arg4 ; - double arg5 ; - tmgr_trace *arg6 = (tmgr_trace *) 0 ; - int arg7 ; - e_surf_resource_state_t arg8 ; - tmgr_trace *arg9 = (tmgr_trace *) 0 ; - DoubleDynar *argp3 ; - simgrid::surf::Cpu *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg6_; - (void)jarg9_; - arg1 = *(simgrid::surf::CpuModel **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - argp3 = *(DoubleDynar **)&jarg3; - if (!argp3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null DoubleDynar"); - return 0; - } - arg3 = *argp3; - arg4 = (int)jarg4; - arg5 = (double)jarg5; - arg6 = *(tmgr_trace **)&jarg6; - arg7 = (int)jarg7; - arg8 = (e_surf_resource_state_t)jarg8; - arg9 = *(tmgr_trace **)&jarg9; - result = (simgrid::surf::Cpu *)(arg1)->createCpu((char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); - *(simgrid::surf::Cpu **)&jresult = result; - { - - } - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) { - simgrid::surf::CpuModel *obj = *((simgrid::surf::CpuModel **)&objarg); - (void)jcls; - SwigDirector_CpuModel *director = dynamic_cast(obj); - if (director) { - director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE)); - } -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) { - simgrid::surf::CpuModel *obj = *((simgrid::surf::CpuModel **)&objarg); - SwigDirector_CpuModel *director = dynamic_cast(obj); - (void)jcls; - if (director) { - director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false); - } -} - - -SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Resource **)&jarg1; - result = (char *)(arg1)->getName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1isUsed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Resource **)&jarg1; - result = (bool)(arg1)->isUsed(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ; - simgrid::surf::Model *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Resource **)&jarg1; - result = (simgrid::surf::Model *)(arg1)->getModel(); - *(simgrid::surf::Model **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ; - e_surf_resource_state_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Resource **)&jarg1; - result = (e_surf_resource_state_t)(arg1)->getState(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getConstraint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ; - lmm_constraint *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Resource **)&jarg1; - result = (lmm_constraint *)(arg1)->getConstraint(); - *(lmm_constraint **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1updateState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jdouble jarg3, jdouble jarg4) { - simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ; - tmgr_trace_event *arg2 = (tmgr_trace_event *) 0 ; - double arg3 ; - double arg4 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(simgrid::surf::Resource **)&jarg1; - arg2 = *(tmgr_trace_event **)&jarg2; - arg3 = (double)jarg3; - arg4 = (double)jarg4; - (arg1)->updateState(arg2,arg3,arg4); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Resource(JNIEnv *jenv, jclass jcls, jlong jarg1) { - simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(simgrid::surf::Resource **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Cpu_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jint jarg4, jdouble jarg5, jdouble jarg6) { - jlong jresult = 0 ; - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - char *arg2 = (char *) 0 ; - lmm_constraint *arg3 = (lmm_constraint *) 0 ; - int arg4 ; - double arg5 ; - double arg6 ; - simgrid::surf::Cpu *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(simgrid::surf::Model **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lmm_constraint **)&jarg3; - arg4 = (int)jarg4; - arg5 = (double)jarg5; - arg6 = (double)jarg6; - result = (simgrid::surf::Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6); - *(simgrid::surf::Cpu **)&jresult = result; - { - - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Cpu_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3, jdouble jarg4, jdouble jarg5) { - jlong jresult = 0 ; - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - char *arg2 = (char *) 0 ; - int arg3 ; - double arg4 ; - double arg5 ; - simgrid::surf::Cpu *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Model **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (int)jarg3; - arg4 = (double)jarg4; - arg5 = (double)jarg5; - result = (simgrid::surf::Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5); - *(simgrid::surf::Cpu **)&jresult = result; - { - - } - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Cpu(JNIEnv *jenv, jclass jcls, jlong jarg1) { - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCurrentPowerPeak(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jdouble jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - result = (double)(arg1)->getCurrentPowerPeak(); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCurrentPowerPeakSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jdouble jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - result = (double)(arg1)->simgrid::surf::Cpu::getCurrentPowerPeak(); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1execute(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - jlong jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - double arg2 ; - simgrid::surf::CpuAction *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - arg2 = (double)jarg2; - result = (simgrid::surf::CpuAction *)(arg1)->execute(arg2); - *(simgrid::surf::CpuAction **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1sleep(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - jlong jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - double arg2 ; - simgrid::surf::CpuAction *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - arg2 = (double)jarg2; - result = (simgrid::surf::CpuAction *)(arg1)->sleep(arg2); - *(simgrid::surf::CpuAction **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCore(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - result = (int)(arg1)->getCore(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCoreSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - result = (int)(arg1)->simgrid::surf::Cpu::getCore(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getSpeed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - jdouble jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - double arg2 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - arg2 = (double)jarg2; - result = (double)(arg1)->getSpeed(arg2); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getSpeedSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - jdouble jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - double arg2 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - arg2 = (double)jarg2; - result = (double)(arg1)->simgrid::surf::Cpu::getSpeed(arg2); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getAvailableSpeed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jdouble jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - result = (double)(arg1)->getAvailableSpeed(); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getAvailableSpeedSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jdouble jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - result = (double)(arg1)->simgrid::surf::Cpu::getAvailableSpeed(); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getPowerPeakAt(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jdouble jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - int arg2 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - arg2 = (int)jarg2; - result = (double)(arg1)->getPowerPeakAt(arg2); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getNbPstates(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - result = (int)(arg1)->getNbPstates(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1setPstate(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - int arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - arg2 = (int)jarg2; - (arg1)->setPstate(arg2); -} - - -SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getPstate(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - result = (int)(arg1)->getPstate(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1setState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ; - e_surf_resource_state_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Cpu **)&jarg1; - arg2 = (e_surf_resource_state_t)jarg2; - (arg1)->setState(arg2); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) { - simgrid::surf::Cpu *obj = *((simgrid::surf::Cpu **)&objarg); - (void)jcls; - SwigDirector_Cpu *director = dynamic_cast(obj); - if (director) { - director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE)); - } -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) { - simgrid::surf::Cpu *obj = *((simgrid::surf::Cpu **)&objarg); - SwigDirector_Cpu *director = dynamic_cast(obj); - (void)jcls; - if (director) { - director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false); - } -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Link(JNIEnv *jenv, jclass jcls, jlong jarg1) { - simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(simgrid::surf::Link **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Link_1getBandwidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jdouble jresult = 0 ; - simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Link **)&jarg1; - result = (double)(arg1)->getBandwidth(); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateBandwidth_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) { - simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ; - double arg2 ; - double arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Link **)&jarg1; - arg2 = (double)jarg2; - arg3 = (double)jarg3; - (arg1)->updateBandwidth(arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateBandwidth_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ; - double arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Link **)&jarg1; - arg2 = (double)jarg2; - (arg1)->updateBandwidth(arg2); -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Link_1getLatency(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jdouble jresult = 0 ; - simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Link **)&jarg1; - result = (double)(arg1)->getLatency(); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateLatency_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) { - simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ; - double arg2 ; - double arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Link **)&jarg1; - arg2 = (double)jarg2; - arg3 = (double)jarg3; - (arg1)->updateLatency(arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateLatency_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ; - double arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Link **)&jarg1; - arg2 = (double)jarg2; - (arg1)->updateLatency(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Link_1getProperties(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ; - s_xbt_dict *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Link **)&jarg1; - result = (s_xbt_dict *)(arg1)->getProperties(); - *(s_xbt_dict **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Action(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jboolean jarg3) { - jlong jresult = 0 ; - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - double arg2 ; - bool arg3 ; - simgrid::surf::Action *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Model **)&jarg1; - arg2 = (double)jarg2; - arg3 = jarg3 ? true : false; - result = (simgrid::surf::Action *)new simgrid::surf::Action(arg1,arg2,arg3); - *(simgrid::surf::Action **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Action(JNIEnv *jenv, jclass jcls, jlong jarg1) { - simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(simgrid::surf::Action **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ; - simgrid::surf::Model *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Action **)&jarg1; - result = (simgrid::surf::Model *)(arg1)->getModel(); - *(simgrid::surf::Model **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getVariable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ; - lmm_variable *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Action **)&jarg1; - result = (lmm_variable *)(arg1)->getVariable(); - *(lmm_variable **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ; - e_surf_action_state_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Action **)&jarg1; - result = (e_surf_action_state_t)(arg1)->getState(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_org_simgrid_surf_SurfJNI_Action_1isSuspended(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Action **)&jarg1; - result = (bool)(arg1)->isSuspended(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getBound(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jdouble jresult = 0 ; - simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Action **)&jarg1; - result = (double)(arg1)->getBound(); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setBound(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ; - double arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Action **)&jarg1; - arg2 = (double)jarg2; - (arg1)->setBound(arg2); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1updateRemains(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ; - double arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Action **)&jarg1; - arg2 = (double)jarg2; - (arg1)->updateRemains(arg2); -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getRemains(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jdouble jresult = 0 ; - simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Action **)&jarg1; - result = (double)(arg1)->getRemains(); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setPriority(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ; - double arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Action **)&jarg1; - arg2 = (double)jarg2; - (arg1)->setPriority(arg2); -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ; - e_surf_action_state_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Action **)&jarg1; - arg2 = (e_surf_action_state_t)jarg2; - (arg1)->setState(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1CpuAction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jboolean jarg3) { - jlong jresult = 0 ; - simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ; - double arg2 ; - bool arg3 ; - simgrid::surf::CpuAction *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::Model **)&jarg1; - arg2 = (double)jarg2; - arg3 = jarg3 ? true : false; - result = (simgrid::surf::CpuAction *)new SwigDirector_CpuAction(jenv,arg1,arg2,arg3); - *(simgrid::surf::CpuAction **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1getCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - simgrid::surf::CpuAction *arg1 = (simgrid::surf::CpuAction *) 0 ; - simgrid::surf::Cpu *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::CpuAction **)&jarg1; - result = (simgrid::surf::Cpu *)simgrid_surf_CpuAction_getCpu(arg1); - *(simgrid::surf::Cpu **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1CpuAction(JNIEnv *jenv, jclass jcls, jlong jarg1) { - simgrid::surf::CpuAction *arg1 = (simgrid::surf::CpuAction *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(simgrid::surf::CpuAction **)&jarg1; - delete arg1; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) { - simgrid::surf::CpuAction *obj = *((simgrid::surf::CpuAction **)&objarg); - (void)jcls; - SwigDirector_CpuAction *director = dynamic_cast(obj); - if (director) { - director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE)); - } -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) { - simgrid::surf::CpuAction *obj = *((simgrid::surf::CpuAction **)&objarg); - SwigDirector_CpuAction *director = dynamic_cast(obj); - (void)jcls; - if (director) { - director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false); - } -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_NetworkAction_1getLatency(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jdouble jresult = 0 ; - simgrid::surf::NetworkAction *arg1 = (simgrid::surf::NetworkAction *) 0 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::NetworkAction **)&jarg1; - result = (double)simgrid_surf_NetworkAction_getLatency(arg1); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1NetworkAction(JNIEnv *jenv, jclass jcls, jlong jarg1) { - simgrid::surf::NetworkAction *arg1 = (simgrid::surf::NetworkAction *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(simgrid::surf::NetworkAction **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_RoutingEdge_1getName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - simgrid::surf::RoutingEdge *arg1 = (simgrid::surf::RoutingEdge *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(simgrid::surf::RoutingEdge **)&jarg1; - result = (char *)(arg1)->getName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1RoutingEdge(JNIEnv *jenv, jclass jcls, jlong jarg1) { - simgrid::surf::RoutingEdge *arg1 = (simgrid::surf::RoutingEdge *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(simgrid::surf::RoutingEdge **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_LmmConstraint_1getUsage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jdouble jresult = 0 ; - lmm_constraint *arg1 = (lmm_constraint *) 0 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lmm_constraint **)&jarg1; - result = (double)lmm_constraint_getUsage(arg1); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1LmmConstraint(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lmm_constraint *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lmm_constraint *)new lmm_constraint(); - *(lmm_constraint **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1LmmConstraint(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lmm_constraint *arg1 = (lmm_constraint *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lmm_constraint **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_LmmVariable_1getValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jdouble jresult = 0 ; - lmm_variable *arg1 = (lmm_variable *) 0 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lmm_variable **)&jarg1; - result = (double)lmm_variable_getValue(arg1); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1LmmVariable(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lmm_variable *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lmm_variable *)new lmm_variable(); - *(lmm_variable **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1LmmVariable(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lmm_variable *arg1 = (lmm_variable *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lmm_variable **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_XbtDict_1getValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jstring jresult = 0 ; - s_xbt_dict *arg1 = (s_xbt_dict *) 0 ; - char *arg2 = (char *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(s_xbt_dict **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (char *)s_xbt_dict_getValue(arg1,arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1XbtDict(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - s_xbt_dict *result = 0 ; - - (void)jenv; - (void)jcls; - result = (s_xbt_dict *)new s_xbt_dict(); - *(s_xbt_dict **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1XbtDict(JNIEnv *jenv, jclass jcls, jlong jarg1) { - s_xbt_dict *arg1 = (s_xbt_dict *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(s_xbt_dict **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_SURF_1ACTION_1READY_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - e_surf_action_state_t result; - - (void)jenv; - (void)jcls; - result = (e_surf_action_state_t)SURF_ACTION_READY; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_SURF_1RESOURCE_1ON_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - e_surf_resource_state_t result; - - (void)jenv; - (void)jcls; - result = (e_surf_resource_state_t)SURF_RESOURCE_ON; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_SURF_1RESOURCE_1OFF_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - e_surf_resource_state_t result; - - (void)jenv; - (void)jcls; - result = (e_surf_resource_state_t)SURF_RESOURCE_OFF; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) { - jlong baseptr = 0; - (void)jenv; - (void)jcls; - *(simgrid::surf::Model **)&baseptr = *(simgrid::surf::CpuModel **)&jarg1; - return baseptr; -} - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) { - jlong baseptr = 0; - (void)jenv; - (void)jcls; - *(simgrid::surf::Resource **)&baseptr = *(simgrid::surf::Cpu **)&jarg1; - return baseptr; -} - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Link_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) { - jlong baseptr = 0; - (void)jenv; - (void)jcls; - *(simgrid::surf::Resource **)&baseptr = *(simgrid::surf::Link **)&jarg1; - return baseptr; -} - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) { - jlong baseptr = 0; - (void)jenv; - (void)jcls; - *(simgrid::surf::Action **)&baseptr = *(simgrid::surf::CpuAction **)&jarg1; - return baseptr; -} - -SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_NetworkAction_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) { - jlong baseptr = 0; - (void)jenv; - (void)jcls; - *(simgrid::surf::Action **)&baseptr = *(simgrid::surf::NetworkAction **)&jarg1; - return baseptr; -} - -SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_swig_1module_1init(JNIEnv *jenv, jclass jcls) { - int i; - - static struct { - const char *method; - const char *signature; - } methods[34] = { - { - "SwigDirector_Plugin_cpuCreatedCallback", "(Lorg/simgrid/surf/Plugin;J)V" - }, - { - "SwigDirector_Plugin_cpuDestructedCallback", "(Lorg/simgrid/surf/Plugin;J)V" - }, - { - "SwigDirector_Plugin_cpuStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" - }, - { - "SwigDirector_Plugin_cpuActionStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" - }, - { - "SwigDirector_Plugin_networkLinkCreatedCallback", "(Lorg/simgrid/surf/Plugin;J)V" - }, - { - "SwigDirector_Plugin_networkLinkDestructedCallback", "(Lorg/simgrid/surf/Plugin;J)V" - }, - { - "SwigDirector_Plugin_networkLinkStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" - }, - { - "SwigDirector_Plugin_networkActionStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" - }, - { - "SwigDirector_Plugin_networkCommunicateCallback", "(Lorg/simgrid/surf/Plugin;JJJDD)V" - }, - { - "SwigDirector_CpuModel_shareResources", "(Lorg/simgrid/surf/CpuModel;D)D" - }, - { - "SwigDirector_CpuModel_shareResourcesLazy", "(Lorg/simgrid/surf/CpuModel;D)D" - }, - { - "SwigDirector_CpuModel_shareResourcesFull", "(Lorg/simgrid/surf/CpuModel;D)D" - }, - { - "SwigDirector_CpuModel_updateActionsState", "(Lorg/simgrid/surf/CpuModel;DD)V" - }, - { - "SwigDirector_CpuModel_updateActionsStateLazy", "(Lorg/simgrid/surf/CpuModel;DD)V" - }, - { - "SwigDirector_CpuModel_updateActionsStateFull", "(Lorg/simgrid/surf/CpuModel;DD)V" - }, - { - "SwigDirector_CpuModel_getRunningActionSet", "(Lorg/simgrid/surf/CpuModel;)J" - }, - { - "SwigDirector_CpuModel_addTraces", "(Lorg/simgrid/surf/CpuModel;)V" - }, - { - "SwigDirector_CpuModel_createCpu", "(Lorg/simgrid/surf/CpuModel;Ljava/lang/String;[DIDJIIJ)J" - }, - { - "SwigDirector_Cpu_isUsed", "(Lorg/simgrid/surf/Cpu;)Z" - }, - { - "SwigDirector_Cpu_getState", "(Lorg/simgrid/surf/Cpu;)I" - }, - { - "SwigDirector_Cpu_updateState", "(Lorg/simgrid/surf/Cpu;JDD)V" - }, - { - "SwigDirector_Cpu_getCurrentPowerPeak", "(Lorg/simgrid/surf/Cpu;)D" - }, - { - "SwigDirector_Cpu_execute", "(Lorg/simgrid/surf/Cpu;D)J" - }, - { - "SwigDirector_Cpu_sleep", "(Lorg/simgrid/surf/Cpu;D)J" - }, - { - "SwigDirector_Cpu_getCore", "(Lorg/simgrid/surf/Cpu;)I" - }, - { - "SwigDirector_Cpu_getSpeed", "(Lorg/simgrid/surf/Cpu;D)D" - }, - { - "SwigDirector_Cpu_getAvailableSpeed", "(Lorg/simgrid/surf/Cpu;)D" - }, - { - "SwigDirector_Cpu_getPowerPeakAt", "(Lorg/simgrid/surf/Cpu;I)D" - }, - { - "SwigDirector_Cpu_getNbPstates", "(Lorg/simgrid/surf/Cpu;)I" - }, - { - "SwigDirector_Cpu_setPstate", "(Lorg/simgrid/surf/Cpu;I)V" - }, - { - "SwigDirector_Cpu_getPstate", "(Lorg/simgrid/surf/Cpu;)I" - }, - { - "SwigDirector_CpuAction_getRemains", "(Lorg/simgrid/surf/CpuAction;)D" - }, - { - "SwigDirector_CpuAction_setPriority", "(Lorg/simgrid/surf/CpuAction;D)V" - }, - { - "SwigDirector_CpuAction_setState", "(Lorg/simgrid/surf/CpuAction;I)V" - } - }; - Swig::jclass_SurfJNI = (jclass) jenv->NewGlobalRef(jcls); - if (!Swig::jclass_SurfJNI) return; - for (i = 0; i < (int) (sizeof(methods)/sizeof(methods[0])); ++i) { - Swig::director_methids[i] = jenv->GetStaticMethodID(jcls, methods[i].method, methods[i].signature); - if (!Swig::director_methids[i]) return; - } -} - - -#ifdef __cplusplus -} -#endif - diff --git a/src/bindings/java/org/simgrid/surf/surfJAVA_wrap.h b/src/bindings/java/org/simgrid/surf/surfJAVA_wrap.h deleted file mode 100644 index f7b1a1097d..0000000000 --- a/src/bindings/java/org/simgrid/surf/surfJAVA_wrap.h +++ /dev/null @@ -1,106 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * This file is not intended to be easily readable and contains a number of - * coding conventions designed to improve portability and efficiency. Do not make - * changes to this file unless you know what you are doing--modify the SWIG - * interface file instead. - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_Surf_WRAP_H_ -#define SWIG_Surf_WRAP_H_ - -class SwigDirector_Plugin : public Plugin, public Swig::Director { - -public: - void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); - SwigDirector_Plugin(JNIEnv *jenv); - virtual ~SwigDirector_Plugin(); - virtual void cpuCreatedCallback(simgrid::surf::Cpu *cpu); - virtual void cpuDestructedCallback(simgrid::surf::Cpu *cpu); - virtual void cpuStateChangedCallback(simgrid::surf::Cpu *cpu, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2); - virtual void cpuActionStateChangedCallback(simgrid::surf::CpuAction *action, e_surf_action_state_t arg1, e_surf_action_state_t arg2); - virtual void networkLinkCreatedCallback(simgrid::surf::Link *link); - virtual void networkLinkDestructedCallback(simgrid::surf::Link *link); - virtual void networkLinkStateChangedCallback(simgrid::surf::Link *link, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2); - virtual void networkActionStateChangedCallback(simgrid::surf::NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur); - virtual void networkCommunicateCallback(simgrid::surf::NetworkAction *action, simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst, double size, double rate); -public: - bool swig_overrides(int n) { - return (n < 9 ? swig_override[n] : false); - } -protected: - bool swig_override[9]; -}; - -class SwigDirector_CpuModel : public simgrid::surf::CpuModel, public Swig::Director { - -public: - void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); - SwigDirector_CpuModel(JNIEnv *jenv); - virtual double shareResources(double now); - virtual double shareResourcesLazy(double now); - virtual double shareResourcesFull(double now); - virtual void updateActionsState(double now, double delta); - virtual void updateActionsStateLazy(double now, double delta); - virtual void updateActionsStateFull(double now, double delta); - virtual simgrid::surf::ActionList *getRunningActionSet(); - virtual void addTraces(); - virtual ~SwigDirector_CpuModel(); - virtual simgrid::surf::Cpu *createCpu(char const *name, DoubleDynar power_peak, int pstate, double power_scale, tmgr_trace *power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace *state_trace); -public: - bool swig_overrides(int n) { - return (n < 9 ? swig_override[n] : false); - } -protected: - bool swig_override[9]; -}; - -class SwigDirector_Cpu : public simgrid::surf::Cpu, public Swig::Director { - -public: - void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); - SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, lmm_constraint *constraint, int core, double powerPeak, double powerScale); - SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, int core, double powerPeak, double powerScale); - virtual bool isUsed(); - virtual e_surf_resource_state_t getState(); - virtual void updateState(tmgr_trace_event *event_type, double value, double date); - virtual ~SwigDirector_Cpu(); - virtual double getCurrentPowerPeak(); - virtual simgrid::surf::CpuAction *execute(double size); - virtual simgrid::surf::CpuAction *sleep(double duration); - virtual int getCore(); - virtual double getSpeed(double load); - virtual double getAvailableSpeed(); - virtual double getPowerPeakAt(int pstate_index); - virtual int getNbPstates(); - virtual void setPstate(int pstate_index); - virtual int getPstate(); -public: - bool swig_overrides(int n) { - return (n < 13 ? swig_override[n] : false); - } -protected: - bool swig_override[13]; -}; - -class SwigDirector_CpuAction : public simgrid::surf::CpuAction, public Swig::Director { - -public: - void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); - SwigDirector_CpuAction(JNIEnv *jenv, simgrid::surf::Model *model, double cost, bool failed); - virtual ~SwigDirector_CpuAction(); - virtual double getRemains(); - virtual void setPriority(double priority); - virtual void setState(e_surf_action_state_t state); -public: - bool swig_overrides(int n) { - return (n < 3 ? swig_override[n] : false); - } -protected: - bool swig_override[3]; -}; - - -#endif diff --git a/src/bindings/java/surf.i b/src/bindings/java/surf.i deleted file mode 100644 index 3b78ab2728..0000000000 --- a/src/bindings/java/surf.i +++ /dev/null @@ -1,423 +0,0 @@ -/* Copyright (c) 2014. 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. */ - -/* File : example.i */ -%module(directors="1") Surf - -%include "arrays_java.i" -%include "std_string.i" -%include "surfdoc.i" - -%pragma(java) jniclassimports=%{ -import org.simgrid.NativeLib; -%} -%pragma(java) jniclasscode=%{ - static { - org.simgrid.NativeLib.nativeInit(); - Runtime.getRuntime().addShutdownHook( - new Thread() { - public void run() { - Thread.currentThread().setName( "Destroyer" ); - Surf.clean(); - } - } - ); - } -%} - -%{ -#include "src/surf/surf_interface.hpp" -#include "src/surf/cpu_interface.hpp" -#include "src/surf/network_interface.hpp" -#include "src/surf/trace_mgr_private.h" -#include "src/bindings/java/surf_swig.hpp" -#include "src/xbt/dict_private.h" - -typedef struct lmm_constraint *lmm_constraint_t; -typedef xbt_dynar_t DoubleDynar; -%} - -%wrapper %{ -#ifdef __cplusplus -extern "C" { -#endif - -JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_getAction(JNIEnv *env, jclass cls, jlong jarg1) { - simgrid::surf::Action * action = (simgrid::surf::Action *)jarg1; - jobject res; - simgrid::surf::CpuAction *cpu_action = - dynamic_cast(action); - if (cpu_action) { - SwigDirector_CpuAction *dir_cpu_action = - dynamic_cast(cpu_action); - if (dir_cpu_action) { - res = dir_cpu_action->swig_get_self(env);\ - } else { - jclass clss = env->FindClass("org/simgrid/surf/CpuAction");\ - jmethodID constru = env->GetMethodID(clss, "", "()V");\ - res = env->NewObject(clss, constru);\ - res = env->NewGlobalRef(res);\ - } - } else { - jclass clss = env->FindClass("org/simgrid/surf/Action");\ - jmethodID constru = env->GetMethodID(clss, "", "()V");\ - res = env->NewObject(clss, constru);\ - res = env->NewGlobalRef(res);\ - } - return res; -} - -#define GETDIRECTOR(NAME) \ -JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_get## NAME ## Director(JNIEnv *env, jclass cls, jlong jarg1)\ -{\ - simgrid::surf::NAME * arg1 = (simgrid::surf::NAME*)jarg1;\ - SwigDirector_ ##NAME *director = dynamic_cast(arg1);\ - jobject res;\ - if (director) {\ - res = director->swig_get_self(env);\ - } else {\ - jclass clss = env->FindClass("org/simgrid/surf/NAME");\ - jmethodID constru = env->GetMethodID(clss, "", "()V");\ - res = env->NewObject(clss, constru);\ - res = env->NewGlobalRef(res);\ - }\ - return res;\ -} - -GETDIRECTOR(CpuModel) -GETDIRECTOR(Cpu) -GETDIRECTOR(CpuAction) - -#ifdef __cplusplus -} -#endif - -%} - -%typemap(freearg) char* name { -} - -/* Handle xbt_dynar_t of Link */ -JAVA_ARRAYSOFCLASSES(Action); -%apply Action[] {ActionArrayPtr}; -%typemap(jstype) ActionArrayPtr "Action[]" -%typemap(javain) ActionArrayPtr "Action.cArrayUnwrap($javainput)" -%typemap(javaout) ActionArrayPtr { - long[] cArray = $jnicall; - Action[] arrayWrapper = new Action[cArray.length]; - for (int i=0; ibegin()), itend($1->end()); it != itend ; ++it) { - l++; - } - $result = jenv->NewLongArray(l); - jlong *elts = jenv->GetLongArrayElements($result, NULL); - l = 0; - for(simgrid::surf::ActionList::iterator it($1->begin()), itend($1->end()); it != itend ; ++it) { - elts[l++] = (jlong)static_cast(&*it); - } - jenv->ReleaseLongArrayElements($result, elts, 0); -} - -namespace simgrid { -namespace surf { - -class ActionList { -public: - //void push_front(Action &action); - //void push_back(Action &action); -%extend { - ActionArrayPtr getArray(){ - return $self; - } -} -}; - -} -} - -/* Handle xbt_dynar_t of Link */ -JAVA_ARRAYSOFCLASSES(simgrid::surf::Link); -%apply simgrid::surf::Link[] {LinkDynar}; -%typemap(jstype) LinkDynar "Link[]" -%typemap(javain) LinkDynar "Link.cArrayUnwrap($javainput)" -%typemap(javaout) LinkDynar { - return Link.cArrayWrap($jnicall, $owner); -} -%typemap(out) LinkDynar { - long l = xbt_dynar_length($1); - $result = jenv->NewLongArray(l); - unsigned i; - Link *link; - jlong *elts = jenv->GetLongArrayElements($result, NULL); - xbt_dynar_foreach($1, i, link) { - elts[i] = (jlong)link; - } - jenv->ReleaseLongArrayElements($result, elts, 0); - xbt_dynar_free(&$1); -} - -%nodefault DoubleDynar; -%typemap(jni) DoubleDynar "jdoubleArray" -%rename(DoubleDynar) Double[]; -%typemap(jtype) DoubleDynar "double[]" -%typemap(jstype) DoubleDynar "double[]" -%typemap(out) DoubleDynar { - long l = xbt_dynar_length($1); - $result = jenv->NewDoubleArray(l); - double *lout = (double *) xbt_dynar_get_ptr($1, 0); - jenv->SetDoubleArrayRegion($result, 0, l, (jdouble*)lout); -} -%typemap(javadirectorin) DoubleDynar "$jniinput" -%typemap(directorin,descriptor="[D") DoubleDynar %{ - long l = xbt_dynar_length($1); - $input = jenv->NewDoubleArray(l); - double *lout = (double *) xbt_dynar_get_ptr($1, 0); - jenv->SetDoubleArrayRegion($input, 0, l, (jdouble*)lout); -%} -%typemap(javain) DoubleDynar "$javainput" -%typemap(javaout) DoubleDynar {return $jnicall} - -/* Allow to subclass Plugin and send java object to C++ code */ -%feature("director") Plugin; - -%native(getAction) jobject getAction(jlong jarg1); -%native(getCpuModelDirector) jobject getCpuModelDirector(jlong jarg1); -%typemap(javaout) CpuModel * { - long cPtr = $jnicall; - return (CpuModel)Surf.getCpuModelDirector(cPtr); -} -%native(getCpuDirector) jobject getCpuDirector(jlong jarg1); -%typemap(javaout) Cpu * { - long cPtr = $jnicall; - return (Cpu)Surf.getCpuDirector(cPtr); -} -%native(getCpuActionDirector) jobject getCpuActionDirector(jlong jarg1); -%typemap(javaout) CpuAction * { - long cPtr = $jnicall; - return (CpuAction)Surf.getCpuDirector(cPtr); -} - -%include "src/bindings/java/surf_swig.hpp" - -namespace simgrid { -namespace surf { - -class Model; -class CpuModel; -class HostModel; -class VMModel; -class NetworkModel; -class StorageModel; -class Resource; -class ResourceLmm; -class Host; -class HostCLM03; -class NetworkCm02Link; -class Action; -class ActionLmm; -class StorageActionLmm; -class As; -class RoutingPlatf; - -} -} - -%rename tmgr_trace TmgrTrace; -%nodefaultctor tmgr_trace; -struct tmgr_trace { - //enum e_trace_type type; - /*union { - struct { - xbt_dynar_t event_list; - } s_list; - struct { - probabilist_event_generator_t event_generator[2]; - int is_state_trace; - int next_event; - } s_probabilist; - };*/ - %extend { - } -}; - -%rename tmgr_trace_event TmgrTraceEvent; -%nodefaultctor tmgr_trace_event; -struct tmgr_trace_event { - //tmgr_trace_t trace; - //unsigned int idx; - //void *model; - //int free_me; - %extend { - unsigned int getIdx() {return 0;}//$self->idx;} - } -}; - -namespace simgrid { -namespace surf { - -%nodefaultctor Model; -class Model { -public: - Model(); - - virtual double shareResources(double now); - virtual double shareResourcesLazy(double now); - virtual double shareResourcesFull(double now); - - virtual void updateActionsState(double now, double delta); - virtual void updateActionsStateLazy(double now, double delta); - virtual void updateActionsStateFull(double now, double delta); - - virtual simgrid::surf::ActionList *getRunningActionSet(); - - virtual void addTraces()=0; -}; - -%feature("director") CpuModel; -class CpuModel : public Model { -public: - CpuModel(); - virtual ~CpuModel(); - virtual simgrid::surf::Cpu *createCpu(const char *name, - DoubleDynar power_peak, - int pstate, double power_scale, - tmgr_trace *power_trace, int core, - e_surf_resource_state_t state_initial, - tmgr_trace *state_trace)=0; -}; - -class Resource { -public: - Resource(); - const char *getName(); - virtual bool isUsed()=0; - simgrid::surf::Model *getModel(); - - virtual e_surf_resource_state_t getState(); - lmm_constraint *getConstraint(); - virtual void updateState(tmgr_trace_event *event_type, double value, double date)=0; -}; - -%feature("director") Cpu; -class Cpu : public Resource { -public: - Cpu(simgrid::surf::Model *model, const char *name, - lmm_constraint *constraint, int core, double powerPeak, double powerScale); - Cpu(simgrid::surf::Model *model, const char *name, - int core, double powerPeak, double powerScale); - virtual ~Cpu(); - virtual double getCurrentPowerPeak(); - virtual simgrid::surf::CpuAction *execute(double size)=0; - virtual simgrid::surf::CpuAction *sleep(double duration)=0; - virtual int getCore(); - virtual double getSpeed(double load); - virtual double getAvailableSpeed(); - virtual double getPowerPeakAt(int pstate_index)=0; - virtual int getNbPstates()=0; - virtual void setPstate(int pstate_index)=0; - virtual int getPstate()=0; - void setState(e_surf_resource_state_t state); -}; - -class Link : public simgrid::surf::Resource { -public: - Link(); - ~Link(); - double getBandwidth(); - void updateBandwidth(double value, double date=surf_get_clock()); - double getLatency(); - void updateLatency(double value, double date=surf_get_clock()); - s_xbt_dict *getProperties(); -}; - -%nodefaultctor Action; -class Action { -public: - Action(Model *model, double cost, bool failed); - virtual ~Action(); - Model *getModel(); - lmm_variable *getVariable(); - e_surf_action_state_t getState(); - bool isSuspended(); - double getBound(); - void setBound(double bound); - void updateRemains(double delta); - virtual double getRemains(); - virtual void setPriority(double priority); - virtual void setState(e_surf_action_state_t state); -}; - -%nodefaultctor CpuAction; -%feature("director") CpuAction; -class CpuAction : public Action { -public: -CpuAction(Model *model, double cost, bool failed); -%extend { - simgrid::surf::Cpu *getCpu() {return getActionCpu($self);} -} -}; - -%nodefaultctor NetworkAction; -class NetworkAction : public Action { -public: -%extend { - double getLatency() {return $self->m_latency;} -} -}; - - -%nodefaultctor RoutingEdge; -class RoutingEdge { -public: - virtual char *getName()=0; -}; - -} -} - -%rename lmm_constraint LmmConstraint; -struct lmm_constraint { -%extend { - double getUsage() {return lmm_constraint_get_usage($self);} -} -}; - -%rename lmm_variable LmmVariable; -struct lmm_variable { -%extend { - double getValue() {return lmm_variable_getvalue($self);} -} -}; - -%rename s_xbt_dict XbtDict; -struct s_xbt_dict { -%extend { - char *getValue(char *key) {return (char*)xbt_dict_get_or_null($self, key);} -} -}; - -%rename e_surf_action_state_t ActionState; -typedef enum { - SURF_ACTION_READY = 0, /**< Ready */ - SURF_ACTION_RUNNING, /**< Running */ - SURF_ACTION_FAILED, /**< Task Failure */ - SURF_ACTION_DONE, /**< Completed */ - SURF_ACTION_TO_FREE, /**< Action to free in next cleanup */ - SURF_ACTION_NOT_IN_THE_SYSTEM - /**< Not in the system anymore. Why did you ask ? */ -} e_surf_action_state_t; - -%rename e_surf_resource_state_t ResourceState; -typedef enum { - SURF_RESOURCE_ON = 1, /**< Up & ready */ - SURF_RESOURCE_OFF = 0 /**< Down & broken */ -} e_surf_resource_state_t; diff --git a/src/bindings/java/surf_swig.cpp b/src/bindings/java/surf_swig.cpp deleted file mode 100644 index 3bb9c26cf5..0000000000 --- a/src/bindings/java/surf_swig.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* Copyright (c) 2014-2015. 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. */ - -// Avoid ambiguity between boost and std placeholders -// (the std placeholders are imported through boost::signals2): -#ifndef BOOST_BIND_NO_PLACEHOLDERS - #define BOOST_BIND_NO_PLACEHOLDERS -#endif - -#include - -#include -#include "src/surf/surf_interface.hpp" -#include "surf_swig.hpp" -#include "src/simix/smx_private.h" - -using std::placeholders::_1; -using std::placeholders::_2; -using std::placeholders::_3; -using std::placeholders::_4; -using std::placeholders::_5; - -double getClock() { - return surf_get_clock(); -} - -void clean() { - SIMIX_clean(); -} - -simgrid::surf::CpuModel *getCpuModel(){ - return surf_cpu_model_pm; -} - -simgrid::surf::CpuModel *java_cpu_model; -static void java_cpu_model_init_preparse() { - surf_cpu_model_pm = java_cpu_model; - xbt_dynar_push(all_existing_models, &java_cpu_model); -} - -void setCpuModel(simgrid::surf::CpuModel *cpuModel){ - java_cpu_model = cpuModel; - surf_cpu_model_init_preparse = java_cpu_model_init_preparse; -} - -void setCpu(char *name, simgrid::surf::Cpu *cpu) { - // No-op here for compatibility with previous versions -} - -LinkDynar getRoute(char *srcName, char *dstName) { - simgrid::surf::RoutingEdge *src = sg_host_edge(sg_host_by_name(srcName)); - simgrid::surf::RoutingEdge *dst = sg_host_edge(sg_host_by_name(dstName)); - xbt_assert(src,"Cannot get the route from a NULL source"); - xbt_assert(dst,"Cannot get the route to a NULL destination"); - xbt_dynar_t route = xbt_dynar_new(sizeof(simgrid::surf::RoutingEdge*), NULL); - routing_platf->getRouteAndLatency(src, dst, &route, NULL); - return route; -} - -void Plugin::activateCpuCreatedCallback() -{ - simgrid::surf::cpuCreatedCallbacks.connect( - std::bind(&Plugin::cpuCreatedCallback, this, _1)); -} - -void Plugin::activateCpuDestructedCallback() -{ - simgrid::surf::cpuDestructedCallbacks.connect( - std::bind(&Plugin::cpuDestructedCallback, this, _1)); -} - -void Plugin::activateCpuStateChangedCallback() -{ - simgrid::surf::cpuStateChangedCallbacks.connect( - std::bind(&Plugin::cpuStateChangedCallback, this, _1, _2, _3)); -} - -void Plugin::activateCpuActionStateChangedCallback() -{ - simgrid::surf::cpuActionStateChangedCallbacks.connect( - std::bind(&Plugin::cpuActionStateChangedCallback, this, _1, _2, _3)); -} - - -void Plugin::activateLinkCreatedCallback() -{ - simgrid::surf::networkLinkCreatedCallbacks.connect( - std::bind(&Plugin::networkLinkCreatedCallback, this, _1)); -} - -void Plugin::activateLinkDestructedCallback() -{ - simgrid::surf::networkLinkDestructedCallbacks.connect( - std::bind(&Plugin::networkLinkDestructedCallback, this, _1)); -} - -void Plugin::activateLinkStateChangedCallback() -{ - simgrid::surf::networkLinkStateChangedCallbacks.connect( - std::bind(&Plugin::networkLinkStateChangedCallback, this, _1, _2, _3)); -} - -void Plugin::activateNetworkActionStateChangedCallback() -{ - simgrid::surf::networkActionStateChangedCallbacks.connect( - std::bind(&Plugin::networkActionStateChangedCallback, this, _1, _2, _3)); -} - -void Plugin::activateNetworkCommunicateCallback() -{ - simgrid::surf::networkCommunicateCallbacks.connect( - std::bind(&Plugin::networkCommunicateCallback, this, _1, _2, _3, _4, _5)); -} - - - diff --git a/src/bindings/java/surf_swig.hpp b/src/bindings/java/surf_swig.hpp deleted file mode 100644 index 39f533ed33..0000000000 --- a/src/bindings/java/surf_swig.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2014-2015. 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. */ - -#include -#include -#include "src/surf/cpu_interface.hpp" -#include "src/surf/network_interface.hpp" -#include "src/surf/maxmin_private.hpp" - -typedef xbt_dynar_t LinkDynar; -typedef simgrid::surf::ActionList *ActionArrayPtr; - -double getClock(); - -void clean(); - -simgrid::surf::CpuModel *getCpuModel(); -void setCpuModel(simgrid::surf::CpuModel *cpuModel); - -void setCpu(char *name, simgrid::surf::Cpu *cpu); - -LinkDynar getRoute(char *srcName, char *dstName); - -class Plugin { -public: - virtual ~Plugin() { - std::cout << "Plugin::~Plugin()" << std:: endl; - } - - void activateCpuCreatedCallback(); - virtual void cpuCreatedCallback(simgrid::surf::Cpu *cpu) {} - - void activateCpuDestructedCallback(); - virtual void cpuDestructedCallback(simgrid::surf::Cpu *cpu) {} - - void activateCpuStateChangedCallback(); - virtual void cpuStateChangedCallback(simgrid::surf::Cpu *cpu, e_surf_resource_state_t, e_surf_resource_state_t) {} - - void activateCpuActionStateChangedCallback(); - virtual void cpuActionStateChangedCallback(simgrid::surf::CpuAction *action, e_surf_action_state_t, e_surf_action_state_t) {} - - - void activateLinkCreatedCallback(); - virtual void networkLinkCreatedCallback(simgrid::surf::Link *link) {} - - void activateLinkDestructedCallback(); - virtual void networkLinkDestructedCallback(simgrid::surf::Link *link) {} - - void activateLinkStateChangedCallback(); - virtual void networkLinkStateChangedCallback(simgrid::surf::Link *link, e_surf_resource_state_t, e_surf_resource_state_t) {} - - void activateNetworkActionStateChangedCallback(); - virtual void networkActionStateChangedCallback(simgrid::surf::NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur) {} - - void activateNetworkCommunicateCallback(); - virtual void networkCommunicateCallback(simgrid::surf::NetworkAction *action, simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst, double size, double rate) {} -}; diff --git a/src/bindings/java/surfdoc.i b/src/bindings/java/surfdoc.i deleted file mode 100644 index 02a6c89f46..0000000000 --- a/src/bindings/java/surfdoc.i +++ /dev/null @@ -1,437 +0,0 @@ - -%javamethodmodifiers getClock() " - /** - * @return The current simulated time - */ - public"; - -%typemap(javaimports) Model " -/** - * A component (e.g., Cpu, Network, Storage, ...) is composed of three classes: - *
    - *
  • Model: It handle the interactions between resoucses and actions
  • - *
  • Resource: A resource used by the model (e.g., a cpu, a network link)
  • - *
  • Action: An action generated by the resources (e.g., execution, communication)
  • - *
- * @see Resource - * @see Action - */" - -%javamethodmodifiers Model::Model(const char *name) " - /** - * Model constructor - * @param name The name of the model - */ - public"; - -%javamethodmodifiers Model::getName() " - /** - * @return The name of the model - */ - public"; - -%javamethodmodifiers Model::shareResources(double now) " - /** - * Share the resources between the actions - * @param now the current time - * @return the date of the next action of the model will finish - */ - public"; - -%javamethodmodifiers Model::updateActionsState(double now, double delta) " - /** - * Update time of actions and eventually their states - * @param now the new current time - * @param delta the delta between previous and new current time - */ - public"; - - %javamethodmodifiers Model::getRunningActionSet() " - /** - * Get the List of running Actions - */ - public"; - - -%typemap(javaimports) CpuModel " -/** - * The generic model for the Cpu component - * @see Cpu - * @see CpuAction - */" - -%javamethodmodifiers CpuModel::CpuModel(const char *name) " - /** - * CpuModel constructon - * @param name The name of the cpumodel - */ - public"; - - -%javamethodmodifiers CpuModel::createCpu(const char *name, DoubleDynar power_peak, - int pstate, double power_scale, - tmgr_trace *power_trace, int core, - e_surf_resource_state_t state_initial, - tmgr_trace *state_trace, - s_xbt_dict *cpu_properties) " - /** - * Create a new Cpu - * - * @param name - * @param power_peak - * @param pstate - * @param power_scale - * @param power_trace - * @param core - * @param state_initial - * @param state_trace - * @param cpu_properties - * @return The new Cpu - * @see Cpu - */ - public"; - - -%typemap(javaimports) Resource " -/** - * A resource used by a model (e.g., a cpu, a network link) - * @see Model - * @see Action - */" - -%javamethodmodifiers Resource::getName() " - /** - * @return The name of the resource - */ - public"; - -%javamethodmodifiers Resource::isUsed() " - /** - * @return True if the Resource is used - */ - public"; - -%javamethodmodifiers Resource::getModel() " - /** - * @return The model associated to this Resource - */ - public"; - -%javamethodmodifiers Resource::getState() " - /** - * @return The state of the resource - * @see ResourceState - */ - public"; - -%javamethodmodifiers Resource::getConstraint() " - /** - * @return The constraint associatied (if using LMM) - */ - public"; - -%javamethodmodifiers Resource::getProperties() " - /** - * @return The XbtDict of properties associated to this Resource - */ - public"; - -%javamethodmodifiers Resource::updateState(tmgr_trace_event *event_type, double value, double date) " - /** - * Update the state of the Resource - * @param event_type - * @param value - * @param date - */ - public"; - - -%typemap(javaimports) Cpu " -/** - * A generic resource for the cpu component - * @see CpuModel - * @see CpuAction - */" - -%javamethodmodifiers Cpu::Cpu(Model *model, const char *name, s_xbt_dict *props, - lmm_constraint *constraint, int core, double powerPeak, double powerScale) " - /** - * A cpu constructor (using LMM) - * @param model - * @param name - * @param props - * @param constraint - * @param core - * @param powerPeak - * @param powerScale - */ - public"; - -%javamethodmodifiers Cpu::Cpu(Model *model, const char *name, s_xbt_dict *props, - int core, double powerPeak, double powerScale) " - /** - * A cpu constructor - * @param model - * @param name - * @param props - * @param core - * @param powerPeak - * @param powerScale - */ - public"; - -%javamethodmodifiers Cpu::getCurrentPowerPeak() " - /** - * @return The current power peak - */ - public"; - -%javamethodmodifiers Cpu::execute(double size) " - /** - * Execute some quantity of computation - * @param size The processing amount (in flop) needed to process - * @return A cpu action representing code execution - */ - public"; - -%javamethodmodifiers Cpu::sleep(double duration) " - /** - * Make a process sleep for duration - * @param duration The number of seconds to sleep - * @return A cpu action representing sleeping - */ - public"; - -%javamethodmodifiers Cpu::getCore() " - /** - * @return The number of cores on the cpu - */ - public"; - -%javamethodmodifiers Cpu::getSpeed(double load) " - /** - * TODO - * @param load - */ - public"; - -%javamethodmodifiers Cpu::getAvailableSpeed() " - /** - * TODO - */ - public"; - -%javamethodmodifiers Cpu::getPowerPeakAt(int pstate_index) " - /** - * @param pstate_index index of power peak to get - * @return Power peak at index - */ - public"; - - %javamethodmodifiers Cpu::getNbPstates() " - /** - * @return Number of power peak - */ - public"; - -%javamethodmodifiers Cpu::setPowerPeakAt(int pstate_index) " - /** - * @param pstate_index index of power peak to set - */ - public"; - -%javamethodmodifiers Cpu::setState(e_surf_resource_state_t state) " - /** - * @param state The new state of the cpu - */ - public"; - - -%typemap(javaimports) Link " -/** - * A generic resource for the network component - */" - - %javamethodmodifiers Link::getBandwidth() " - /** - * @return The bandwidth of the link - */ - public"; - -%javamethodmodifiers Link::updateBandwidth(double value, double date=surf_get_clock()) " - /** - * @param value The new bandwidth - */ - public"; - - %javamethodmodifiers Link::getLatency() " - /** - * @return The latency of the link - */ - public"; - -%javamethodmodifiers Link::updateLatency(double value, double date=surf_get_clock()) " - /** - * @param value The new latency - */ - public"; - - -%typemap(javaimports) Action " -/** - * An action created by a Resource (e.g., a communication, an execution) - * @see Model - * @see Resource - */" - -%javamethodmodifiers Action::Action(Model *model, double cost, bool failed) " - /** - * Action constructor - * @param model The model associated - * @param cost The cost of the action (e.g., flops, bytes) - * @param failed If the action has failed - */ - public"; - -%javamethodmodifiers Action::getModel() " - /** - * @return The model associated - */ - public"; - -%javamethodmodifiers Action::getVariable() " - /** - * @return The variable associatied (if using LMM) - */ - public"; - -%javamethodmodifiers Action::getState() " - /** - * @return The state of the action - */ - public"; - -%javamethodmodifiers Action::isSuspended() " - /** - * @return True if suspended - */ - public"; - -%javamethodmodifiers Action::getBound() " - /** - * @return TODO - */ - public"; - -%javamethodmodifiers Action::setBound(double bound) " - /** - * @param bound TODO - */ - public"; - -%javamethodmodifiers Action::updateRemains(double delta) " - /** - * Update remaining amount of cost to do - * @param delta Difference of time since last call to this function - */ - public"; - -%javamethodmodifiers Action::getRemains() " - /** - * @return The remaining amount of cost to do - */ - public"; - -%javamethodmodifiers Action::setPriority(double priority) " - /** - * @param priority The new priority of the action - */ - public"; - -%javamethodmodifiers Action::setState(e_surf_action_state_t state) " - /** - * @param state The new state - */ - public"; - - -%typemap(javaimports) CpuAction " -/** - * An cpu action created by a Cpu - * @see CpuModel - * @see Cpu - */" - -%javamethodmodifiers CpuAction::CpuAction(Model *model, double cost, bool failed) " - /** - * CpuAction constructor - * @param model The model associated - * @param cost The cost of the action (e.g., flops, bytes) - * @param failed If the action has failed - */ - public"; - -%javamethodmodifiers CpuAction::getCpu() " - /** - * @return The associated cpu - */ - public"; - - -%typemap(javaimports) NetworkAction " -/** - * An network action created by network model - * @see Link - */" - -%javamethodmodifiers NetworkAction::getLatency() " - /** - * @return The latency of the action - */ - public"; - - -%typemap(javaimports) LmmConstraint " -/** - * An linear maxmin generic constraint - */" - -%javamethodmodifiers LmmConstraint::getUsage() " - /** - * - */ - public"; - -%typemap(javaimports) LmmVariable " -/** - * An linear maxmin generic variable - */" - -%javamethodmodifiers LmmVariable::getValue() " - /** - * - */ - public"; - -%typemap(javaimports) XbtDict " -/** - * A c structure handling key:values - */" - -%javamethodmodifiers XbtDict::getValue(char *key) " - /** - * - */ - public"; - - -%typemap(javaimports) ActionState " -/** - * The possible states of an Action - */" - - -%typemap(javaimports) ResourceState " -/** - * The possible states of a Resource - */" diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 5533efe81a..ae4f8713da 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -461,42 +461,6 @@ set(BINDINGS_SRC src/bindings/lua/simgrid_lua.h ) -set(JSURF_SWIG_SRC - src/bindings/java/surf.i -) - -set(JSURF_SWIG_SRC_EXTRA - src/bindings/java/surfdoc.i -) - -set(JSURF_JAVA_C_SRC - src/bindings/java/surf_swig.cpp - src/bindings/java/surf_swig.hpp -) - -set(JSURF_JAVA_GENERATED_SRC - src/bindings/java/org/simgrid/surf/Action.java - src/bindings/java/org/simgrid/surf/ActionList.java - src/bindings/java/org/simgrid/surf/ActionState.java - src/bindings/java/org/simgrid/surf/Cpu.java - src/bindings/java/org/simgrid/surf/CpuAction.java - src/bindings/java/org/simgrid/surf/CpuModel.java - src/bindings/java/org/simgrid/surf/LmmConstraint.java - src/bindings/java/org/simgrid/surf/LmmVariable.java - src/bindings/java/org/simgrid/surf/Model.java - src/bindings/java/org/simgrid/surf/NetworkAction.java - src/bindings/java/org/simgrid/surf/Link.java - src/bindings/java/org/simgrid/surf/Plugin.java - src/bindings/java/org/simgrid/surf/Resource.java - src/bindings/java/org/simgrid/surf/ResourceState.java - src/bindings/java/org/simgrid/surf/RoutingEdge.java - src/bindings/java/org/simgrid/surf/Surf.java - src/bindings/java/org/simgrid/surf/SurfJNI.java - src/bindings/java/org/simgrid/surf/TmgrTrace.java - src/bindings/java/org/simgrid/surf/TmgrTraceEvent.java - src/bindings/java/org/simgrid/surf/XbtDict.java -) - set(JMSG_C_SRC src/bindings/java/jmsg.cpp src/bindings/java/jmsg.h @@ -526,12 +490,6 @@ set(JMSG_C_SRC src/bindings/java/jmsg_storage.h ) -set(JSURF_C_SRC - src/bindings/java/org/simgrid/surf/surfJAVA_wrap.cxx - src/bindings/java/org/simgrid/surf/surfJAVA_wrap.h - ${JSURF_JAVA_C_SRC} -) - set(JMSG_JAVA_SRC src/bindings/java/org/simgrid/NativeLib.java src/bindings/java/org/simgrid/msg/As.java @@ -557,7 +515,6 @@ set(JMSG_JAVA_SRC src/bindings/java/org/simgrid/msg/TimeoutException.java src/bindings/java/org/simgrid/msg/TransferFailureException.java src/bindings/java/org/simgrid/msg/VM.java - ${JSURF_JAVA_GENERATED_SRC} ) set(JTRACE_C_SRC diff --git a/tools/cmake/Java.cmake b/tools/cmake/Java.cmake index c3ef8f782c..2642a5752a 100644 --- a/tools/cmake/Java.cmake +++ b/tools/cmake/Java.cmake @@ -14,15 +14,14 @@ find_package(JNI REQUIRED) message("-- [Java] JNI found: ${JNI_FOUND}") message("-- [Java] JNI include dirs: ${JNI_INCLUDE_DIRS}") -find_package(SWIG) -if(${SWIG_FOUND}) - include(UseSWIG) - message("-- [Java] Swig found: version ${SWIG_VERSION}") -else() - message("-- [Java] Swig NOT FOUND. Surf java bindings won't get refreshed. That's fine unless you work on this part yourself.") -endif() -mark_as_advanced(SWIG_EXECUTABLE) - +# find_package(SWIG) +# if(${SWIG_FOUND}) +# include(UseSWIG) +# message("-- [Java] Swig found: version ${SWIG_VERSION}") +# else() +# message("-- [Java] Swig NOT FOUND. That's fine unless you work on this part yourself.") +# endif() +#mark_as_advanced(SWIG_EXECUTABLE) # Rules to build libsimgrid-java # @@ -65,8 +64,6 @@ set(LIBSIMGRID_SO libsimgrid${CMAKE_SHARED_LIBRARY_SUFFIX}) set(LIBSIMGRID_JAVA_SO ${CMAKE_SHARED_LIBRARY_PREFIX}simgrid-java${CMAKE_SHARED_LIBRARY_SUFFIX}) -set(LIBSURF_JAVA_SO - ${CMAKE_SHARED_LIBRARY_PREFIX}surf-java${CMAKE_SHARED_LIBRARY_SUFFIX}) ## Here is how to build simgrid.jar ## @@ -91,7 +88,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E echo "Specification-Version: \\\"${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}.${SIMGRID_VERSION_PATCH}\\\"" >> ${MANIFEST_FILE} COMMAND ${CMAKE_COMMAND} -E echo "Implementation-Version: \\\"${GIT_VERSION}\\\"" >> ${MANIFEST_FILE} - COMMAND ${Java_JAVADOC_EXECUTABLE} -quiet -d doc/javadoc -sourcepath ${CMAKE_HOME_DIRECTORY}/src/bindings/java/ org.simgrid.msg org.simgrid.surf org.simgrid.trace + COMMAND ${Java_JAVADOC_EXECUTABLE} -quiet -d doc/javadoc -sourcepath ${CMAKE_HOME_DIRECTORY}/src/bindings/java/ org.simgrid.msg org.simgrid.trace COMMAND ${JAVA_ARCHIVE} -uvmf ${MANIFEST_FILE} ${SIMGRID_JAR} doc/javadoc -C ${CMAKE_HOME_DIRECTORY} COPYING ChangeLog ChangeLog.SimGrid-java LICENSE-LGPL-2.1 NEWS ) @@ -133,19 +130,16 @@ if(enable_lib_in_jar) DEPENDS simgrid-java ${CMAKE_BINARY_DIR}/lib/${LIBSIMGRID_SO} ${CMAKE_BINARY_DIR}/lib/${LIBSIMGRID_JAVA_SO} - ${CMAKE_BINARY_DIR}/lib/${LIBSURF_JAVA_SO} COMMAND ${CMAKE_COMMAND} -E remove_directory NATIVE COMMAND ${CMAKE_COMMAND} -E make_directory ${JAVA_NATIVE_PATH} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/lib/${LIBSIMGRID_SO} ${JAVA_NATIVE_PATH} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/lib/${LIBSIMGRID_JAVA_SO} ${JAVA_NATIVE_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/lib/${LIBSURF_JAVA_SO} ${JAVA_NATIVE_PATH} ## strip seems to fail on Mac on binaries that are already stripped. ## It then spits: "symbols referenced by indirect symbol table entries that can't be stripped" #COMMAND ${STRIP_COMMAND} ${JAVA_NATIVE_PATH}/${LIBSIMGRID_SO} || true #COMMAND ${STRIP_COMMAND} ${JAVA_NATIVE_PATH}/${LIBSIMGRID_JAVA_SO} || true - #COMMAND ${STRIP_COMMAND} ${JAVA_NATIVE_PATH}/${LIBSURF_JAVA_SO} || true COMMAND ${JAVA_ARCHIVE} -uvf ${SIMGRID_JAR} NATIVE @@ -184,22 +178,6 @@ endif(enable_lib_in_jar) include_directories(${JNI_INCLUDE_DIRS} ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2}) -if(${SWIG_FOUND}) - set(CMAKE_SWIG_FLAGS "-package" "org.simgrid.surf") - set(CMAKE_SWIG_OUTDIR "${CMAKE_HOME_DIRECTORY}/src/bindings/java/org/simgrid/surf") - - set_source_files_properties(${JSURF_SWIG_SRC} PROPERTIES CPLUSPLUS 1) - - swig_add_module(surf-java java ${JSURF_SWIG_SRC} ${JSURF_JAVA_C_SRC}) - swig_link_libraries(surf-java simgrid) -else() - add_library(surf-java SHARED ${JSURF_C_SRC}) - target_link_libraries(surf-java simgrid) -endif() - -set_target_properties(surf-java PROPERTIES SKIP_BUILD_RPATH ON) set_target_properties(simgrid-java PROPERTIES SKIP_BUILD_RPATH ON) -add_dependencies(simgrid-java surf-java) -add_dependencies(simgrid-java_jar surf-java) diff --git a/tools/cmake/MakeExe.cmake b/tools/cmake/MakeExe.cmake index d92e41db2a..19b83953bb 100644 --- a/tools/cmake/MakeExe.cmake +++ b/tools/cmake/MakeExe.cmake @@ -18,10 +18,7 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/migration) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/mutualExclusion) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/pingPong) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/priority) -add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/reservationSurfPlugin) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/startKillTime) -add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/surfCpuModel) -add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/surfPlugin) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/suspend) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/tracing) diff --git a/tools/cmake/Tests.cmake b/tools/cmake/Tests.cmake index 4adee594e1..ecfed3a51d 100644 --- a/tools/cmake/Tests.cmake +++ b/tools/cmake/Tests.cmake @@ -529,9 +529,6 @@ IF(NOT enable_memcheck) ADD_TESH(java-pingPong --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/pingPong/pingpong.tesh) ADD_TESH(java-priority --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/priority/priority.tesh) ADD_TESH(java-startKillTime --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/startKillTime/startKillTime.tesh) - ADD_TESH(java-surf-cpu-model --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/surfCpuModel/surf_cpu_model.tesh) - ADD_TESH(java-surf-plugin --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/surfPlugin/surf_plugin.tesh) - ADD_TESH(java-surf-plugin-reservation --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/reservationSurfPlugin/reservation_surf_plugin.tesh) ADD_TESH(java-suspend --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/suspend/suspend.tesh) ADD_TESH(java-tracing --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/tracing/tracingPingPong.tesh)