Пример #1
0
	/** 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;
	}
Пример #2
0
	/** 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;
	}