• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AddNode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1:

	DataNode& DataNode::operator[](const WString& nodePath)
	{
		if (auto node = GetNode(nodePath))
			return *node;

		return *AddNode(nodePath);
	}
开发者ID:zenkovich,项目名称:o2,代码行数:7,代码来源:DataNode.cpp


示例2: AddNode

void dgBroadPhaseDefault::LinkAggregate(dgBroadPhaseAggregate* const aggregate)
{
	AddNode(aggregate);
	aggregate->m_broadPhase = this;
	aggregate->m_updateNode = m_updateList.Append(aggregate);
	aggregate->m_myAggregateNode = m_aggregateList.Append(aggregate);
}
开发者ID:leegoonz,项目名称:newton-dynamics,代码行数:7,代码来源:dgBroadPhaseDefault.cpp


示例3: AddItem

//添加元素,即节点
BOOL AddItem(const Item * pi,Tree * ptree)
{
	Node * new_node;//新节点
	
	if(TreeIsFull(ptree))//判断树是否已满
	{
		fprintf(stderr,"Tree is full.\n");
		return FALSE;
	}
	if(SeekItem(pi,ptree).child != NULL)//在树中查找目标项目
	{
		fprintf(stderr,"Attempted to add duplicate item\n");
		return FALSE;
	}
	new_node = MakeNode(pi);//创建新节点,成功返回新节点,否则返回NULL
	if(new_node == NULL)//创建失败,返回false
	{
		fprintf(stderr,"Couldn't create node!\n");
		return FALSE;
	}
	//节点创建成功,向树中添加节点
	ptree->size++;//树的大小加1
	if(ptree->root == NULL)//如果树为空
	{
		ptree->root = new_node;
	}
	else
	{
		AddNode(new_node,ptree->root);//找到新节点应该添加到的位置
	}
	return TRUE;
}
开发者ID:18616378431,项目名称:myCode,代码行数:33,代码来源:tree.c


示例4: ReadTransforms

/*-----------------------------------------------------------------------------
 *  ReadTransforms
 *  Read a set of transforms from a string and transfer it into a file
 *-----------------------------------------------------------------------------*/
void ReadTransforms(char* buf, TransformList *list)
{
    char type = ' ';
    char axis = ' ';
    int value = 0;
    char* p = buf;

    /* Read the buffer */
    while(p != NULL)
    {
        /* Read the contents of the buffer */
        sscanf(p, "%c%c %d", &type, &axis, &value);

        /* Define a new Transform */
        Transform* t;
        if((t = malloc(sizeof(Transform))) == NULL)
        {
            perror("2D"); exit(EXIT_FAILURE);
        }
        t->type = type;
        t->axis = axis;
        t->value = value;

        /* Add it to the list */
        AddNode(list, t);

        /* Scan for the next item */
        p = strstr(p, ",");
        if(p != NULL)
            p += 1;
    }
}
开发者ID:Aretnorp,项目名称:cs-2010f,代码行数:36,代码来源:house.c


示例5: AddNode

void CZQCustomClient::SendBuffer(pBlock block)
{
	AddNode(block);
	if (!m_IsSending)
		ReadySendNextData(&m_SendData, 0);

}
开发者ID:mikesimb,项目名称:Lander,代码行数:7,代码来源:ZQCustomClient.cpp


示例6: while

int CLocalNav::FindDirectPath(Vector &vecStepStart, Vector &vecDest, float flTargetRadius, BOOL fNoMonsters)
{
	Vector vecActualDest;
	Vector vecPathDir;
	Vector vecNodeLoc;
	int nindexLast;

	vecPathDir = (vecDest - vecStepStart).Normalize();
	vecActualDest = vecDest - (vecPathDir * flTargetRadius);

	if (PathTraversable(vecStepStart, vecActualDest, fNoMonsters) == TRAVERSABLE_NO)
		return -1;

	nindexLast = -1;
	vecNodeLoc = vecStepStart;
	m_nindexAvailableNode = 0;

	while ((vecNodeLoc - vecActualDest).Length2D() >= HOSTAGE_STEPSIZE)
	{
		vecNodeLoc = vecNodeLoc + (vecPathDir * HOSTAGE_STEPSIZE);
		nindexLast = AddNode(nindexLast, vecNodeLoc, 0, 0, 0);

		if (nindexLast == -1)
			break;
	}

	return nindexLast;
}
开发者ID:DeadlyGamer,项目名称:cs16nd,代码行数:28,代码来源:hostage_localnav.cpp


示例7: Node

void List::InsertAfter(void* iterPtr, void* objectPtr)
{
	Node* node = new Node();
	node->m_Ptr = objectPtr;

	AddNode(node, (Node*)iterPtr, ((Node*)iterPtr)->m_NextNode);
}
开发者ID:YoungHaKim,项目名称:MyList,代码行数:7,代码来源:List.cpp


示例8: AddNode

void IntersectionNodesInAirport::AddNodes( const std::vector<IntersectionNode> newNodes )
{
	for(int i=0;i <(int)newNodes.size();i++)
	{
		AddNode(newNodes[i]);
	}
}
开发者ID:chenbk85,项目名称:tphProjects,代码行数:7,代码来源:IntersectionNodesInAirport.cpp


示例9: CG2Node

CNeighbour* CNeighboursConnections::OnAccept(CNetworkConnection* pConn)
{
	// TODO: Make new CNeighbour deriviate for handshaking with Gnutella clients

	systemLog.postLog(LogSeverity::Debug, "CNeighbours::OnAccept");
	//qDebug() << "CNeighbours::OnAccept";

	if(!m_bActive)
	{
		pConn->Close();
		return 0;
	}

	if(!m_pSection.tryLock(50))
	{
		systemLog.postLog(LogSeverity::Debug, "Not accepting incoming connection. Neighbours overloaded");
		pConn->Close();
		return 0;
	}

	CG2Node* pNew = new CG2Node();
	pNew->AttachTo(pConn);
	AddNode(pNew);
	pNew->moveToThread(&NetworkThread);

	m_pSection.unlock();

	return pNew;
}
开发者ID:aboduo,项目名称:quazaa,代码行数:29,代码来源:neighboursconnections.cpp


示例10: main

int main()
{
	char ch[10],num[5];
	LinkList head;
	head=CreatList();
	printlist(head);
	printf(" Delete node (y/n):");
	scanf("%s",num);
	if(strcmp(num,"y")==0||strcmp(num,"Y")==0) 
	{
		printf("Please input Delete_data:");
		scanf("%s",ch);
		DeleteList(head,ch);
		printlist(head);
	}
	printf("Add node ? (y/n): ");
	scanf("%s",ch);
	if(strcmp(ch,"y")==0||strcmp(ch,"Y")==0)
	{
		head=AddNode(head);
	}
	printlist(head);
	system("pause");
	DeleteAll(head);
}
开发者ID:homesangsang,项目名称:datastruct,代码行数:25,代码来源:linkedlist.c


示例11: m_lru

dSceneGraph::dSceneGraph(const dSceneGraph& me)
	:dTree<dGraphNode, unsigned>(), m_lru (0)
{
	// add all nodes from me,  
	Iterator iter (me);
	for (iter.Begin(); iter; iter ++) {
		dGraphNode& srcNode = iter.GetNode()->GetInfo();
		AddNode (srcNode.m_nodeInfo, NULL);
	}

	//now connect all edges
	for (iter.Begin(); iter; iter ++) {
		dGraphNode& srcNode = iter.GetNode()->GetInfo();
		dGraphNode& myNode = Find(srcNode.m_nodeInfo->GetUniqueID())->GetInfo();

		for (dGraphNode::dLink::dListNode* srcEdge = srcNode.m_children.GetFirst(); srcEdge; srcEdge = srcEdge->GetNext()) {
			dGraphNode& srcLinkNode = srcEdge->GetInfo()->GetInfo();
			dTreeNode* myLinkNode = Find(srcLinkNode.m_nodeInfo->GetUniqueID());
			//myNode.m_children.Append(srcEdge->GetInfo());
			myNode.m_children.Append(myLinkNode);
		}

		for (dGraphNode::dLink::dListNode* srcEdge = srcNode.m_parents.GetFirst(); srcEdge; srcEdge = srcEdge->GetNext()) {
			dGraphNode& srcLinkNode = srcEdge->GetInfo()->GetInfo();
			dTreeNode* myLinkNode = Find(srcLinkNode.m_nodeInfo->GetUniqueID());
			//myNode.m_parents.Append(srcEdge->GetInfo());
			myNode.m_parents.Append(myLinkNode);
		}
	}

	m_rootNode = Find(me.GetRootNode()->GetInfo().GetNode()->GetUniqueID());
}
开发者ID:ak4hige,项目名称:myway3d,代码行数:32,代码来源:dSceneGraph.cpp


示例12: InitTireTree

int InitTireTree(trie_tree_t* pttt, const char* str_table[], int size)
{
	if (!pttt)
	{
		return -1;
	}
	trie_node_t* root = &pttt->root;
	memset(root->childs, 0, sizeof(root->childs));

	int i;
	for (i = 0; i < size; ++i)
	{
		trie_node_t* pn = root;
		const char *one = str_table[i];
		int len = strlen(one);
		int j;
		for (j = 0; j < len; ++j)
		{
			int ch = char_map(one[j]);
			if (!pn->childs[ch])
			{
				(void)AddNode(pn, ch);
			}
			pn = pn->childs[ch];
		}
		pn->end = 1;
	}

	return 0;
}
开发者ID:zgww,项目名称:dir_sync,代码行数:30,代码来源:trie.c


示例13: while

void CTreeBuilder::ReadConfig()
{
	int depth = 0;
	CTreeNode* pParentNode = NULL;
	CTreeNode* pCurrentNode = NULL;
	CTreeNode* pSiblings = NULL;
	string xmlLine;
	ifstream infile;
	infile.open (m_sFileName.c_str(), ifstream::in);
	while(infile.good())
	{
		string test; 
		getline(infile,xmlLine); 
		if ( !xmlLine.empty())
		{
			NodeDetails nodeDetails; 
			string nodeName = "", nodeText = "";
			ValidateTag(xmlLine, nodeDetails);

			pCurrentNode = AddNode(pCurrentNode, nodeDetails); 


		}
	}
	infile.close();
}
开发者ID:5dollartools,项目名称:CFGHelper,代码行数:26,代码来源:TreeBuilder.cpp


示例14: AddNode

void MGADSMTrajectory::AddNodes(const std::vector<TrajectoryNodePtr>& nodes)
{
   for (std::size_t i = 0; i < nodes.size(); ++i)
   {
      AddNode(nodes[i]);
   }
}
开发者ID:Jmbryan,项目名称:OTL,代码行数:7,代码来源:MGADSMTrajectory.cpp


示例15: DepCompAstRefDAG

 DepCompAstRefDAG(const DepCompAstRefAnal& stmtorder, const DepCompAstRefGraphCreate* g) 
  {
     DoublyLinkedListWrap <DepCompAstRefGraphNode*> nodelist;
     DepCompAstRefGraphCreate::NodeIterator nodes = g->GetNodeIterator();
     for ( ; !nodes.ReachEnd(); nodes.Advance()) {
          DepCompAstRefGraphNode* n = nodes.Current();
          AddNode(n);
          nodelist.AppendLast(n);
     }
     if (nodelist.size() <= 1)
         return;
     for (nodes.Reset(); !nodes.ReachEnd(); nodes.Advance()) {
        DepCompAstRefGraphNode* n = *nodes;
        DepCompAstRef& info = n->GetInfo();
        for (DepInfoEdgeIterator edges = g->GetNodeEdgeIterator(n, GraphAccess::EdgeOut);
              !edges.ReachEnd(); ++edges) {
            DepInfoEdge* e = *edges;
            DepCompAstRefGraphNode* n1 = g->GetEdgeEndPoint(e, GraphAccess::EdgeIn);
            DepCompAstRef& info1 = n1->GetInfo();
            int c = stmtorder.CompareAstRef(info,info1);
            if (c < 0) {
                  AddEdge(n, n1, e);
            }
            else if (c > 0) {
                 AddEdge(n1,n,e);
            }
        }
     }   
     if (DebugRefFuse()) {
        std::cerr << GraphToString(*this) << std::endl;
     }
  }
开发者ID:InstRO,项目名称:InstRO-ROSE,代码行数:32,代码来源:DepCompTransform.C


示例16: AddNode

void Snake::Clear(void)
{
	SnakeNode.clear();
	length = 0;
	AddNode(25, 25);
	director = 1;
}
开发者ID:hhh920406,项目名称:QTsnake,代码行数:7,代码来源:snake.cpp


示例17: PopulateNodes

static void PopulateNodes()
{
	WUTIL_FUNC(pGetNumaNodeProcessorMask, BOOL, (UCHAR, PULONGLONG));
	WUTIL_IMPORT_KERNEL32(GetNumaNodeProcessorMask, pGetNumaNodeProcessorMask);
	if(!pGetNumaNodeProcessorMask)
		return;

	DWORD_PTR processAffinity, systemAffinity;
	{
		const BOOL ok = GetProcessAffinityMask(GetCurrentProcess(), &processAffinity, &systemAffinity);
		WARN_IF_FALSE(ok);
	}
	ENSURE(PopulationCount(processAffinity) <= PopulationCount(systemAffinity));

	for(UCHAR nodeNumber = 0; nodeNumber <= HighestNodeNumber(); nodeNumber++)
	{
		ULONGLONG affinity;
		{
			const BOOL ok = pGetNumaNodeProcessorMask(nodeNumber, &affinity);
			WARN_IF_FALSE(ok);
		}
		if(!affinity)
			continue;	// empty node, skip

		Node* node = AddNode();
		node->nodeNumber = nodeNumber;
		node->processorMask = wcpu_ProcessorMaskFromAffinity(processAffinity, (DWORD_PTR)affinity);
	}
}
开发者ID:righnatios,项目名称:0ad,代码行数:29,代码来源:wnuma.cpp


示例18: InitTopology

static Status InitTopology()
{
	PopulateNodes();

#if ARCH_X86_X64
	const SRAT* srat = (const SRAT*)acpi_GetTable("SRAT");
	if(srat && AreApicIdsReliable())
	{
		const ProximityDomains proximityDomains = ExtractProximityDomainsFromSRAT(srat);
		PopulateNodesFromProximityDomains(proximityDomains);
	}
#endif

	// neither OS nor ACPI information is available
	if(numNodes == 0)
	{
		// add dummy node that contains all system processors
		Node* node = AddNode();
		node->nodeNumber = 0;
		node->proximityDomainNumber = 0;
		node->processorMask = os_cpu_ProcessorMask();
	}

	return INFO::OK;
}
开发者ID:righnatios,项目名称:0ad,代码行数:25,代码来源:wnuma.cpp


示例19: AddNode

void CFrontendDlg::AddHna(unsigned int NetAddr, unsigned int NetMask,
						  unsigned int NodeAddr, unsigned int VTime)
{
	class NodeEntry NewEntry;
	POSITION Pos;
	unsigned __int64 Timeout;

	Timeout = Now +
		(unsigned __int64)VTimeToInt(VTime) * (unsigned __int64)10000000;

	AddNode(NodeAddr, VTime);

	NewEntry.Addr = NodeAddr;

	Pos = NodeList.Find(NewEntry);

	if (Pos == NULL)
		return;

	class NodeEntry &OldEntry = NodeList.GetAt(Pos);

	OldEntry.AddHna(NetAddr, NetMask, Timeout);

	m_TabCtrl.m_Dialog3.UpdateNodeInfo(NodeList);
}
开发者ID:fatielmahdi,项目名称:olsr,代码行数:25,代码来源:FrontendDlg.cpp


示例20: AddASCII

//向writer中添加s对应的ASCII码
void AddASCII(List writer, LPSTR s)
{
	int i,len=(int)strlen(s);
	for(i=0;i<len;i++){
		AddNode(writer,(void*)s[i]);
	}
}
开发者ID:lzl124631x,项目名称:pdf_manager,代码行数:8,代码来源:PDFManager_Win32ConsoleApplication.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AddNorthrendScripts函数代码示例发布时间:2022-05-30
下一篇:
C++ AddMessage函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap