TimedEventsManager is now a singleton
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
#include <utils/timed_events.hpp>
|
||||
|
||||
TimedEventsManager& TimedEventsManager::instance()
|
||||
{
|
||||
static TimedEventsManager inst;
|
||||
return inst;
|
||||
}
|
||||
|
||||
TimedEventsManager::TimedEventsManager()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user