本文整理汇总了C++中IDList::isExistID方法的典型用法代码示例。如果您正苦于以下问题:C++ IDList::isExistID方法的具体用法?C++ IDList::isExistID怎么用?C++ IDList::isExistID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDList
的用法示例。
在下文中一共展示了IDList::isExistID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: retrieve
//retrieve candidate result set by the var_sig in the _query.
void VSTree::retrieve(SPARQLquery& _query)
{
Util::logging("IN retrieve");
//debug
// {
// VNode* temp_ptr = this->getLeafNodeByEntityID(473738);
// stringstream _ss;
//
// for (int i=0;i<temp_ptr->getChildNum();i++)
// if (temp_ptr->getChildEntry(i).getEntityId() == 473738)
// {
// _ss << "entity id=473738 entry sig:" << endl;
// _ss << "entity id=473738 leaf node line: " << temp_ptr->getFileLine() << endl;
// _ss << Signature::BitSet2str(temp_ptr->getChildEntry(i).getEntitySig().entityBitSet) << endl;
// break;
// }
//
// _ss << "leaf node sig:" << endl;
// _ss << Signature::BitSet2str(temp_ptr->getEntry().getEntitySig().entityBitSet) << endl;
//
// temp_ptr = temp_ptr->getFather(*(this->node_buffer));
// while (temp_ptr != NULL)
// {
// _ss << "line=" << temp_ptr->getFileLine() << endl;
// _ss << Signature::BitSet2str(temp_ptr->getEntry().getEntitySig().entityBitSet) << endl;
// temp_ptr = temp_ptr->getFather(*(this->node_buffer));
// }
// Util::logging(_ss.str());
// }
vector<BasicQuery*>& queryList = _query.getBasicQueryVec();
// enumerate each BasicQuery and retrieve their variables' mapping entity in the VSTree.
vector<BasicQuery*>::iterator iter=queryList.begin();
for(; iter != queryList.end(); iter++)
{
int varNum = (*iter)->getVarNum();
for (int i = 0; i < varNum; i++)
{
//debug
{
std::stringstream _ss;
_ss << "retrieve of var: " << i << endl;
Util::logging(_ss.str());
}
bool flag = (*iter)->isLiteralVariable(i);
const EntityBitSet& entityBitSet = (*iter)->getVarBitSet(i);
IDList* idListPtr = &( (*iter)->getCandidateList(i) );
this->retrieveEntity(entityBitSet, idListPtr);
#ifdef DEBUG_VSTREE
stringstream _ss;
_ss << "total num: " << this->entry_num << endl;
_ss << "candidate num: " << idListPtr->size() << endl;
_ss << endl;
_ss << "isExist 473738: " << (idListPtr->isExistID(473738)?"true":"false") <<endl;
_ss << "isExist 473472: " << (idListPtr->isExistID(473472)?"true":"false") <<endl;
_ss << "isExist 473473: " << (idListPtr->isExistID(473473)?"true":"false") <<endl;
Util::logging(_ss.str());
#endif
//the basic query should end if one non-literal var has no candidates
if(idListPtr->size() == 0 && !flag)
{
break;
}
}
}
Util::logging("OUT retrieve");
}