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


C++ RemoveNode函数代码示例

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


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

示例1: GlueFreeBlocks

void* SubAllocator::AllocUnitsRare(int indx)
{
  if ( !GlueCount )
  {
    GlueCount = 255;
    GlueFreeBlocks();
    if ( FreeList[indx].next )
      return RemoveNode(indx);
  }
  int i=indx;
  do
  {
    if (++i == N_INDEXES)
    {
      GlueCount--;
      i=U2B(Indx2Units[indx]);
      int j=12*Indx2Units[indx];
      if (FakeUnitsStart-pText > j)
      {
        FakeUnitsStart-=j;
        UnitsStart -= i;
        return(UnitsStart);
      }
      return(NULL);
    }
  } while ( !FreeList[i].next );
  void* RetVal=RemoveNode(i);
  SplitBlock(RetVal,i,indx);
  return RetVal;
}
开发者ID:alown,项目名称:iViewer,代码行数:30,代码来源:suballoc.cpp

示例2: RemoveNode

//
// Remove a node recursive from the tree
//
void hsStringTable::RemoveNode(Node* root) 
{
    if (!root) return;
    RemoveNode(root->kid);
    RemoveNode(root->sib);
    delete root;
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:10,代码来源:hsStringTable.cpp

示例3: _AllocUnits

static uint32_t _AllocUnits(PPMdSubAllocatorVariantH *self,int index)
{
	if(self->GlueCount==0)
	{
		self->GlueCount=255;
		GlueFreeBlocks(self);
		if(self->FreeList[index].next) return PointerToOffset(self,RemoveNode(self,index));
	}

	for(int i=index+1;i<N_INDEXES;i++)
	{
		if(self->FreeList[i].next)
		{
			void *units=RemoveNode(self,i);
			SplitBlock(self,units,i,index);
			return PointerToOffset(self,units);
		}
	}

	self->GlueCount--;

	int i=I2B(self,index);
	if(self->UnitsStart-self->pText>i)
	{
		self->UnitsStart-=i;
		return PointerToOffset(self,self->UnitsStart);
	}

	return 0;
}
开发者ID:1051215684,项目名称:theunarchiver,代码行数:30,代码来源:SubAllocatorVariantH.c

示例4: RemoveNode

QmitkToFUtilView::~QmitkToFUtilView()
{
  RemoveNode("ToF_Distance", this->m_DistanceImageNode);
  RemoveNode("ToF_Amplitude", this->m_AmplitudeImageNode);
  RemoveNode("ToF_Intensity", this->m_IntensityImageNode);
  RemoveNode("ToF_Surface", this->m_SurfaceNode);
  //RemoveBackground();
}
开发者ID:david-guerrero,项目名称:MITK,代码行数:8,代码来源:QmitkToFUtilView.cpp

示例5: listtest

///////////////////////////q-4
void listtest(){
	Position pHead;
	pHead=NULL;
	AddToTail(&pHead,4);
	AddToTail(&pHead,5);
	RemoveNode(&pHead,4);
	RemoveNode(&pHead,5);
	AddToTail(&pHead,5);
}
开发者ID:leonwang1990,项目名称:jianzhioffer,代码行数:10,代码来源:main.c

示例6: RemoveNode

//remove a node and all child nodes
//WARNING: ANY CHILDREN OF THIS NODE (AND THERE CHILDREN) WILL ALSO BE REMOVED
//easy usage: RemoveNode(GetNode(parent, nodeName));
int BayesNet::RemoveNode(Node* myNode)
{
    if (myNode->child1 == nullptr || myNode->child2 == nullptr)
    {
        return 0;
    }
    else
    {
        RemoveNode(myNode->child1);
        RemoveNode(myNode->child2);
    }
    return 0;
} //RemoveNode
开发者ID:TREXJET,项目名称:Simple_Bayes,代码行数:16,代码来源:BayesNet.cpp

示例7: guard

// 移除车辆信息
void CPccSession::CCarInfoMgr::RemoveInfo( const string &key , bool byphone )
{
	share::Guard guard( _mutex ) ;

	_stCarList *temp = NULL ;
	CMapCarInfo::iterator it ;

	if ( byphone ) {
		it = _phone2car.find( key ) ;
		if ( it == _phone2car.end() ) {
			return ;
		}
		temp = it->second ;
		_phone2car.erase( it ) ;

		it = _vehice2car.find(  temp->info.vehiclenum ) ;
		if ( it != _vehice2car.end() ) {
			_vehice2car.erase( it ) ;
		}
	} else {
		it = _vehice2car.find( key ) ;
		if ( it == _vehice2car.end() ) {
			return ;
		}
		temp = it->second ;
		_vehice2car.erase( it ) ;

		it = _phone2car.find( temp->info.macid ) ;
		if ( it != _phone2car.end() ) {
			_phone2car.erase( it ) ;
		}
	}
	RemoveNode( temp ) ;
}
开发者ID:caocf,项目名称:workspace-kepler,代码行数:35,代码来源:pccsession.cpp

示例8: name_extractor

CPDF_FormField* CFieldTree::RemoveField(const CFX_WideString& full_name) {
  if (full_name == L"")
    return nullptr;

  CFieldNameExtractor name_extractor(full_name);
  const FX_WCHAR* pName;
  FX_STRSIZE nLength;
  name_extractor.GetNext(pName, nLength);
  Node* pNode = &m_Root;
  Node* pLast = nullptr;
  while (nLength > 0 && pNode) {
    pLast = pNode;
    CFX_WideString name = CFX_WideString(pName, nLength);
    pNode = Lookup(pLast, name);
    name_extractor.GetNext(pName, nLength);
  }

  if (pNode && pNode != &m_Root) {
    for (int i = 0; i < pLast->children.GetSize(); i++) {
      if (pNode == pLast->children[i]) {
        pLast->children.RemoveAt(i);
        break;
      }
    }
    CPDF_FormField* pField = pNode->field_ptr;
    RemoveNode(pNode);
    return pField;
  }
  return nullptr;
}
开发者ID:gradescope,项目名称:pdfium,代码行数:30,代码来源:cpdf_interform.cpp

示例9: RemoveNode

void SceneGraph::RemoveMarkedNodesInList(List& list)
{
	typedef typename List::iterator Iterator;
	typedef typename List::value_type ValueType;

	for (Iterator iter = list.begin(); iter != list.end(); /*++iter*/)
	{
		Iterator currIter = iter;
		++iter;

		ValueType pNode = *currIter;

		if (pNode->mRemoveNodePostUpdate)
		{
			pNode->mRemoveNodePostUpdate = false;
			RemoveNode(pNode);

			//@TODO: This is crap! Problem is this code assumes only a sublist is being passed in,
			// so RemoveNode (above) removes from the sublist, and then we remove from the SceneNodeList
			// here. But if the SceneNodeList gets passed in, we don't want to double-remove!
			// Right solution is to have an overloaded set of RemoveNode() calls that match the overload
			// set for AddNode(), and that remove from their respective lists.
			if ( !type_traits::is_same<List, SceneNodeList>::value )
			{
				list.erase(currIter);
			}
			
			delete pNode;
		}
	}
}
开发者ID:amaiorano,项目名称:ZeldaDS,代码行数:31,代码来源:SceneGraph.cpp

示例10: FullRemoveNode

void FullRemoveNode(HWND hwnd)
{
  unsigned short tag;

  for (tag=0; tag<TAGS; tag++)
    RemoveNode(hwnd, tag);
}
开发者ID:Jasu,项目名称:HashTWM,代码行数:7,代码来源:main.c

示例11: DestoryContext

void DestoryContext( Context* con ) {
	// remove all nodes and edges
	Node *node = con->nfanodelist;
	Node *temp;

	node = con->nfanodelist;
	
	while ( node != NULL ) {
		temp = node;
		node = node->next;
		RemoveNode( con, temp );
	}

	// remove all nfas
	Nfa *prev_n, *next_n;
	prev_n = next_n = con->nfalist;
	while ( next_n != NULL ) {
		prev_n = next_n;
		next_n = next_n->next;

		RemoveNfa( con, prev_n );
	}

	NfaStackElement* nse = con->nfa_stacktop;
	NfaStackElement* t;

	while ( nse != NULL ) {
		t = nse;
		nse = nse->next;
		delete t;
	}

	DfaNodeElement* dne = con->dne_queue;
	DfaNodeElement* prev_dne;
	while ( dne != NULL ) {
		Node* node = dne->node;
		State* ss = node->statelist;
		State* _s;
		while ( ss != NULL ) {
			_s = ss;
			ss = ss->next;
			delete _s;
		}
		Edge* ee = node->edgelist;
		Edge* _e;
		while ( ee != NULL ) {
			_e = ee;
			ee = ee->next;
			delete _e;
		}
		delete node;
		prev_dne = dne;
		dne = dne->next;
		delete prev_dne;
	}
	delete con->dfa;

	DestorySymbol( con );
	delete con;
}
开发者ID:march1896,项目名称:snev,代码行数:60,代码来源:regexp_fa.cpp

示例12: ll

BOOL CNetMgr::Cleanup()
{_STT();
	// Acquire lock
	CTlLocalLock ll( *this );
	if ( !ll.IsLocked() ) return FALSE;

	BOOL bChanged = FALSE;
	
	// Get the first object
	THList< GUID, CNetCom >::iterator it = NULL;
	while ( ( it = m_lstSession.next( it ) ) != NULL )
	{
		CNetCom* pNc = (*it);

		// Erase this session if invalid
		if ( !pNc || !pNc->IsValid() )
		{
			bChanged = TRUE;

			it = RemoveNode( it );

		} // end if

	} // end while

	return bChanged;
}
开发者ID:aminsyed,项目名称:rulib,代码行数:27,代码来源:NetMgr.cpp

示例13: KargerStep

        void KargerStep()
        {
			auto random_index = rand() % graph_.size();
			auto item = graph_.begin();
			advance(item, random_index);
			auto adj_list = item->second;
			int random_edge = rand() % adj_list.size();
            auto source_node = item->first;
            auto destination_node = adj_list[random_edge];
            if (internal_ == 0)
            {
                internal_++;
                source_node = 1;
                destination_node = 7;
            }
            // Start with node source_node. Merge destination_node into source_node by attaching
            //   node destination_node's adjacency list to node source_node
			AppendAdjacencyList(source_node, destination_node);
            // Scan adjacency lists, and replace node destination_node reference with source_node
            ReplaceNodeReference(destination_node, source_node);
            // Remove all self-loops in source_node's list
            RemoveSelfLoops(source_node);
            // Remove Node 2
            RemoveNode(destination_node);
        }
开发者ID:pax19,项目名称:algorithms,代码行数:25,代码来源:SimpleGraphTests.cpp

示例14: while

inline void SubAllocator::GlueFreeBlocks()
{
  RAR_MEM_BLK s0, * p, * p1;
  int i, k, sz;
  if (LoUnit != HiUnit)
    *LoUnit=0;
  for (i=0, s0.next=s0.prev=&s0;i < N_INDEXES;i++)
    while ( FreeList[i].next )
    {
      p=(RAR_MEM_BLK*)RemoveNode(i);
      p->insertAt(&s0);
      p->Stamp=0xFFFF;
      p->NU=Indx2Units[i];
    }
  for (p=s0.next;p != &s0;p=p->next)
    while ((p1=p+p->NU)->Stamp == 0xFFFF && int(p->NU)+p1->NU < 0x10000)
    {
      p1->remove();
      p->NU += p1->NU;
    }
  while ((p=s0.next) != &s0)
  {
    for (p->remove(), sz=p->NU;sz > 128;sz -= 128, p += 128)
      InsertNode(p,N_INDEXES-1);
    if (Indx2Units[i=Units2Indx[sz-1]] != sz)
    {
      k=sz-Indx2Units[--i];
      InsertNode(p+(sz-k),k-1);
    }
    InsertNode(p,i);
  }
}
开发者ID:alown,项目名称:iViewer,代码行数:32,代码来源:suballoc.cpp

示例15: AsteroidHit

//destroys the asteroid, spawning new ones if necessary
void AsteroidHit(LIST * a, int fromplayershot)
{
   if(a)
   {
      PlaySoundIndex(SND_EXP_ASTEROID);

      SpawnExplosion(NewListNode(&g_explosion_list, sizeof(EXPLOSION)), &(((ASTEROID *)a->d)->pos), (int)(((ASTEROID *)a->d)->scale) * 8);

      if(((ASTEROID *)a->d)->scale > 1.0f)
      {
         if(fromplayershot)
            Score(((ASTEROID *)a->d)->scale > 2.0f ? 20 : 50, &(((ASTEROID *)a->d)->pos));

         SpawnAsteroid(NewListNode(&g_asteroid_list, sizeof(ASTEROID)), &(((ASTEROID *)a->d)->pos), ((ASTEROID *)a->d)->scale * 0.5f);
         SpawnAsteroid(NewListNode(&g_asteroid_list, sizeof(ASTEROID)), &(((ASTEROID *)a->d)->pos), ((ASTEROID *)a->d)->scale * 0.5f);
      }
      else if(fromplayershot)
         Score(100, &(((ASTEROID *)a->d)->pos));

      RemoveNode(a, &g_asteroid_list);

      if(!g_asteroid_list && g_ships)
         g_time_to_reset = RESET_TIME;
   }
}
开发者ID:chazomaticus,项目名称:asteroid,代码行数:26,代码来源:game.c


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