MCPcopy Create free account
hub / github.com/SoarGroup/Soar / ReceivedUpdateEvent

Method ReceivedUpdateEvent

Core/ClientSML/src/sml_ClientKernel.cpp:544–569  ·  view source on GitHub ↗

* @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) *************************************************************/

Source from the content-addressed store, hash-verified

542* @param pResponse The reply (no real need to fill anything in here currently)
543*************************************************************/
544void 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

Callers

nothing calls this directly

Calls 5

endMethod · 0.80
smlRunFlagsEnum · 0.50
GetArgIntMethod · 0.45
getListMethod · 0.45
getUserDataMethod · 0.45

Tested by

no test coverage detected