BOOL CFCView::GetKeyword(void) { int low=0,high=17,mid; int compare; while(low<=high) { mid=(low+high)/2; compare=strcmp(m_ident,keyword[mid]); if(compare==0) { m_element=ZElement(E_BREAK+mid); return TRUE; } if(compare<0) high=mid-1; else low=mid+1; } return FALSE; }
BOOL CFCView::GetLibraryFunction() { int low,high,mid; int compare; if(m_bIncludeMath) { low=0; high=17; while(low<=high) { mid=(low+high)/2; compare=strcmp(m_ident,MathFunction[mid]); if(compare==0) { m_element=ZElement(E_ABS+mid); return TRUE; } if(compare<0) high=mid-1; else low=mid+1; } } if(m_bIncludeString) { low=0; high=4; while(low<=high) { mid=(low+high)/2; compare=strcmp(m_ident,StringFunction[mid]); if(compare==0) { m_element=ZElement(E_STRCMP+mid); return TRUE; } if(compare<0) high=mid-1; else low=mid+1; } } if(m_bIncludeArray) { low=0; high=5; while(low<=high) { mid=(low+high)/2; compare=strcmp(m_ident,ArrayFunction[mid]); if(compare==0) { m_element=ZElement(E_AVERAGE+mid); return TRUE; } if(compare<0) high=mid-1; else low=mid+1; } } return FALSE; }
void BindTable::add(BindResponse && response ) { entries.push_back(std::make_tuple<ZElement, ClusterID, ZElement>(ZElement(response.srcAddr,response.srcEP), std::move(response.clusterId), ZElement(response.dstAddr,response.dstEP))); BOOST_LOG_TRIVIAL(info) << "new bind entry: " << response.srcAddr << ":" << response.srcEP << " ---> " << response.dstAddr << ":" << response.dstEP; }