- Make libpyloader a loadable plugin (warning: won't work

on Window$ unless you change the string "libpyloader" to
"pyloader" into main.cc)
- Fix Makefile to support module creation and loading
- 2DO: 
	- Add a class into backend to load and manage plugins
	- Install plugins into separate directory
	- Remove hardcoded paths


git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@458 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-02-25 12:21:30 +00:00
parent 38f7b84909
commit 56534edb6c
15 changed files with 187 additions and 215 deletions

View file

@ -39,8 +39,10 @@
#include "backend/dummy_policy.hh"
#include <glibmm/module.h>
#include <glibmm/ustring.h>
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
@ -60,6 +62,15 @@ main(int argc, char* argv[])
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
// FIXME: this will need to be moved to an
// appropriate PluginManager class in the backend,
// and the Makefile fixed accordingly
using Glib::Module;
std::string pyloader_path = Module::build_path(MODDIR, "pyloader");
Module pyloader(pyloader_path);
std::cerr << Module::get_last_error() << std::endl;
assert(pyloader);
// Set up Glib thread support
Glib::thread_init();
@ -75,15 +86,6 @@ main(int argc, char* argv[])
}
*/
// Set the unique POLICY
DummyPolicy pol;
pol.configure();
pol.get_parameters().set_int("var2", 33);
pol.get_parameters().set_float("multiplier", 100);
pol.get_parameters().set_string("che_ne_so", "ciao");
Scheduler::get_instance().set_policy(&pol);
// Create an INITIAL STATE
Process p1("P1", 0,5,1);
Process p2("P2", 0,5,2);
@ -107,6 +109,10 @@ main(int argc, char* argv[])
initial.add_at_bottom(ss5);
initial.add_at_bottom(ss6);
History::get_instance().enqueue_slice(initial);
Scheduler::get_instance(); // Forces initialization of scheduler.
// Cross fingers (depends if PythonPolicyManager
// static object has been initialized before?).
//the textual simulation
TextSimulation text_sim;
@ -125,7 +131,7 @@ main(int argc, char* argv[])
//************** TEST HISTORY
// ************** TEST HISTORY
SchedulableList l1;
l1.add_at_top(ss1); l1.add_at_top(ss2); l1.add_at_top(ss3);
@ -194,5 +200,6 @@ main(int argc, char* argv[])
cout << "\n\n";
*/
return 0;
return 0;
}