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

Method UnregisterForAgentEvent

Core/ClientSML/src/sml_ClientKernel.cpp:2351–2374  ·  view source on GitHub ↗

* @brief Unregister for a particular event *************************************************************/

Source from the content-addressed store, hash-verified

2349* @brief Unregister for a particular event
2350*************************************************************/
2351bool Kernel::UnregisterForAgentEvent(int callbackID)
2352{
2353 // Build a test object for the callbackID we're interested in
2354 TestAgentCallback test(callbackID) ;
2355
2356 // Find the event ID for this callbackID
2357 smlAgentEventId id = m_AgentEventMap.findFirstKeyByTest(&test, smlAGENT_EVENT_BAD) ;
2358
2359 if (id == smlAGENT_EVENT_BAD)
2360 {
2361 return false ;
2362 }
2363
2364 // Remove the handler from our map
2365 m_AgentEventMap.removeAllByTest(&test) ;
2366
2367 // If we just removed the last handler, then unregister from the kernel for this event
2368 if (m_AgentEventMap.getListSize(id) == 0)
2369 {
2370 UnregisterForEventWithKernel(id, NULL) ;
2371 }
2372
2373 return true ;
2374}
2375
2376/*************************************************************
2377* @brief The smlEVENT_INTERRUPT_CHECK event fires every n-th

Calls 3

findFirstKeyByTestMethod · 0.45
removeAllByTestMethod · 0.45
getListSizeMethod · 0.45

Tested by 2

TestMethod · 0.76
createSoarMethod · 0.64