-changing SchedulableList to SchedulableQueue: intermediate commit,

so SVN can let me use "mv"

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@602 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-06-03 14:40:19 +00:00
parent 16acaf51d9
commit 4508ed017b
16 changed files with 70 additions and 70 deletions

View file

@ -45,7 +45,7 @@ using namespace std;
class HistoryTester
{
public:
HistoryTester(SchedulableList sl)
HistoryTester(SchedulableQueue sl)
: _history_length(-1), _internal_schedulable_list(sl)
{}
@ -82,9 +82,9 @@ public:
private:
int _history_length; // mirrors the correct length of the history
SchedulableList* _get_simulation_status_at[400]; // mirrors the correct content of the history
SchedulableQueue* _get_simulation_status_at[400]; // mirrors the correct content of the history
SchedulableStatus* _get_scheduled_at[400]; // mirrors the correct content of the history
SchedulableList _internal_schedulable_list;
SchedulableQueue _internal_schedulable_list;
// looks for anomalies
@ -113,13 +113,13 @@ public:
}
// saves the given SchedulableList into the history, and saves a copy of it into an array
void _insert(sgpem::SchedulableList& status)
// saves the given SchedulableQueue into the history, and saves a copy of it into an array
void _insert(sgpem::SchedulableQueue& status)
{
History::get_instance().enqueue_slice(status);
_history_length = _history_length + 1;
_get_simulation_status_at[_history_length] = new SchedulableList(status);
_get_simulation_status_at[_history_length] = new SchedulableQueue(status);
if (History::get_instance().get_scheduled_at(_history_length) != memory::smart_ptr<SchedulableStatus>(NULL))
_get_scheduled_at[_history_length] = new SchedulableStatus(*(status.top()));
@ -129,8 +129,8 @@ public:
}
// modifies the given SchedulableList object in an arbitrary way.
void _randomize(sgpem::SchedulableList& status)
// modifies the given SchedulableQueue object in an arbitrary way.
void _randomize(sgpem::SchedulableQueue& status)
{
status.swap(9, 10);
status.swap(1, 16);
@ -232,7 +232,7 @@ main(int argc, char** argv)
SchedulableStatus ss18(p18);
SchedulableStatus ss19(p19); // not used!
SchedulableList initial;
SchedulableQueue initial;
initial.add_at_bottom(ss1);
initial.add_at_bottom(ss2);
initial.add_at_bottom(ss3);

View file

@ -56,7 +56,7 @@ namespace sgpem
std::cout << "get_scheduled_at" << time;
return History::get_scheduled_at(time);
}
memory::smart_ptr<sgpem::SchedulableList> get_simulation_status_at(int time) const
memory::smart_ptr<sgpem::SchedulableQueue> get_simulation_status_at(int time) const
{
std::cout << "get_simulation_status_at" << time;
return History::get_simulation_status_at(time);
@ -66,7 +66,7 @@ namespace sgpem
std::cout << "getCurrentTime";
return History::get_current_time();
}
void enqueue_slice(const sgpem::SchedulableList& status)
void enqueue_slice(const sgpem::SchedulableQueue& status)
{
std::cout << "enqueue_slice";
History::enqueue_slice(status);

View file

@ -82,7 +82,7 @@ namespace sgpem
virtual void sort_queue(Scheduler::event event) const throw(UserInterruptException)
{ // here a lot of fun, exactly O(n^2) fun!
SchedulableList sl = History.get_instance().get_simulation_status_at(get_current_time());
SchedulableQueue sl = History.get_instance().get_simulation_status_at(get_current_time());
for (int i = 0; i < sl.size(); i++)
{
for (int j = 0; j < sl.size()-1; j++)
@ -186,9 +186,9 @@ namespace sgpem
public:
memory::smart_ptr<sgpem::SchedulableStatus> get_scheduled_at(int time) const {}
memory::smart_ptr<sgpem::SchedulableList> get_simulation_status_at(int time) const;
memory::smart_ptr<sgpem::SchedulableQueue> get_simulation_status_at(int time) const;
int get_current_time() const {return _total_time_elapsed;}
void enqueue_slice(const sgpem::SchedulableList& status);
void enqueue_slice(const sgpem::SchedulableQueue& status);
void truncate_at(int instant) {}
static History& get_instance();
private:
@ -272,7 +272,7 @@ main(int argc, char** argv) {
SchedulableStatus ss18(p18);
SchedulableStatus ss19(p19); // not used!
SchedulableList initial;
SchedulableQueue initial;
initial.add_at_bottom(ss1);
initial.add_at_bottom(ss2);
initial.add_at_bottom(ss3);