本文整理汇总了C++中CCNode::getMethodId方法的典型用法代码示例。如果您正苦于以下问题:C++ CCNode::getMethodId方法的具体用法?C++ CCNode::getMethodId怎么用?C++ CCNode::getMethodId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCNode
的用法示例。
在下文中一共展示了CCNode::getMethodId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read_trace_file
//.........这里部分代码省略.........
bool new_thread = false;
if (curContext == 0) {
// -- Spawning a new thread -- look up the place where the thread was started
// Relies on the fact that the thread_id is the same as the object_id of
// the Thread object instance.
new_thread = true;
curContext = threadStarts[thread_id];
if (curContext) {
// if (debug > 0)
cout << "Spawn thread 0x" << hex << thread_id << dec << " -- started at " << curContext->getMethodFullName() << endl;
cout << " in context" << endl;
curContext->printStack();
} else {
cout << "Problem: no threadStart for thread id 0x" << hex << thread_id << dec << endl;
curContext = root;
}
}
time++;
depth++;
curContext = curContext->demand_child(method_id, thread_id, time);
curContext->incCalls();
theStack[thread_id] = curContext;
if (debug > 0 or new_thread) {
cout << "Enter " << curContext->getMethodFullName() << " 0x" << hex << method_id << " thread 0x" << thread_id << " at time " << time << endl;
if (debug > 1) curContext->printStack();
}
if (method_id == thread_start_method_id) {
// -- Found a new thread start
threadStarts[object_id] = curContext;
thread_number++;
threadIdNumbering[object_id] = thread_number;
if (true) {
cout << "Found Thread.start at " << endl;
curContext->printStack();
}
}
last_thread_id = thread_id;
}
break;
case 'E':
{
in >> hex >> method_id;
in >> hex >> object_id;
in >> hex >> thread_id;
CCNode * curContext = theStack[thread_id];
if (debug > 0) {
cout << hex << "E " << method_id << " " << object_id << " " << thread_id << endl;
//cout << "Exit " << curContext->getMethodFullName() << " 0x" << hex << method_id << " thread 0x" << thread_id << " at time " << time << endl;
cout << "Exit: Looking for " << "0x" << hex << method_id << " reciever: 0x" << object_id << " thread: 0x" << thread_id << endl;
if (debug > 1) curContext->printStack();
}
time++;
CCNode * returning = curContext;
int cur_id = returning->getMethodId();
int orig_depth = depth;
while (returning and returning->getMethodId() != method_id) {
returning = returning->getParent();
depth--;
}
if (returning == 0) {
cout << "THIS IS BAD: looking for "
<< hex << "0x" << method_id << " but found 0x"
<< cur_id << dec << endl;
returning->printStack();
// current_node unchanged
depth = orig_depth;
} else {
// cout << "Return " << current_node->getMethodFullName() << "(" << hex << current_node->getMethodId() << dec << ")" << endl;
returning->setLastCall(time);
theStack[thread_id] = returning->getParent();
depth--;
}
last_thread_id = thread_id;
}
break;
default:
cout << "UNKNOWN" << endl;
break;
}
getline(in, line);
record_count++;
if (record_count % 1000000 == 0) {
cerr << "At " << record_count << endl;
}
}
}