+/* 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
%typemap(out) NetworkLinkDynar {
long l = xbt_dynar_length($1);
$result = jenv->NewLongArray(l);
- NetworkLink **lout = (NetworkLink **)xbt_dynar_to_array($1);
- jenv->SetLongArrayRegion($result, 0, l, (const jlong*)lout);
- free(lout);
+ unsigned i;
+ NetworkLink *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);
}
/* Allow to subclass Plugin and send java object to C++ code */
public:
NetworkLink();
~NetworkLink();
+ double getBandwidth();
+ void updateBandwidth(double value, double date=surf_get_clock());
+ double getLatency();
+ void updateLatency(double value, double date=surf_get_clock());
};
+%nodefaultctor Action;
class Action {
public:
Model *getModel();
+ lmm_variable *getVariable();
+ double getBound();
+ void setBound(double bound);
};
+%nodefaultctor CpuAction;
class CpuAction : public Action {
public:
%extend {
}
};
+%nodefaultctor RoutingEdge;
+class RoutingEdge {
+public:
+ virtual char *getName()=0;
+};
+
%rename lmm_constraint LmmConstraint;
struct lmm_constraint {
%extend {
}
};
+%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 {