- Substitute the old SchedulableQueue with the new ReadyQueue

- Add interfaces for Process and Thread into the "sgpem.i" SWIG
interface file, change DynamicSchedulable into Schedulable
- Add dynamic_cast for the return value of ReadyQueue::get_item_at()
into the pyloader "sgpem.i" SWIG interface, so that a Schedulable
can be either recognized as a Thread or a Process
- TODO: wrap STL exceptions in SWIG interface
- Please note that code won't compile until the new History and
Scheduler::step_forward() will be in place. This is a known issue.


git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@689 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-07-02 13:51:03 +00:00
parent fa06e2f4f1
commit 759b90b017
24 changed files with 170 additions and 414 deletions

View file

@ -27,7 +27,7 @@
#include "backend/history.hh"
#include "backend/static_schedulable.hh"
#include "backend/schedulable_queue.hh"
#include "backend/ready_queue.hh"
#include "backend/dynamic_schedulable.hh"
#include "backend/slice.hh"
#include "backend/static_process.hh"
@ -123,7 +123,7 @@ main(int argc, char* argv[])
DynamicSchedulable ss5(p5);
DynamicSchedulable ss6(p6);
SchedulableQueue initial;
ReadyQueue initial;
initial.add_at_bottom(ss1);
initial.add_at_bottom(ss2);
initial.add_at_bottom(ss3);
@ -155,17 +155,17 @@ main(int argc, char* argv[])
// ************** TEST HISTORY
SchedulableQueue l1;
ReadyQueue l1;
l1.add_at_top(ss1); l1.add_at_top(ss2); l1.add_at_top(ss3);
SchedulableQueue l2;
ReadyQueue l2;
l2.add_at_top(ss4); l2.add_at_top(ss5); l2.add_at_top(ss6);
History h(History::get_instance());
h.enqueue_slice(l1); //stato iniziale
h.enqueue_slice(l2);
smart_ptr<const sgpem::SchedulableQueue> quale;
smart_ptr<const sgpem::ReadyQueue> quale;
quale = h.get_simulation_status_at(0); //stato iniziale
@ -202,7 +202,7 @@ main(int argc, char* argv[])
//************** TEST QUEUE
/* cout << "\n\nTEST QUEUE\n";
SchedulableQueue sq;
ReadyQueue sq;
sq.add_at_bottom(ss1);
sq.add_at_bottom(ss2);
sq.add_at_bottom(ss3);