* @brief Unregister for a particular event * @returns True if succeeds *************************************************************/
| 2292 | * @returns True if succeeds |
| 2293 | *************************************************************/ |
| 2294 | bool Kernel::UnregisterForStringEvent(int callbackID) |
| 2295 | { |
| 2296 | // Build a test object for the callbackID we're interested in |
| 2297 | TestStringCallback test(callbackID) ; |
| 2298 | |
| 2299 | // Find the event ID for this callbackID |
| 2300 | smlStringEventId id = m_StringEventMap.findFirstKeyByTest(&test, smlSTRING_EVENT_BAD) ; |
| 2301 | |
| 2302 | if (id == smlSTRING_EVENT_BAD) |
| 2303 | { |
| 2304 | return false ; |
| 2305 | } |
| 2306 | |
| 2307 | // Remove the handler from our map |
| 2308 | m_StringEventMap.removeAllByTest(&test) ; |
| 2309 | |
| 2310 | // If we just removed the last handler, then unregister from the kernel for this event |
| 2311 | if (m_StringEventMap.getListSize(id) == 0) |
| 2312 | { |
| 2313 | UnregisterForEventWithKernel(id, NULL) ; |
| 2314 | } |
| 2315 | |
| 2316 | return true ; |
| 2317 | } |
| 2318 | |
| 2319 | /************************************************************* |
| 2320 | * @brief Unregister for a particular event |