本文整理汇总了C++中IteratorPtr::getObj方法的典型用法代码示例。如果您正苦于以下问题:C++ IteratorPtr::getObj方法的具体用法?C++ IteratorPtr::getObj怎么用?C++ IteratorPtr::getObj使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IteratorPtr
的用法示例。
在下文中一共展示了IteratorPtr::getObj方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void SearchSpaceTimerEvaluatorImpl<T>::releaseResultIter(IteratorPtr<LookupResult<T> >& pFindResultIter) {
while(pFindResultIter != NullPtr && !pFindResultIter->isDone()) {
T element = pFindResultIter->getObj().m_resultElement;
pFindResultIter->next();
_destroy(element);
}
_destroy(pFindResultIter);
pFindResultIter = NullPtr;
}
示例2: getSortedResults
void getSortedResults(IteratorPtr<LookupResult<T> > pFindResultIter,
DistanceCalculatorPtr<T> pDistanceCaculator,
T pTarget,
ElementWithDistances<T>& sortedResults) {
pFindResultIter->toBegin();
//Traverse iterator to get element and push to results vector
while(!pFindResultIter->isDone()) {
#ifdef DENOISING
if(pFindResultIter->getObj().m_distanceToTarget >= NOISE_THRESOLD) {
sortedResults.push_back(pFindResultIter->getObj());
}
#endif
pFindResultIter->next();
}
//Wind-back the iterator for future purpose
pFindResultIter->toBegin();
}
示例3:
IteratorPtr<T> ComposerBasedElementApproximator<T>::getExtractedElementIterator(IteratorPtr<LookupResult<T> > pLookupResultIter,
combination_counter_t* pCombinationCounter) {
std::vector<T> elements;
int count = 0;
while(!pLookupResultIter->isDone() && (m_buildingBlocksBucketMaxSize == 0 || ++count <= m_buildingBlocksBucketMaxSize)) {
elements.push_back(pLookupResultIter->getObj().m_resultElement);
pLookupResultIter->next();
}
//Side-effect: Count maximum possible number of combinations
std::cout << "Size of subset: " << elements.size() << "\n";
if(pCombinationCounter != NULL) {
*pCombinationCounter *= elements.size();
}
return IteratorPtr<T>(new VectorBasedReadOnlyIteratorImpl<T>(elements));
}