当前位置: 首页>>代码示例>>C++>>正文


C++ ProfileNode类代码示例

本文整理汇总了C++中ProfileNode的典型用法代码示例。如果您正苦于以下问题:C++ ProfileNode类的具体用法?C++ ProfileNode怎么用?C++ ProfileNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ProfileNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: InitDeviceComboBox

void CVCDlg::InitDeviceComboBox()
{
	ProfileNode* pRoot = ProfileMgr::GetInstance()->GetRootProfile();
	int nChildCount = ((pRoot == NULL) ? 0 : pRoot->GetChildCount());

	std::string szText;
	AttribMap* pAttribMap = NULL;
	for(int i = 0; i < nChildCount; i++)
	{
		ProfileNode* pProfile = (ProfileNode*)pRoot->GetChild(i);

		pAttribMap = (AttribMap*)pProfile->GetData();
		if(!pAttribMap->Get(PF_ATTRIB_DESC, szText))
		{
			pAttribMap->Get(PF_ATTRIB_NAME, szText);
		}
		LIST_ITEM item;
		item.strText = CFL_A2T(szText.c_str());
		item.vpItemData = pProfile;
		m_deviceComboBox.AddItem(&item);
	}

	if(nChildCount > 0)
	{
		m_deviceComboBox.SetCurSel(0);
		OnCategorySelChanged();
	}
}
开发者ID:killbug2004,项目名称:cosps,代码行数:28,代码来源:VCDlg.cpp

示例2: getLineNumber

static JSValueRef getLineNumber(JSContextRef ctx, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
{
    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
        return JSValueMakeUndefined(ctx);

    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
    return JSValueMakeNumber(ctx, profileNode->lineNumber());
}
开发者ID:acss,项目名称:owb-mirror,代码行数:8,代码来源:JavaScriptProfileNode.cpp

示例3: getURL

static JSValueRef getURL(JSContextRef ctx, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
{
    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
        return JSValueMakeUndefined(ctx);

    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
    JSRetainPtr<JSStringRef> urlString(Adopt, JSStringCreateWithCharacters(profileNode->url().data(), profileNode->url().size()));
    return JSValueMakeString(ctx, urlString.get());
}
开发者ID:acss,项目名称:owb-mirror,代码行数:9,代码来源:JavaScriptProfileNode.cpp

示例4: while

ProfileNode* ProfileNode::traverseNextNodePostOrder() const
{
    ProfileNode* next = m_nextSibling;
    if (!next)
        return m_parent;
    while (ProfileNode* firstChild = next->firstChild())
        next = firstChild;
    return next;
}
开发者ID:WebKitNix,项目名称:webkitnix,代码行数:9,代码来源:ProfileNode.cpp

示例5: getSelfTime

static JSValueRef getSelfTime(JSContextRef ctx, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
{
    KJS::JSLock lock(false);

    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
        return JSValueMakeUndefined(ctx);

    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
    return JSValueMakeNumber(ctx, profileNode->selfTime());
}
开发者ID:acss,项目名称:owb-mirror,代码行数:10,代码来源:JavaScriptProfileNode.cpp

示例6: removeProfileStart

// The console.profile that started this ProfileGenerator will be the first child.
void ProfileGenerator::removeProfileStart()
{
    ProfileNode* currentNode = nullptr;
    for (ProfileNode* next = m_rootNode.get(); next; next = next->firstChild())
        currentNode = next;

    if (currentNode->callIdentifier().functionName() != "profile")
        return;

    currentNode->parent()->removeChild(currentNode);
}
开发者ID:houzhenggang,项目名称:webkit,代码行数:12,代码来源:ProfileGenerator.cpp

示例7: forEach

void Profile::focus(const ProfileNode* profileNode)
{
    if (!profileNode || !m_head)
        return;

    bool processChildren;
    const CallIdentifier& callIdentifier = profileNode->callIdentifier();
    for (ProfileNode* currentNode = m_head.get(); currentNode; currentNode = currentNode->traverseNextNodePreOrder(processChildren))
        processChildren = currentNode->focus(callIdentifier);

    // Set the visible time of all nodes so that the %s display correctly.
    forEach(&ProfileNode::calculateVisibleTotalTime);
}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:13,代码来源:Profile.cpp

示例8: setTreeVisible

void ProfileNode::setTreeVisible(ProfileNode* node, bool visible)
{
    ProfileNode* nodeParent = node->parent();
    ProfileNode* nodeSibling = node->nextSibling();
    node->setParent(0);
    node->setNextSibling(0);

    for (ProfileNode* currentNode = node; currentNode; currentNode = currentNode->traverseNextNodePreOrder())
        currentNode->setVisible(visible);

    node->setParent(nodeParent);
    node->setNextSibling(nodeSibling);
}
开发者ID:pelegri,项目名称:WebKit-PlayBook,代码行数:13,代码来源:ProfileNode.cpp

示例9: beginNode

void Profile::beginNode(const char* name)
{
  ProfileNode* parent = m_stack.back();

  ProfileNode* node = parent->findChild(name);
  if (!node)
  {
    parent->m_children.push_back(ProfileNode(name));
    node = &(parent->m_children.back());
  }

  beginNode(*node);
}
开发者ID:tapio,项目名称:Wendy,代码行数:13,代码来源:Profile.cpp

示例10: exclude

void Profile::exclude(const ProfileNode* profileNode)
{
    if (!profileNode || !m_head)
        return;

    const CallIdentifier& callIdentifier = profileNode->callIdentifier();

    for (ProfileNode* currentNode = m_head.get(); currentNode; currentNode = currentNode->traverseNextNodePreOrder())
        currentNode->exclude(callIdentifier);

    // Set the visible time of the head so the %s display correctly.
    m_head->setVisibleTotalTime(m_head->totalTime() - m_head->selfTime());
    m_head->setVisibleSelfTime(0.0);
}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:14,代码来源:Profile.cpp

示例11: focus

bool ProfileNode::focus(const CallIdentifier& callIdentifier)
{
    if (!m_visible)
        return false;

    if (m_callIdentifier != callIdentifier) {
        m_visible = false;
        return true;
    }

    for (ProfileNode* currentParent = m_parent; currentParent; currentParent = currentParent->parent())
        currentParent->setVisible(true);

    return false;
}
开发者ID:pelegri,项目名称:WebKit-PlayBook,代码行数:15,代码来源:ProfileNode.cpp

示例12: getChildren

static JSValueRef getChildren(JSContextRef ctx, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
{
    KJS::JSLock lock(false);

    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
        return JSValueMakeUndefined(ctx);

    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
    const Vector<RefPtr<ProfileNode> >& children = profileNode->children();

    JSObjectRef global = JSContextGetGlobalObject(ctx);

    JSRetainPtr<JSStringRef> arrayString(Adopt, JSStringCreateWithUTF8CString("Array"));

    JSValueRef arrayProperty = JSObjectGetProperty(ctx, global, arrayString.get(), exception);
    if (exception && *exception)
        return JSValueMakeUndefined(ctx);

    JSObjectRef arrayConstructor = JSValueToObject(ctx, arrayProperty, exception);
    if (exception && *exception)
        return JSValueMakeUndefined(ctx);

    JSObjectRef result = JSObjectCallAsConstructor(ctx, arrayConstructor, 0, 0, exception);
    if (exception && *exception)
        return JSValueMakeUndefined(ctx);

    JSRetainPtr<JSStringRef> pushString(Adopt, JSStringCreateWithUTF8CString("push"));
    
    JSValueRef pushProperty = JSObjectGetProperty(ctx, result, pushString.get(), exception);
    if (exception && *exception)
        return JSValueMakeUndefined(ctx);

    JSObjectRef pushFunction = JSValueToObject(ctx, pushProperty, exception);
    if (exception && *exception)
        return JSValueMakeUndefined(ctx);

    for (Vector<RefPtr<ProfileNode> >::const_iterator it = children.begin(); it != children.end(); ++it) {
        JSValueRef arg0 = toRef(toJS(toJS(ctx), (*it).get() ));
        JSObjectCallAsFunction(ctx, pushFunction, result, 1, &arg0, exception);
        if (exception && *exception)
            return JSValueMakeUndefined(ctx);
    }

    return result;
}
开发者ID:acss,项目名称:owb-mirror,代码行数:45,代码来源:JavaScriptProfileNode.cpp

示例13: if

	const ProfileNode* ProfileNode::findNextInTree(void) const {
		if (firstChild) {
			return firstChild;

		} else if (nextSibling) {
			return nextSibling;

		} else {
			ProfileNode* pParent = parent;

			while (!pParent->isRoot()) {
				if (pParent->nextSibling) return pParent->nextSibling;
				else pParent = pParent->parent;
			}

			return NULL;
		}
	}
开发者ID:ClockMan,项目名称:chaos-share,代码行数:18,代码来源:ShinyNode.cpp

示例14: removeProfileEnd

// The console.profileEnd that stopped this ProfileGenerator will be the last child.
void ProfileGenerator::removeProfileEnd()
{
    ProfileNode* currentNode = nullptr;
    for (ProfileNode* next = m_rootNode.get(); next; next = next->lastChild())
        currentNode = next;

    if (currentNode->callIdentifier().functionName() != "profileEnd")
        return;

    ASSERT(currentNode->callIdentifier() == (currentNode->parent()->children()[currentNode->parent()->children().size() - 1])->callIdentifier());
    currentNode->parent()->removeChild(currentNode);
}
开发者ID:houzhenggang,项目名称:webkit,代码行数:13,代码来源:ProfileGenerator.cpp

示例15: removeProfileStart

// The console.ProfileGenerator that started this ProfileGenerator will be the first child.
void ProfileGenerator::removeProfileStart()
{
    ProfileNode* currentNode = 0;
    for (ProfileNode* next = m_head.get(); next; next = next->firstChild())
        currentNode = next;

    if (currentNode->callIdentifier().m_name != "profile")
        return;

    // Attribute the time of the node aobut to be removed to the self time of its parent
    currentNode->parent()->setSelfTime(currentNode->parent()->selfTime() + currentNode->totalTime());
    currentNode->parent()->removeChild(currentNode);
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:14,代码来源:ProfileGenerator.cpp


注:本文中的ProfileNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。