- Fix compilation of test-history

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@515 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-03-09 11:37:09 +00:00
parent 92e6f3be2b
commit 0c2cba8bbe
6 changed files with 169 additions and 98 deletions

View file

@ -24,13 +24,13 @@ using namespace sgpem;
using namespace memory;
//History::instance; //static object
History History::_instance(10); //dummy parameter
History* History::_instance = 0;
/**
The constructor sets _total_time_elapsed to -1: this permits to insert the INITIAL STATUS
of the simulation which must begin at instant -1 and live for 1 instant.
*/
History::History(int) //private constructor. The parameter is discarded
History::History() //private constructor. The parameter is discarded
:_total_time_elapsed(-1)
{}
@ -38,7 +38,9 @@ History::History(int) //private constructor. The parameter is discarded
History&
History::get_instance()
{
return _instance;
if(!_instance)
_instance = new History();
return *_instance;
}

View file

@ -55,32 +55,32 @@ namespace sgpem
\param time The inquired time instant.
\return The Schedulable object running at the given time.
*/
memory::smart_ptr<sgpem::SchedulableStatus> get_scheduled_at(int time) const;
virtual memory::smart_ptr<sgpem::SchedulableStatus> get_scheduled_at(int time) const;
/**
Gets the status of simulation at the specified time.
\param time The inquired time instant.
\return The list of Schedulable status objects at the specified time.
*/
memory::smart_ptr<sgpem::SchedulableList> get_simulation_status_at(int time) const;
virtual memory::smart_ptr<sgpem::SchedulableList> get_simulation_status_at(int time) const;
/**
Gets the current time.
\return The current history time.
*/
int get_current_time() const;
virtual int get_current_time() const;
/**
Sets the status of simulation at the current time.
\param status The list of \ref Schedulable status objects at the current time.
*/
void enqueue_slice(const sgpem::SchedulableList& status);
virtual void enqueue_slice(const sgpem::SchedulableList& status);
/**
Remove all data in History following the specified time.
\param instant Desired cutting time.
*/
void truncate_at(int instant);
virtual void truncate_at(int instant);
/**
@ -89,9 +89,11 @@ namespace sgpem
*/
static History& get_instance();
protected:
History(); //private constructor. The parameter is discarded
static History* _instance;
private:
History(int); //private constructor. The parameter is discarded
static History _instance;
int _total_time_elapsed;
std::vector<sgpem::Slice> _slices;
};