TimedEventsManager is now a singleton

This commit is contained in:
Florent Le Coz
2014-05-30 15:51:43 +02:00
parent 5cca518c2d
commit 5c9d2c23ba
4 changed files with 32 additions and 30 deletions
+5 -1
View File
@@ -83,8 +83,11 @@ private:
class TimedEventsManager
{
public:
explicit TimedEventsManager();
~TimedEventsManager();
/**
* Return the unique instance of this class
*/
static TimedEventsManager& instance();
/**
* Add an event to the list of managed events. The list is sorted after
* this call.
@@ -117,6 +120,7 @@ public:
std::size_t size() const;
private:
explicit TimedEventsManager();
std::list<TimedEvent> events;
TimedEventsManager(const TimedEventsManager&) = delete;
TimedEventsManager(TimedEventsManager&&) = delete;
+6
View File
@@ -1,5 +1,11 @@
#include <utils/timed_events.hpp>
TimedEventsManager& TimedEventsManager::instance()
{
static TimedEventsManager inst;
return inst;
}
TimedEventsManager::TimedEventsManager()
{
}