--- /dev/null
+#include "sistemaautonomo.h"\r
+#include "slBrevePluginAPI.h"\r
+#include <iostream>\r
+\r
+/////////////////////////// CTeoria /////////////////////////\r
+\r
+double NoOp(CEntorno&) { return 0.0; } // FIXME (hack horrible porque no puedo usar ptr a fun)\r
+\r
+// pointer{Teoria} TeoriaNew(string, int, int, int)\r
+int SAbrTeoriaNew(brEval args[], brEval* result, void* data)\r
+{\r
+ result->set(new CTeoria(\r
+ BRSTRING(args),\r
+ NoOp, // FIXME (no hay puntero a funcion, poner BRINT(args+1))\r
+ BRINT(args+2),\r
+ BRINT(args+3)));\r
+ return EC_OK;\r
+}\r
+\r
+// void TeoriaAddDatoInicial(pointer{Teoria}, string, double)\r
+int SAbrTeoriaAddDatoInicial(brEval args[], brEval* result, void* data)\r
+{\r
+ CTeoria* t = (CTeoria*) BRPOINTER(args);\r
+ t->datos_iniciales.add(BRSTRING(args+1), BRINT(args+2));\r
+ return EC_OK;\r
+}\r
+\r
+// void TeoriaAddDatoFinal(pointer{Teoria}, string, double)\r
+int SAbrTeoriaAddDatoFinal(brEval args[], brEval* result, void* data)\r
+{\r
+ CTeoria* t = (CTeoria*) BRPOINTER(args);\r
+ t->datos_finales.add(BRSTRING(args+1), BRINT(args+2));\r
+ return EC_OK;\r
+}\r
+\r
+// void TeoriaDelete(pointer{Teoria})\r
+int SAbrTeoriaDelete(brEval args[], brEval* result, void* data)\r
+{\r
+ delete (CTeoria*) BRPOINTER(args);\r
+ return EC_OK;\r
+}\r
+\r
+\r
+/////////////////////////// CSistemaAutonomo /////////////////////////\r
+\r
+// pointer{SistemaAutonomo} SistemaAutonomoNew()\r
+int SAbrSistemaAutonomoNew(brEval args[], brEval* result, void* data)\r
+{\r
+ result->set(new CSistemaAutonomo());\r
+ return EC_OK;\r
+}\r
+\r
+// void SistemaAutonomoAddTeoria(pointer{SistemaAutonomo}, pointer{Teoria})\r
+int SAbrSistemaAutonomoAddTeoria(brEval args[], brEval* result, void* data)\r
+{\r
+ CSistemaAutonomo* sa = (CSistemaAutonomo*) BRPOINTER(args);\r
+ CTeoria* t = (CTeoria*) BRPOINTER(args+1);\r
+ sa->teorias.add(t->nombre.c_str(), *t);\r
+ return EC_OK;\r
+}\r
+\r
+// void SistemaAutonomoDelete(pointer{SistemaAutonomo})\r
+int SAbrSistemaAutonomoDelete(brEval args[], brEval* result, void* data)\r
+{\r
+ delete (CSistemaAutonomo*) BRPOINTER(args);\r
+ return EC_OK;\r
+}\r
+\r
+\r
+DLLEXPORT void SAbrFunctions(void *data)\r
+{\r
+ brNewBreveCall(data, "TeoriaNew", SAbrTeoriaNew,\r
+ AT_POINTER, AT_STRING, AT_INT, AT_INT, AT_INT, 0);\r
+ brNewBreveCall(data, "TeoriaAddDatoInicial", SAbrTeoriaAddDatoInicial,\r
+ AT_NULL, AT_POINTER, AT_STRING, AT_DOUBLE, 0);\r
+ brNewBreveCall(data, "TeoriaAddDatoFinal", SAbrTeoriaAddDatoFinal,\r
+ AT_NULL, AT_POINTER, AT_STRING, AT_DOUBLE, 0);\r
+ brNewBreveCall(data, "TeoriaDelete", SAbrTeoriaDelete,\r
+ AT_NULL, AT_POINTER, 0);\r
+ brNewBreveCall(data, "SistemaAutonomoNew", SAbrSistemaAutonomoNew,\r
+ AT_POINTER, 0);\r
+ brNewBreveCall(data, "SistemaAutonomoAddTeoria", SAbrSistemaAutonomoAddTeoria,\r
+ AT_NULL, AT_POINTER, AT_POINTER, 0);\r
+ brNewBreveCall(data, "SistemaAutonomoDelete", SAbrSistemaAutonomoDelete,\r
+ AT_NULL, AT_POINTER, 0);\r
+}\r
+\r