本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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();
}
示例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);
}
示例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
示例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 ) ;
}
示例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;
}
示例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;
}
}
}
示例10: FullRemoveNode
void FullRemoveNode(HWND hwnd)
{
unsigned short tag;
for (tag=0; tag<TAGS; tag++)
RemoveNode(hwnd, tag);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例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;
}
}