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

Method HandleDestroyAgent

Core/KernelSML/src/sml_KernelSMLHandlers.cpp:410–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410bool KernelSML::HandleDestroyAgent(AgentSML* pAgentSML, char const* /*pCommandName*/, Connection* /*pConnection*/, AnalyzeXML* /*pIncoming*/, soarxml::ElementXML* /*pResponse*/)
411{
412 if (!pAgentSML)
413 {
414 return false ;
415 }
416
417 FireAgentEvent(pAgentSML, smlEVENT_BEFORE_AGENT_DESTROYED);
418
419 // Close log
420 if (m_CommandLineInterface.IsLogOpen())
421 {
422 m_CommandLineInterface.DoCommand(0, pAgentSML, "clog --close", false, true, 0) ;
423 }
424
425 // Release any wmes or other objects we're keeping
426 pAgentSML->DeleteSelf() ;
427 pAgentSML = NULL ; // At this point the pointer is invalid so clear it.
428
429 return true ;
430}
431
432// Shutdown is an irrevocal request to delete all agents and prepare for kernel deletion.
433bool KernelSML::HandleShutdown(AgentSML* /*pAgentSML*/, char const* /*pCommandName*/, Connection* /*pConnection*/, AnalyzeXML* /*pIncoming*/, soarxml::ElementXML* /*pResponse*/)

Callers

nothing calls this directly

Calls 4

FireAgentEventFunction · 0.85
IsLogOpenMethod · 0.80
DoCommandMethod · 0.80
DeleteSelfMethod · 0.80

Tested by

no test coverage detected