namespace Msp::Game {
+EventBus::~EventBus()
+{
+ for(Dispatcher &d: dispatchers)
+ if(d.dispatcher)
+ d.deleter(d.dispatcher);
+}
+
unsigned EventBus::get_next_id()
{
static unsigned next_id = 0;
#include <functional>
#include <vector>
+#include <msp/core/noncopyable.h>
namespace Msp::Game {
};
-class EventBus
+class EventBus: public NonCopyable
{
private:
using DeleteFunc = void(void *);
std::vector<Dispatcher> dispatchers;
+public:
+ ~EventBus();
+
+private:
static unsigned get_next_id();
public: