- Add unified Singleton support

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@643 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-06-21 09:09:50 +00:00
parent 8ca3a61730
commit 383889a203
17 changed files with 193 additions and 136 deletions

View file

@ -32,6 +32,8 @@
#include "dynamic_schedulable.hh"
#include "../templates/smartp.hh"
#include "singleton.hh"
namespace sgpem
{
@ -47,8 +49,10 @@ namespace sgpem
*/
class History;
class SG_DLLEXPORT History : public ObservedSubject
class SG_DLLEXPORT History : public Singleton<History>, public ObservedSubject
{
friend class Singleton<History>;
public:
/**
Gets the \ref Schedulable object running at the specified time.
@ -82,16 +86,9 @@ namespace sgpem
*/
virtual void truncate_at(int instant);
/**
Gets the only instance of History.
\return The Singleton instance of this object.
*/
static History& get_instance();
protected:
History(); //private constructor. The parameter is discarded
static History* _instance;
History(); //private constructor.
private:
int _total_time_elapsed;