* @brief This function is called when an event is received * from the Soar kernel. * * @param pIncoming The event command * @param pResponse The reply (no real need to fill anything in here currently) *************************************************************/
| 542 | * @param pResponse The reply (no real need to fill anything in here currently) |
| 543 | *************************************************************/ |
| 544 | void Kernel::ReceivedUpdateEvent(smlUpdateEventId id, AnalyzeXML* pIncoming, ElementXML* /*pResponse*/) |
| 545 | { |
| 546 | // Retrieve the event arguments |
| 547 | smlRunFlags runFlags = smlRunFlags(pIncoming->GetArgInt(sml_Names::kParamValue, 0)) ; |
| 548 | |
| 549 | // Look up the handler(s) from the map |
| 550 | UpdateEventMap::ValueList* pHandlers = m_UpdateEventMap.getList(id) ; |
| 551 | |
| 552 | if (!pHandlers) |
| 553 | { |
| 554 | return ; |
| 555 | } |
| 556 | |
| 557 | // Go through the list of event handlers calling each in turn |
| 558 | for (UpdateEventMap::ValueListIter iter = pHandlers->begin() ; iter != pHandlers->end() ;) |
| 559 | { |
| 560 | UpdateEventHandlerPlusData handlerWithData = *iter ; |
| 561 | iter++ ; |
| 562 | |
| 563 | UpdateEventHandler handler = handlerWithData.m_Handler ; |
| 564 | void* pUserData = handlerWithData.getUserData() ; |
| 565 | |
| 566 | // Call the handler |
| 567 | handler(id, pUserData, this, runFlags) ; |
| 568 | } |
| 569 | } |
| 570 | |
| 571 | /************************************************************* |
| 572 | * @brief This function is called when an event is received |
nothing calls this directly
no test coverage detected