Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
EventHandler.cpp
Go to the documentation of this file.
1
2
3/*
4 Author : Tobias Stein
5 Date : 9th July, 2016
6 File : EventHandler.cpp
7
8 EventHandler class.
9
10 All Rights Reserved. (c) Copyright 2016.
11*/
12
13#include "Event/EventHandler.h"
14
15namespace ECS { namespace Event {
16
18 {
19 DEFINE_LOGGER("EventHandler");
20 LOG_INFO("Initialize EventHandler!","");
21
22 // allocate memory from global memory manager
24
25 this->m_EventStorage.reserve(1024);
26 }
27
29 {
30 for (EventHandler::EventDispatcherMap::iterator it = this->m_EventDispatcherMap.begin(); it != this->m_EventDispatcherMap.end(); ++it)
31 {
32 delete (*it).second;
33 (*it).second = nullptr;
34 }
35
36 this->m_EventDispatcherMap.clear();
37
38 // Release allocated memory
40
41 delete this->m_EventMemoryAllocator;
42 this->m_EventMemoryAllocator = nullptr;
43
44 LOG_INFO("Release EventHandler!","");
45 }
46
47}} // namespace ECS::Event
#define ECS_EVENT_MEMORY_BUFFER_SIZE
Definition: API.h:29
#define DEFINE_LOGGER(name)
Definition: LoggerMacro.h:18
#define LOG_INFO(format,...)
Definition: LoggerMacro.h:25
EventStorage m_EventStorage
Definition: EventHandler.h:48
Memory::Allocator::LinearAllocator EventMemoryAllocator
Definition: EventHandler.h:34
EventMemoryAllocator * m_EventMemoryAllocator
Definition: EventHandler.h:45
EventDispatcherMap m_EventDispatcherMap
Definition: EventHandler.h:42
const void * GetMemoryAddress0() const
Definition: IAllocator.h:80
void Free(void *pMem)
Definition: API.cpp:55
const void * Allocate(size_t memSize, const char *user=nullptr)
Definition: API.cpp:50