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

Method UnregisterForSystemEvent

Core/ClientSML/src/sml_ClientKernel.cpp:2265–2288  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2263* @brief Unregister for a particular event
2264*************************************************************/
2265bool Kernel::UnregisterForSystemEvent(int callbackID)
2266{
2267 // Build a test object for the callbackID we're interested in
2268 TestSystemCallback test(callbackID) ;
2269
2270 // Find the event ID for this callbackID
2271 smlSystemEventId id = m_SystemEventMap.findFirstKeyByTest(&test, smlSYSTEM_EVENT_BAD) ;
2272
2273 if (id == smlSYSTEM_EVENT_BAD)
2274 {
2275 return false ;
2276 }
2277
2278 // Remove the handler from our map
2279 m_SystemEventMap.removeAllByTest(&test) ;
2280
2281 // If we just removed the last handler, then unregister from the kernel for this event
2282 if (m_SystemEventMap.getListSize(id) == 0)
2283 {
2284 UnregisterForEventWithKernel(id, NULL) ;
2285 }
2286
2287 return true ;
2288}
2289
2290/*************************************************************
2291* @brief Unregister for a particular event

Calls 3

findFirstKeyByTestMethod · 0.45
removeAllByTestMethod · 0.45
getListSizeMethod · 0.45

Tested by 1

TestMethod · 0.76