* @brief Unregister for a particular event *************************************************************/
| 2263 | * @brief Unregister for a particular event |
| 2264 | *************************************************************/ |
| 2265 | bool 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 |