Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove XBT_INFO call
[simgrid.git] / src / bindings / java / surf_swig.cpp
index 6da728c..32f557f 100644 (file)
@@ -1,9 +1,33 @@
 #include <boost/lambda/bind.hpp>
 #include "src/surf/surf_interface.hpp"
 #include "surf_swig.hpp"
+#include "src/simix/smx_private.h"
+
 
 double getClock() {
-  surf_get_clock();
+  return surf_get_clock();
+}
+
+void clean() {
+  SIMIX_clean();
+}
+
+/*NetworkModel *getNetworkModel()
+{
+  return surf_network_model;
+}*/
+
+NetworkLinkDynar getRoute(char *srcName, char *dstName) {
+  RoutingEdge *src = (RoutingEdge*)xbt_lib_get_or_null(host_lib, srcName, ROUTING_HOST_LEVEL);
+  RoutingEdge *dst = (RoutingEdge*)xbt_lib_get_or_null(host_lib, dstName, ROUTING_HOST_LEVEL);
+  if (src==NULL)
+    xbt_die("TOTO");
+  if (dst==NULL)
+    xbt_die("TOTO");
+  printf("src: %s\ndst: %s\n", src->getName(), dst->getName());
+  xbt_dynar_t route = xbt_dynar_new(sizeof(RoutingEdgePtr), NULL);
+  routing_platf->getRouteAndLatency(src, dst, &route, NULL);
+  return route;
 }
 
 void Plugin::activateCpuCreatedCallback(){