本文整理汇总了C++中ApiTraceFrame::setNumChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ ApiTraceFrame::setNumChildren方法的具体用法?C++ ApiTraceFrame::setNumChildren怎么用?C++ ApiTraceFrame::setNumChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiTraceFrame
的用法示例。
在下文中一共展示了ApiTraceFrame::setNumChildren方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scanTrace
void TraceLoader::scanTrace()
{
QList<ApiTraceFrame*> frames;
ApiTraceFrame *currentFrame = 0;
trace::Call *call;
trace::ParseBookmark startBookmark;
int numOfFrames = 0;
int numOfCalls = 0;
int lastPercentReport = 0;
m_parser.getBookmark(startBookmark);
while ((call = m_parser.scan_call())) {
++numOfCalls;
if (call->flags & trace::CALL_FLAG_END_FRAME) {
FrameBookmark frameBookmark(startBookmark);
frameBookmark.numberOfCalls = numOfCalls;
currentFrame = new ApiTraceFrame();
currentFrame->number = numOfFrames;
currentFrame->setNumChildren(numOfCalls);
currentFrame->setLastCallIndex(call->no);
frames.append(currentFrame);
m_createdFrames.append(currentFrame);
m_frameBookmarks[numOfFrames] = frameBookmark;
++numOfFrames;
if (m_parser.percentRead() - lastPercentReport >= 5) {
emit parsed(m_parser.percentRead());
lastPercentReport = m_parser.percentRead();
}
m_parser.getBookmark(startBookmark);
numOfCalls = 0;
}
delete call;
}
if (numOfCalls) {
//trace::File::Bookmark endBookmark = m_parser.currentBookmark();
FrameBookmark frameBookmark(startBookmark);
frameBookmark.numberOfCalls = numOfCalls;
currentFrame = new ApiTraceFrame();
currentFrame->number = numOfFrames;
currentFrame->setNumChildren(numOfCalls);
frames.append(currentFrame);
m_createdFrames.append(currentFrame);
m_frameBookmarks[numOfFrames] = frameBookmark;
++numOfFrames;
}
emit parsed(100);
emit framesLoaded(frames);
}