本文整理汇总了C++中pdvector::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ pdvector::resize方法的具体用法?C++ pdvector::resize怎么用?C++ pdvector::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pdvector
的用法示例。
在下文中一共展示了pdvector::resize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: result
pdvector< pdvector<resourceHandle> >
callGraphDisplay::getSelections(bool &wholeProgram,
pdvector<unsigned> &wholeProgramFocus) const {
// returns a vector[num-hierarchies] of vector of selections.
// The number of hierarchies is defined as the number of children of the
// root node. If "Whole Program" was selection, it isn't returned with
// the main result; it's returned by modifying the 2 params
const unsigned numHierarchies = rootPtr->getNumChildren();
pdvector < pdvector<resourceHandle> > result(numHierarchies);
bool wholeProgramImplicit = true; // so far...
for (unsigned i=0; i < numHierarchies; i++) {
where4tree<callGraphRootNode> *hierarchyRoot = rootPtr->getChildTree(i);
pdvector <const callGraphRootNode *> thisHierarchySelections =
hierarchyRoot->getSelections();
if (thisHierarchySelections.size()==0)
// add hierarchy's root item
thisHierarchySelections += &hierarchyRoot->getNodeData();
else
// since the hierarchy selection was not empty, we do _not_
// want to implicitly select whole-program
wholeProgramImplicit = false;
result[i].resize(thisHierarchySelections.size());
for (unsigned j=0; j < thisHierarchySelections.size(); j++)
result[i][j] = thisHierarchySelections[j]->getUniqueId();
}
wholeProgram = wholeProgramImplicit || rootPtr->isHighlighted();
if (wholeProgram) {
// write to wholeProgramFocus:
wholeProgramFocus.resize(numHierarchies);
for (unsigned i=0; i < numHierarchies; i++) {
where4tree<callGraphRootNode> *hierarchyRoot = rootPtr->getChildTree(i);
const callGraphRootNode &hierarchyRootData = hierarchyRoot->getNodeData();
unsigned hierarchyRootUniqueId = hierarchyRootData.getUniqueId();
wholeProgramFocus[i] = hierarchyRootUniqueId;
}
}
return result;
}