/// Add a content node to this category. /// When force is true, we will always add the node into the category. /// It will remove the the node at first. bool ContentCategory::addContentNode(const cms_long node_id, bool force) { if (!force) { return addToContainer(child_content_, node_id); } else { removeContentNode(node_id); addToContainer(child_content_, node_id); return true; } }
/** * \brief 把TCP连接任务交给下一个任务队列,切换状态 * */ void zTCPClientTask::getNextState() { //Zebra::logger->debug("zTCPClientTask::getNextState"); ConnState old_state = getState(); lifeTime.now(); switch(old_state) { case close: setState(sync); break; case sync: addToContainer(); setState(okay); break; case okay: removeFromContainer(); setState(recycle); break; case recycle: if (terminate == TM_service_close) recycleConn(); setState(close); final(); break; }
/** * \brief 把TCP连接任务交给下一个任务队列,切换状态 * */ void zTCPTask::getNextState() { //Zebra::logger->debug("zTCPTask::getNextState()"); zTCPTask_State old_state = getState(); switch(old_state) { case notuse: setState(verify); break; case verify: setState(sync); break; case sync: buffered = true; addToContainer(); setState(okay); break; case okay: removeFromContainer(); setState(recycle); break; case recycle: setState(notuse); break; } Zebra::logger->debug("zTCPTask::getNextState(%s:%u),%s -> %s)",getIP(),getPort(),getStateString(old_state),getStateString(getState())); }
// Constructor UtlListIterator::UtlListIterator(const UtlList& list) : UtlIterator(list), mpCurrentNode(NULL) { OsLock container(const_cast<OsBSem&>(list.mContainerLock)); addToContainer(&list); }
// Constructor UtlHashMapIterator::UtlHashMapIterator(const UtlHashMap& mapSource) : UtlIterator(mapSource) { OsLock container(const_cast<OsBSem&>(mapSource.mContainerLock)); addToContainer(&mapSource); init(); }
/// Add parent category. bool ContentCategory::addParentCategory(const cms_long parent_id) { return addToContainer(parent_categories_, parent_id); }
/// Add sub category to this category. /// Caller should call add_parent_category as well. bool ContentCategory::addChildCategory(const cms_long child_id) { return addToContainer(child_categories_, child_id); }