#include "sistemaautonomo.h"\r
#include "slBrevePluginAPI.h"\r
+\r
+#ifdef DEBUG\r
#include <iostream>\r
+#endif // DEBUG\r
\r
/////////////////////////// CTeoria /////////////////////////\r
\r
// string TeoriaGetAccion(pointer{Teoria})\r
int SAbrTeoriaGetAccion(brEval args[], brEval* result, void* data)\r
{\r
- // TODO CTeoria* t = (CTeoria*) BRPOINTER(args);\r
- // TODO result->set(t->accion.c_str());\r
- result->set("avanzar"); // FIXME\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
+ CTeoria* t = (CTeoria*) BRPOINTER(args);\r
+ result->set(t->funcion.c_str());\r
return EC_OK;\r
}\r
\r
{\r
CSistemaAutonomo* sa = (CSistemaAutonomo*) BRPOINTER(args);\r
CTeoria* t = (CTeoria*) BRPOINTER(args+1);\r
- sa->teorias.add(t->nombre.c_str(), *t);\r
+ sa->teorias.add(t->nombre, t);\r
+#ifdef DEBUG\r
+ std::cout << "Agrega teoria " << t->nombre << ":\n";\r
+ std::cout << " .datos_iniciales:\n" << t->datos_iniciales << "\n";\r
+ std::cout << " .datos_finales:\n" << t->datos_finales << "\n";\r
+#endif // DEBUG\r
return EC_OK;\r
}\r
\r
AT_STRING, AT_POINTER, 0);\r
brNewBreveCall(data, "TeoriaGetAccion", SAbrTeoriaGetAccion,\r
AT_STRING, AT_POINTER, 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