[4780] | 1 | /* |
---|
[4329] | 2 | orxonox - the future of 3D-vertical-scrollers |
---|
| 3 | |
---|
| 4 | Copyright (C) 2004 orx |
---|
| 5 | |
---|
| 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
| 10 | |
---|
| 11 | ### File Specific: |
---|
[4346] | 12 | main-programmer: Patrick Boenzli |
---|
[4780] | 13 | co-programmer: |
---|
[4329] | 14 | */ |
---|
| 15 | |
---|
[4346] | 16 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_EVENT |
---|
[4329] | 17 | |
---|
[4346] | 18 | #include "event_handler.h" |
---|
[4388] | 19 | |
---|
[4350] | 20 | #include "event_listener.h" |
---|
[4361] | 21 | #include "event.h" |
---|
[4388] | 22 | #include "key_mapper.h" |
---|
[4329] | 23 | |
---|
[4381] | 24 | #include "compiler.h" |
---|
| 25 | #include "debug.h" |
---|
[4873] | 26 | #include "class_list.h" |
---|
[4352] | 27 | |
---|
[7756] | 28 | #include <algorithm> |
---|
[4329] | 29 | |
---|
| 30 | /** |
---|
[7898] | 31 | * @brief standard constructor |
---|
| 32 | */ |
---|
[4780] | 33 | EventHandler::EventHandler () |
---|
[4329] | 34 | { |
---|
[5285] | 35 | this->setClassID(CL_EVENT_HANDLER, "EventHandler"); |
---|
| 36 | this->setName("EventHandler"); |
---|
| 37 | |
---|
[5236] | 38 | SDL_InitSubSystem(SDL_INIT_JOYSTICK); |
---|
| 39 | SDL_InitSubSystem(SDL_INIT_EVENTTHREAD); |
---|
[5371] | 40 | SDL_SetEventFilter(EventHandler::eventFilter); |
---|
[5236] | 41 | |
---|
[4350] | 42 | |
---|
[4355] | 43 | /* now initialize them all to zero */ |
---|
[7895] | 44 | for (unsigned int i = 0; i < ES_NUMBER; i++) |
---|
| 45 | this->bUNICODE[i] = false; |
---|
[5978] | 46 | this->grabEvents(false); |
---|
[5291] | 47 | |
---|
[4407] | 48 | this->state = ES_GAME; |
---|
[6802] | 49 | this->eventsGrabbed = false; |
---|
[4329] | 50 | } |
---|
| 51 | |
---|
[4407] | 52 | |
---|
[4329] | 53 | /** |
---|
[7898] | 54 | * @brief the singleton reference to this class |
---|
[4329] | 55 | */ |
---|
[4346] | 56 | EventHandler* EventHandler::singletonRef = NULL; |
---|
[4329] | 57 | |
---|
[4407] | 58 | |
---|
[4329] | 59 | /** |
---|
[7898] | 60 | * @brief standard deconstructor |
---|
| 61 | */ |
---|
[4780] | 62 | EventHandler::~EventHandler () |
---|
[4329] | 63 | { |
---|
[4817] | 64 | for(int i = 0; i < ES_NUMBER; ++i) |
---|
| 65 | { |
---|
[4866] | 66 | for(int j = 0; j < EV_NUMBER; ++j) |
---|
[4817] | 67 | { |
---|
[7756] | 68 | if(!this->listeners[i][j].empty()) |
---|
[4817] | 69 | { |
---|
[5285] | 70 | PRINTF(2)("forgot to unsubscribe an EventListener!\n");// %s!\n", this->listeners[i][j]->getName()); |
---|
[4817] | 71 | } |
---|
| 72 | } |
---|
| 73 | } |
---|
[5236] | 74 | SDL_QuitSubSystem(SDL_INIT_JOYSTICK); |
---|
| 75 | |
---|
[4866] | 76 | EventHandler::singletonRef = NULL; |
---|
[4352] | 77 | } |
---|
[4329] | 78 | |
---|
[4352] | 79 | |
---|
[4450] | 80 | /** |
---|
[7898] | 81 | * @brief initializes the event handler |
---|
[5285] | 82 | * |
---|
| 83 | * this has to be called before the use of the event handler |
---|
[4450] | 84 | */ |
---|
[7256] | 85 | void EventHandler::init() |
---|
[4407] | 86 | { |
---|
[7756] | 87 | this->keyMapper.loadKeyBindings(); |
---|
[4407] | 88 | } |
---|
| 89 | |
---|
[4450] | 90 | /** |
---|
[7895] | 91 | * @param state: to which the event handler shall change |
---|
| 92 | */ |
---|
| 93 | void EventHandler::setState(elState state) |
---|
| 94 | { |
---|
[7903] | 95 | if (state == this->state) |
---|
| 96 | return; |
---|
| 97 | |
---|
[7897] | 98 | /// When Changing the State, all the keys will be released. |
---|
| 99 | /// This is done by sending each eventListener, that still |
---|
| 100 | /// has an Event subscribed, a Release Event. |
---|
| 101 | int keyCount; |
---|
| 102 | Uint8 * pressedKeys = SDL_GetKeyState(&keyCount); |
---|
| 103 | for (unsigned int i = 0; i < SDLK_LAST; i++) |
---|
| 104 | { |
---|
| 105 | if (pressedKeys[i]) |
---|
| 106 | { |
---|
| 107 | Event ev; |
---|
| 108 | ev.bPressed = false; |
---|
| 109 | ev.type = i; |
---|
| 110 | if (unlikely(this->bUNICODE[this->state])) |
---|
| 111 | ev.x = i; |
---|
[7903] | 112 | this->dispachEvent(this->state, ev ); |
---|
[7897] | 113 | } |
---|
| 114 | } |
---|
| 115 | |
---|
[7903] | 116 | // switching to the new State. |
---|
| 117 | elState oldState = this->state; |
---|
[7895] | 118 | this->state = state; |
---|
[7903] | 119 | |
---|
| 120 | // in the End the Corresponding handler will be notified. |
---|
| 121 | Event stateSwitchEvent; |
---|
| 122 | stateSwitchEvent.type = EV_LEAVE_STATE; |
---|
| 123 | this->dispachEvent(oldState, stateSwitchEvent); |
---|
| 124 | |
---|
[7895] | 125 | SDL_EnableUNICODE(this->bUNICODE[state]); |
---|
| 126 | }; |
---|
| 127 | |
---|
| 128 | |
---|
| 129 | /** |
---|
[7898] | 130 | * @brief pushes the current State in the State-stack, and selects state |
---|
[5388] | 131 | * @param state the new State to set |
---|
| 132 | */ |
---|
| 133 | void EventHandler::pushState(elState state) |
---|
| 134 | { |
---|
[7164] | 135 | if (likely(state != ES_NULL && state != ES_ALL )) |
---|
[5388] | 136 | { |
---|
[7164] | 137 | this->stateStack.push(this->state); |
---|
[5388] | 138 | this->setState(state); |
---|
| 139 | } |
---|
| 140 | else |
---|
| 141 | { |
---|
| 142 | PRINTF(2)("unable to push State\n"); |
---|
| 143 | } |
---|
| 144 | } |
---|
| 145 | |
---|
| 146 | /** |
---|
[7898] | 147 | * @brief this removes the topmost stack-entry and select the underlying one |
---|
[5388] | 148 | * @returns the next stack-entry |
---|
| 149 | */ |
---|
| 150 | elState EventHandler::popState() |
---|
| 151 | { |
---|
[7166] | 152 | if (stateStack.empty()) |
---|
| 153 | return ES_NULL; |
---|
[7164] | 154 | elState state = (elState)stateStack.top(); |
---|
| 155 | this->stateStack.pop(); |
---|
[5388] | 156 | if (state == ES_NULL) |
---|
| 157 | { |
---|
| 158 | PRINTF(2)("No more states availiable. (unable to pop state)\n"); |
---|
| 159 | return ES_NULL; |
---|
| 160 | } |
---|
| 161 | else |
---|
| 162 | { |
---|
| 163 | this->setState(state); |
---|
| 164 | return state; |
---|
| 165 | } |
---|
| 166 | } |
---|
| 167 | |
---|
| 168 | |
---|
| 169 | /** |
---|
[7756] | 170 | * @brief subscribe to an event |
---|
[4836] | 171 | * @param el: the event listener that wants to subscribe itself, the listener that will be called when the evetn occures |
---|
| 172 | * @param state: for which the listener wants to receive events |
---|
| 173 | * @param eventType: the event type that wants to be listened for. |
---|
[4450] | 174 | |
---|
| 175 | This is one of the most important function of the EventHandler. If you would like to subscribe for more |
---|
| 176 | than one state, you have to subscribe for each state again. If you want to subscribe for all states, use |
---|
| 177 | state = ES_ALL, which will subscribe your listener for all states together. |
---|
[5291] | 178 | */ |
---|
[4405] | 179 | void EventHandler::subscribe(EventListener* el, elState state, int eventType) |
---|
[4354] | 180 | { |
---|
[4450] | 181 | PRINTF(4)("Subscribing event type: %i\n", eventType); |
---|
[4407] | 182 | if( state == ES_ALL ) |
---|
[6771] | 183 | { |
---|
| 184 | for(unsigned int i = 0; i < ES_NUMBER; i++) |
---|
[7756] | 185 | this->listeners[i][eventType].push_back(el); |
---|
[6771] | 186 | } |
---|
| 187 | else |
---|
[7756] | 188 | this->listeners[state][eventType].push_back(el); |
---|
[4354] | 189 | } |
---|
| 190 | |
---|
| 191 | |
---|
[4450] | 192 | /** |
---|
[7756] | 193 | * @brief unsubscribe from the EventHandler |
---|
[4836] | 194 | * @param state: the stat in which it has been subscribed |
---|
| 195 | * @param eventType: the event, that shall be unsubscribed |
---|
[7898] | 196 | * |
---|
| 197 | * if you want to unsubscribe an event listener from all subscribed events, just use the |
---|
| 198 | * unsubscribe(EventListener* el, elState state) function |
---|
| 199 | */ |
---|
[7868] | 200 | void EventHandler::unsubscribe(EventListener* el, elState state, int eventType) |
---|
[4355] | 201 | { |
---|
[4450] | 202 | PRINTF(4)("Unsubscribing event type nr: %i\n", eventType); |
---|
[5291] | 203 | if (state == ES_ALL) |
---|
| 204 | for (unsigned int i = 0; i < ES_NUMBER; i++) |
---|
[7868] | 205 | { |
---|
| 206 | std::vector<EventListener*>::iterator listener = |
---|
[7895] | 207 | std::find(this->listeners[i][eventType].begin(), |
---|
| 208 | this->listeners[i][eventType].end(), |
---|
| 209 | el); |
---|
[7868] | 210 | if (listener != this->listeners[i][eventType].end()) |
---|
| 211 | this->listeners[i][eventType].erase(listener); |
---|
| 212 | } |
---|
[5291] | 213 | else |
---|
[7868] | 214 | { |
---|
| 215 | std::vector<EventListener*>::iterator listener = |
---|
[7895] | 216 | std::find(this->listeners[state][eventType].begin(), |
---|
| 217 | this->listeners[state][eventType].end(), |
---|
| 218 | el); |
---|
[7868] | 219 | if (listener != this->listeners[state][eventType].end()) |
---|
| 220 | this->listeners[state][eventType].erase(listener); |
---|
| 221 | } |
---|
[4355] | 222 | } |
---|
[4354] | 223 | |
---|
[4450] | 224 | |
---|
| 225 | /** |
---|
[7868] | 226 | * @brief unsubscribe all events from a specific listener |
---|
[4836] | 227 | * @param el: the listener that wants to unsubscribe itself |
---|
| 228 | * @param state: the state in which the events shall be unsubscribed |
---|
[7868] | 229 | */ |
---|
[4450] | 230 | void EventHandler::unsubscribe(EventListener* el, elState state) |
---|
[4355] | 231 | { |
---|
[5291] | 232 | if( el == NULL || state >= ES_NUMBER) |
---|
[4816] | 233 | return; |
---|
[4364] | 234 | if( state == ES_ALL) |
---|
[6771] | 235 | { |
---|
| 236 | for(unsigned int i = 0; i < ES_NUMBER; i++) |
---|
[4355] | 237 | { |
---|
[6771] | 238 | for(unsigned int j = 0; j < EV_NUMBER; j++) |
---|
| 239 | { |
---|
[7756] | 240 | std::vector<EventListener*>::iterator deller = std::find (this->listeners[i][j].begin(), this->listeners[i][j].end(), el); |
---|
| 241 | if( deller != this->listeners[i][j].end()) |
---|
| 242 | this->listeners[i][j].erase(deller); |
---|
[6771] | 243 | } |
---|
[4364] | 244 | } |
---|
[6771] | 245 | } |
---|
[4364] | 246 | else |
---|
[6771] | 247 | { |
---|
| 248 | for(int j = 0; j < EV_NUMBER; j++) |
---|
[4364] | 249 | { |
---|
[7756] | 250 | std::vector<EventListener*>::iterator deller = std::find (this->listeners[state][j].begin(), this->listeners[state][j].end(), el); |
---|
| 251 | if( deller != this->listeners[state][j].end()) |
---|
| 252 | this->listeners[state][j].erase(deller); |
---|
[4355] | 253 | } |
---|
[6771] | 254 | } |
---|
[4355] | 255 | } |
---|
| 256 | |
---|
[7897] | 257 | /** |
---|
| 258 | * @brief returns true if at state and eventType there is something subscribed. |
---|
| 259 | * @param state the state to check in. |
---|
| 260 | * @param eventType the eventtype to check. |
---|
| 261 | * @returns true if a event is subscibed. |
---|
| 262 | */ |
---|
[7756] | 263 | bool EventHandler::isSubscribed(elState state, int eventType) |
---|
| 264 | { |
---|
| 265 | return(listeners[state][eventType].empty()) ? false : true; |
---|
| 266 | }; |
---|
[4450] | 267 | |
---|
[7756] | 268 | |
---|
| 269 | |
---|
[4450] | 270 | /** |
---|
[7898] | 271 | * @brief flush all registered events |
---|
[4836] | 272 | * @param state: a specific state |
---|
[4450] | 273 | */ |
---|
| 274 | void EventHandler::flush(elState state) |
---|
[4420] | 275 | { |
---|
| 276 | if( state == ES_ALL) |
---|
[6771] | 277 | { |
---|
| 278 | for(int i = 0; i < ES_NUMBER; ++i) |
---|
[4420] | 279 | { |
---|
[6771] | 280 | for(int j = 0; j < EV_NUMBER; ++j) |
---|
| 281 | { |
---|
[7756] | 282 | this->listeners[i][j].clear(); |
---|
[6771] | 283 | } |
---|
[4420] | 284 | } |
---|
[6771] | 285 | } |
---|
[4420] | 286 | else |
---|
[6771] | 287 | { |
---|
| 288 | for(int j = 0; j < EV_NUMBER; ++j) |
---|
[4420] | 289 | { |
---|
[7756] | 290 | this->listeners[state][j].clear(); |
---|
[4420] | 291 | } |
---|
[6771] | 292 | } |
---|
[4420] | 293 | } |
---|
[4355] | 294 | |
---|
| 295 | |
---|
[7897] | 296 | /** |
---|
| 297 | * @brief if the unicode characters should be recorded. |
---|
| 298 | * @param state the State in whitch to set the new Value. |
---|
| 299 | * @param enableUNICODE: enabled, or disabled. |
---|
| 300 | */ |
---|
[7895] | 301 | void EventHandler::withUNICODE(elState state, bool enableUNICODE) |
---|
[5786] | 302 | { |
---|
[7895] | 303 | this->bUNICODE[state] = enableUNICODE; |
---|
| 304 | if (this->state == state) |
---|
| 305 | SDL_EnableUNICODE(enableUNICODE); |
---|
[5786] | 306 | } |
---|
| 307 | |
---|
[7897] | 308 | /** |
---|
| 309 | * @brief grabs InputEvents. |
---|
| 310 | * @param grabEvents if the Events should be grabbed(true) or released(false) |
---|
| 311 | */ |
---|
[5978] | 312 | void EventHandler::grabEvents(bool grabEvents) |
---|
| 313 | { |
---|
[6054] | 314 | this->eventsGrabbed = grabEvents; |
---|
| 315 | if(!grabEvents) |
---|
[6990] | 316 | { |
---|
| 317 | SDL_ShowCursor(SDL_ENABLE); |
---|
[6054] | 318 | SDL_WM_GrabInput(SDL_GRAB_OFF); |
---|
[6990] | 319 | } |
---|
[6054] | 320 | else |
---|
[6990] | 321 | { |
---|
[6813] | 322 | SDL_WM_GrabInput(SDL_GRAB_ON); |
---|
[6990] | 323 | SDL_ShowCursor(SDL_DISABLE); |
---|
| 324 | } |
---|
[5978] | 325 | } |
---|
[5786] | 326 | |
---|
[7897] | 327 | |
---|
[4450] | 328 | /** |
---|
[7898] | 329 | * @brief core function of event handler: receives all events from SDL |
---|
[7895] | 330 | * |
---|
| 331 | * The event from the SDL framework are collected here and distributed to all listeners. |
---|
| 332 | */ |
---|
[7897] | 333 | void EventHandler::process() const |
---|
[4355] | 334 | { |
---|
| 335 | SDL_Event event; |
---|
[4361] | 336 | Event ev; |
---|
[4407] | 337 | EventListener* listener = NULL; |
---|
[4355] | 338 | while( SDL_PollEvent (&event)) |
---|
[6771] | 339 | { |
---|
| 340 | switch( event.type) |
---|
[4355] | 341 | { |
---|
[6771] | 342 | case SDL_KEYDOWN: |
---|
| 343 | ev.bPressed = true; |
---|
| 344 | ev.type = event.key.keysym.sym; |
---|
[7895] | 345 | if (unlikely(this->bUNICODE[this->state])) |
---|
[6771] | 346 | ev.x = event.key.keysym.unicode; |
---|
| 347 | break; |
---|
| 348 | case SDL_KEYUP: |
---|
| 349 | ev.bPressed = false; |
---|
| 350 | ev.type = event.key.keysym.sym; |
---|
[7895] | 351 | if (unlikely(this->bUNICODE[this->state])) |
---|
[6771] | 352 | ev.x = event.key.keysym.unicode; |
---|
| 353 | break; |
---|
| 354 | case SDL_MOUSEMOTION: |
---|
| 355 | ev.bPressed = false; |
---|
| 356 | ev.type = EV_MOUSE_MOTION; |
---|
| 357 | ev.x = event.motion.x; |
---|
| 358 | ev.y = event.motion.y; |
---|
| 359 | ev.xRel = event.motion.xrel; |
---|
| 360 | ev.yRel = event.motion.yrel; |
---|
| 361 | break; |
---|
| 362 | case SDL_MOUSEBUTTONUP: |
---|
| 363 | ev.bPressed = false; |
---|
| 364 | ev.type = event.button.button + SDLK_LAST; |
---|
| 365 | break; |
---|
| 366 | case SDL_MOUSEBUTTONDOWN: |
---|
| 367 | ev.bPressed = true; |
---|
| 368 | ev.type = event.button.button + SDLK_LAST; |
---|
| 369 | break; |
---|
| 370 | case SDL_JOYAXISMOTION: |
---|
| 371 | ev.bPressed = false; |
---|
| 372 | ev.type = EV_JOY_AXIS_MOTION; |
---|
| 373 | break; |
---|
| 374 | case SDL_JOYBALLMOTION: |
---|
| 375 | ev.bPressed = false; |
---|
| 376 | ev.type = EV_JOY_BALL_MOTION; |
---|
| 377 | break; |
---|
| 378 | case SDL_JOYHATMOTION: |
---|
| 379 | ev.bPressed = false; |
---|
| 380 | ev.type = EV_JOY_HAT_MOTION; |
---|
| 381 | break; |
---|
| 382 | case SDL_JOYBUTTONDOWN: |
---|
| 383 | ev.bPressed = true; |
---|
| 384 | ev.type = EV_JOY_BUTTON; |
---|
| 385 | break; |
---|
| 386 | case SDL_JOYBUTTONUP: |
---|
| 387 | ev.bPressed = true; |
---|
| 388 | ev.type = EV_JOY_BUTTON; |
---|
| 389 | break; |
---|
| 390 | case SDL_VIDEORESIZE: |
---|
| 391 | ev.resize = event.resize; |
---|
| 392 | ev.type = EV_VIDEO_RESIZE; |
---|
| 393 | break; |
---|
| 394 | case SDL_QUIT: |
---|
| 395 | ev.type = EV_MAIN_QUIT; |
---|
| 396 | break; |
---|
| 397 | default: |
---|
| 398 | ev.type = EV_UNKNOWN; |
---|
| 399 | break; |
---|
| 400 | } |
---|
[7903] | 401 | this->dispachEvent(this->state, ev); |
---|
[7897] | 402 | } |
---|
| 403 | } |
---|
[4362] | 404 | |
---|
[4780] | 405 | |
---|
[7897] | 406 | /** |
---|
| 407 | * @brief dispaches an Event. |
---|
| 408 | * @param event the Event to dispach. |
---|
| 409 | */ |
---|
[7903] | 410 | void EventHandler::dispachEvent(elState state, const Event& event) const |
---|
[7897] | 411 | { |
---|
| 412 | /* small debug routine: shows all events dispatched by the event handler */ |
---|
| 413 | PRINT(4)("\n==========================| EventHandler::process () |===\n"); |
---|
[7903] | 414 | PRINT(4)("= Got Event nr %i, for state %i\n", event.type, state); |
---|
[7897] | 415 | |
---|
| 416 | /// setting a temporary state in case of an EventListener's process changes the state. |
---|
[7903] | 417 | for (unsigned int i = 0; i < this->listeners[state][event.type].size(); i++) |
---|
[7897] | 418 | { |
---|
| 419 | PRINT(4)("= Event dispatcher msg: This event has been consumed\n"); |
---|
[7903] | 420 | PRINT(4)("= Got Event nr %i, for state %i %s::%s\n", event.type, state, this->listeners[state][event.type][i]->getClassName(), this->listeners[state][event.type][i]->getName()); |
---|
[7897] | 421 | PRINT(4)("=======================================================\n"); |
---|
[7903] | 422 | this->listeners[state][event.type][i]->process(event); |
---|
[6771] | 423 | } |
---|
[7897] | 424 | /* else |
---|
| 425 | { |
---|
| 426 | PRINT(4)("= Event dispatcher msg: This event has NOT been consumed\n"); |
---|
| 427 | PRINT(4)("=======================================================\n"); |
---|
| 428 | }*/ |
---|
[4355] | 429 | } |
---|
[4388] | 430 | |
---|
[7897] | 431 | |
---|
| 432 | |
---|
[7895] | 433 | /** |
---|
| 434 | * @brief An eventFilter. |
---|
| 435 | * @param event the Event to be filtered. |
---|
| 436 | * @returns 0 on filtered Event. 1 Otherwise. |
---|
| 437 | */ |
---|
[5237] | 438 | int EventHandler::eventFilter(const SDL_Event *event) |
---|
| 439 | { |
---|
[6802] | 440 | if (likely(EventHandler::getInstance()->eventsGrabbed)) |
---|
[5237] | 441 | { |
---|
[6802] | 442 | if (event->type == SDL_KEYDOWN && event->key.keysym.sym == SDLK_TAB && SDL_GetKeyState(NULL)[SDLK_LALT]) |
---|
| 443 | { |
---|
| 444 | PRINTF(3)("Not sending event to the WindowManager\n"); |
---|
| 445 | EventHandler::getInstance()->grabEvents(false); |
---|
| 446 | return 0; |
---|
| 447 | } |
---|
| 448 | } |
---|
| 449 | else |
---|
| 450 | { |
---|
| 451 | if (event->type == SDL_MOUSEBUTTONDOWN) |
---|
| 452 | { |
---|
| 453 | EventHandler::getInstance()->grabEvents( true); |
---|
| 454 | return 0; |
---|
| 455 | } |
---|
| 456 | } |
---|
[6054] | 457 | |
---|
[5237] | 458 | return 1; |
---|
| 459 | } |
---|
| 460 | |
---|
| 461 | /** |
---|
[7895] | 462 | * @brief outputs some nice information about the EventHandler |
---|
[5237] | 463 | */ |
---|
[4872] | 464 | void EventHandler::debug() const |
---|
| 465 | { |
---|
| 466 | PRINT(0)("===============================\n"); |
---|
| 467 | PRINT(0)(" EventHandle Debug Information \n"); |
---|
| 468 | PRINT(0)("===============================\n"); |
---|
| 469 | for(int i = 0; i < ES_NUMBER; ++i) |
---|
[7895] | 470 | { |
---|
[4872] | 471 | for(int j = 0; j < EV_NUMBER; ++j) |
---|
[7756] | 472 | for (unsigned int evl = 0; evl < this->listeners[i][j].size(); evl++) |
---|
| 473 | PRINT(0)("Event %d of State %d subscribed to %s (%p)\n", j, i, this->listeners[i][j][evl]->getName(), this->listeners[i][j][evl]); |
---|
[7895] | 474 | } |
---|
[4872] | 475 | PRINT(0)("============================EH=\n"); |
---|
| 476 | } |
---|