本文整理汇总了C++中ApiTraceCall::flags方法的典型用法代码示例。如果您正苦于以下问题:C++ ApiTraceCall::flags方法的具体用法?C++ ApiTraceCall::flags怎么用?C++ ApiTraceCall::flags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiTraceCall
的用法示例。
在下文中一共展示了ApiTraceCall::flags方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: frameContentsLoaded
QVector<ApiTraceCall*>
TraceLoader::fetchFrameContents(ApiTraceFrame *currentFrame)
{
Q_ASSERT(currentFrame);
if (currentFrame->isLoaded()) {
return currentFrame->calls();
}
if (m_parser.supportsOffsets()) {
unsigned frameIdx = currentFrame->number;
int numOfCalls = numberOfCallsInFrame(frameIdx);
if (numOfCalls) {
quint64 binaryDataSize = 0;
QVector<ApiTraceCall*> calls(numOfCalls);
const FrameBookmark &frameBookmark = m_frameBookmarks[frameIdx];
m_parser.setBookmark(frameBookmark.start);
trace::Call *call;
int parsedCalls = 0;
while ((call = m_parser.parse_call())) {
ApiTraceCall *apiCall =
apiCallFromTraceCall(call, m_helpHash,
currentFrame, this);
calls[parsedCalls] = apiCall;
Q_ASSERT(calls[parsedCalls]);
if (apiCall->hasBinaryData()) {
QByteArray data =
apiCall->arguments()[
apiCall->binaryDataIndex()].toByteArray();
binaryDataSize += data.size();
}
++parsedCalls;
delete call;
if (apiCall->flags() & trace::CALL_FLAG_END_FRAME) {
break;
}
}
assert(parsedCalls == numOfCalls);
Q_ASSERT(parsedCalls == calls.size());
calls.squeeze();
Q_ASSERT(parsedCalls == currentFrame->numChildrenToLoad());
emit frameContentsLoaded(currentFrame,
calls, binaryDataSize);
return calls;
}
}
return QVector<ApiTraceCall*>();
}
示例2: while
bool
TraceLoader::FrameContents::load(TraceLoader *loader,
ApiTraceFrame *currentFrame,
QHash<QString, QUrl> helpHash,
trace::Parser &parser)
{
bool bEndFrameReached = false;
int initNumOfCalls = m_allCalls.count();
trace::Call *call;
ApiTraceCall *apiCall = NULL;
while ((call = parser.parse_call())) {
apiCall = apiCallFromTraceCall(call, helpHash, currentFrame,
m_groups.isEmpty() ? 0 : m_groups.top(),
loader);
Q_ASSERT(apiCall);
if (initNumOfCalls) {
Q_ASSERT(m_parsedCalls < m_allCalls.size());
m_allCalls[m_parsedCalls++] = apiCall;
} else {
m_allCalls.append(apiCall);
}
if (m_groups.count() == 0) {
m_topLevelItems.append(apiCall);
} else {
m_groups.top()->addChild(apiCall);
}
if (call->flags & trace::CALL_FLAG_MARKER_PUSH) {
m_groups.push(apiCall);
} else if (call->flags & trace::CALL_FLAG_MARKER_POP) {
if (m_groups.count()) {
m_groups.top()->finishedAddingChildren();
m_groups.pop();
}
}
if (apiCall->hasBinaryData()) {
QByteArray data =
apiCall->arguments()[apiCall->binaryDataIndex()].
toByteArray();
m_binaryDataSize += data.size();
}
delete call;
if (apiCall->flags() & trace::CALL_FLAG_END_FRAME) {
bEndFrameReached = true;
break;
}
}
if (initNumOfCalls) {
// There can be fewer parsed calls when call in different
// threads cross the frame boundary
Q_ASSERT(m_parsedCalls <= initNumOfCalls);
Q_ASSERT(m_parsedCalls <= m_allCalls.size());
m_allCalls.resize(m_parsedCalls);
Q_ASSERT(m_parsedCalls <= currentFrame->numChildrenToLoad());
}
m_allCalls.squeeze();
m_topLevelItems.squeeze();
return bEndFrameReached;
}
示例3: frameContentsLoaded
QVector<ApiTraceCall*>
TraceLoader::fetchFrameContents(ApiTraceFrame *currentFrame)
{
Q_ASSERT(currentFrame);
if (currentFrame->isLoaded()) {
return currentFrame->calls();
}
if (m_parser.supportsOffsets()) {
unsigned frameIdx = currentFrame->number;
int numOfCalls = numberOfCallsInFrame(frameIdx);
if (numOfCalls) {
quint64 binaryDataSize = 0;
QStack<ApiTraceCall*> groups;
QVector<ApiTraceCall*> topLevelItems;
QVector<ApiTraceCall*> allCalls(numOfCalls);
const FrameBookmark &frameBookmark = m_frameBookmarks[frameIdx];
m_parser.setBookmark(frameBookmark.start);
trace::Call *call;
int parsedCalls = 0;
while ((call = m_parser.parse_call())) {
ApiTraceCall *apiCall =
apiCallFromTraceCall(call, m_helpHash,
currentFrame, groups.isEmpty() ? 0 : groups.top(), this);
Q_ASSERT(apiCall);
Q_ASSERT(parsedCalls < allCalls.size());
allCalls[parsedCalls++] = apiCall;
if (groups.count() == 0) {
topLevelItems.append(apiCall);
} else {
groups.top()->addChild(apiCall);
}
if (call->flags & trace::CALL_FLAG_MARKER_PUSH) {
groups.push(apiCall);
} else if (call->flags & trace::CALL_FLAG_MARKER_POP) {
if (groups.count()) {
groups.top()->finishedAddingChildren();
groups.pop();
}
}
if (apiCall->hasBinaryData()) {
QByteArray data =
apiCall->arguments()[
apiCall->binaryDataIndex()].toByteArray();
binaryDataSize += data.size();
}
delete call;
if (apiCall->flags() & trace::CALL_FLAG_END_FRAME) {
break;
}
}
// There can be fewer parsed calls when call in different
// threads cross the frame boundary
Q_ASSERT(parsedCalls <= numOfCalls);
Q_ASSERT(parsedCalls <= allCalls.size());
allCalls.resize(parsedCalls);
allCalls.squeeze();
Q_ASSERT(parsedCalls <= currentFrame->numChildrenToLoad());
if (topLevelItems.count() == allCalls.count()) {
emit frameContentsLoaded(currentFrame, allCalls,
allCalls, binaryDataSize);
} else {
emit frameContentsLoaded(currentFrame, topLevelItems,
allCalls, binaryDataSize);
}
return allCalls;
}
}
return QVector<ApiTraceCall*>();
}