/** match **/ bool DispatcherManager::isMatch(const int64_t id){ std::lock_guard<LOCK_TYPE> guard(m_lock); const int64_t n =m_dispatcher_list->size(); for(int64_t i=0; i<n; ++i){ Dispatcher* dispatcher =static_cast< Dispatcher* >(m_dispatcher_list->get(i)); if(dispatcher->isMatch(id)){ return true; } } return false; }
/** private **/ Dispatcher* DispatcherManager::_match(const int64_t id){ std::lock_guard<LOCK_TYPE> guard(m_lock); const int64_t n =m_dispatcher_list->size(); for(int64_t i=0; i<n; ++i){ Dispatcher* dispatcher =static_cast< Dispatcher* >(m_dispatcher_list->get(i)); if(dispatcher->isMatch(id)){ dispatcher->retain(); return dispatcher; } } return 0; }