本文整理汇总了C++中typenamevector::addRef方法的典型用法代码示例。如果您正苦于以下问题:C++ typenamevector::addRef方法的具体用法?C++ typenamevector::addRef怎么用?C++ typenamevector::addRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类typenamevector
的用法示例。
在下文中一共展示了typenamevector::addRef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bulkLoading
void Node<D>:: bulkLoading(vector<Dados<D> > dados, int ordem){
typename vector<Dados<D> >::iterator atual = dados.begin();
Node<D> *novo = new Node<D>(ordem);
novo->folha = true;
Node<D> *first = novo;
Node<D> *aux;
for(typename vector<Dados<D> >::iterator it=dados.begin()+1; it!=dados.end(); ++it ){
if(*atual==*it){
atual->addRef( it->getOffsets().back() );
it->clearOffsets();
}else{
unsigned int a = atual-dados.begin();
novo->chaves.push_back(dados[a]);
atual = it ;
if(novo->chaves.size()>=(unsigned int)(ordem-1)/2){
aux = novo;
novo = new Node<D>(ordem);
novo->folha = true;
aux->prox = novo;
}
}
}
novo->prox = (Node<D>*)NULL;
aux->prox = (Node<D>*)NULL;
novo = first;
while(novo->prox != (Node<D>*)NULL ){
for(unsigned int i = 0; i<novo->chaves.size() && novo->folha; i++){
#ifdef DEBUG
cout<<novo->chaves[i]<<endl;
#endif
Node<D>::inserePai( novo, novo->prox);
novo = novo->prox;
}
}
// for( vector<Dados<D> >::iterator it=dados.begin(); it!=dados.end(); ++it )
// if(!it->getOffsets().empty())
// cout<<*it<<endl;
};