Exemplo n.º 1
0
//从队列总弹出第一个元素
int CNEOPopBuffer::GetAndDeleteFirst(char *szBuffer,int nBufferSize)
{
    if(!ICanWork())
        return 0;
    int nRet=GetFirst(szBuffer,nBufferSize);//获得第一个元素
    DeleteFirst();
    return nRet;
}
Exemplo n.º 2
0
//---------------------------------------------------------
// Destructor
//---------------------------------------------------------
MLStubCache::~MLStubCache()
{
    MLCHASHENTRY *phe = (MLCHASHENTRY*)GetFirst();
    while (phe) {
        phe->m_pMLStub->DecRef();
        phe = (MLCHASHENTRY*)GetNext((BYTE*)phe);
    }
}
Exemplo n.º 3
0
ValueList::~ValueList()
{
    Value* pvalue = GetFirst();
    while (pvalue) {
        pvalue->RemoveParent(this);
        pvalue = GetNext();
    }
}
Exemplo n.º 4
0
void __fastcall TScreenSpy::Execute()
{
    while (!Terminated && FSocket->State == wsConnected)
    {
        if (CheckScr()) GetFirst(); else GetNext();
        Sleep(30);
    }
}
Exemplo n.º 5
0
	// use this to display debug information about vehicle 
	void Debug () const
	{
		for (dListNode* ptr = GetFirst(); ptr; ptr = ptr->GetNext()) {
			CustomVehicleController* const controller = &ptr->GetInfo();
			BasicCarEntity* const vehicleEntity = (BasicCarEntity*)NewtonBodyGetUserData (controller->GetBody());
			vehicleEntity->Debug();
		}
	}
Exemplo n.º 6
0
	dgInt32 GetMemoryUsed () const
	{
		dgInt32 mem = m_memoryUsed;
		for (dgList<dgMemoryAllocator*>::dgListNode* node = GetFirst(); node; node = node->GetNext()) {
			mem += node->GetInfo()->GetMemoryUsed();
		}
		return mem;
	}
void SCH_SHEET_LIST::ClearModifyStatus()
{
    for( SCH_SHEET_PATH* sheet = GetFirst(); sheet; sheet = GetNext() )
    {
        if( sheet->LastScreen() )
            sheet->LastScreen()->ClrModify();
    }
}
	virtual ~FractureEffect()
	{
		for (dListNode* node = GetFirst(); node; node = node->GetNext()) {
			FractureAtom& atom = node->GetInfo();
			NewtonDestroyCollision(atom.m_collision);
			atom.m_mesh->Release();
		}
	}
Exemplo n.º 9
0
int CNEOPopBuffer::GetAndDeleteFirst(CNEOStaticBuffer *pBuffer)
{
    if(!ICanWork())
        return 0;
    int nRet=GetFirst(pBuffer);
    DeleteFirst();
    return nRet;
}
	~ShatterEffect()
	{
		for (dListNode* node = GetFirst(); node; node = node->GetNext()) {
			ShatterAtom& atom = node->GetInfo();
			NewtonReleaseCollision (m_world, atom.m_collision);
			atom.m_mesh->Release();
		}
	}
dNewtonTriggerManager::dNewtonTrigger* dNewtonTriggerManager::GetFirstTrigger() const
{
	dListNode* const node = GetFirst();
	if (node) {
		return (dNewtonTriggerManager::dNewtonTrigger*) NewtonBodyGetUserData (node->GetInfo().GetBody());
	}
	return NULL;
}
Exemplo n.º 12
0
int32_t Screen::GetMouseControlledDialogCount()
	{
	Dialog *pDlg; int32_t iResult=0;
	for (Element *pEl = GetFirst(); pEl; pEl = pEl->GetNext())
		if (pDlg = pEl->GetDlg())
			if (pDlg->IsShown() && pDlg->IsMouseControlled())
				++iResult;
	return iResult;
	}
Exemplo n.º 13
0
void BaseSystem::InitSystems ()
{
	BaseSystem* it ( GetFirst () );
	while( it != nullptr )
	{
		it->Init ();
		GetNext ( it );
	}
}
Exemplo n.º 14
0
void BaseSystem::TryLoadSystems ()
{
	BaseSystem* it ( GetFirst () );
	while( it != nullptr )
	{
		it->SetActive ( true );
		GetNext ( it );
	}
}
Exemplo n.º 15
0
void BaseSystem::TryUnloadSystems ()
{
	BaseSystem* it ( GetFirst () );
	while( it != nullptr )
	{
		if( ! it->GotJob () ) it->SetActive ( false );
		GetNext ( it );
	}
}
Exemplo n.º 16
0
void BaseSystem::UnloadAllSystems ()
{
	BaseSystem* it ( GetFirst () );
	while( it != nullptr )
	{
		it->SetActive ( false );
		GetNext ( it );
	}
}
Exemplo n.º 17
0
	bool FindOperator(dCRCTYPE symbol) const
	{
		for (dListNode* node = GetFirst(); node; node = node->GetNext()) {
			if (symbol == node->GetInfo()) {
				return true;
			}
		}
		return false;
	}
dNewtonArticulationManager::dNewtonArticulationController* dNewtonArticulationManager::GetFirstController() const
{
	dAssert (0);
	dListNode* const node = GetFirst();
	if (node) {
		return (dNewtonArticulationManager::dNewtonArticulationController*) NewtonBodyGetUserData (node->GetInfo().GetBody());
	}
	return NULL;
}
Exemplo n.º 19
0
const wxFilterClassFactory *
wxFilterClassFactory::Find(const wxString& protocol, wxStreamProtocolType type)
{
    for (const wxFilterClassFactory *f = GetFirst(); f; f = f->GetNext())
        if (f->CanHandle(protocol, type))
            return f;

    return NULL;
}
SCH_ITEM* SCH_SHEET_LIST::FindNextItem( KICAD_T aType, SCH_SHEET_PATH** aSheetFoundIn,
                                        SCH_ITEM* aLastItem, bool aWrap )
{
    bool hasWrapped = false;
    bool firstItemFound = false;

    SCH_ITEM*       drawItem = NULL;
    SCH_SHEET_PATH* sheet = GetFirst();

    while( sheet )
    {
        drawItem = sheet->LastDrawList();

        while( drawItem )
        {
            if( drawItem->Type() == aType )
            {
                if( aLastItem == NULL || firstItemFound )
                {
                    if( aSheetFoundIn )
                        *aSheetFoundIn = sheet;

                    return drawItem;
                }
                else if( !firstItemFound && drawItem == aLastItem )
                {
                    firstItemFound = true;
                }
            }

            drawItem = drawItem->Next();
        }

        sheet = GetNext();

        if( sheet == NULL && aLastItem && aWrap && !hasWrapped )
        {
            hasWrapped = true;
            sheet = GetFirst();
        }
    }

    return NULL;
}
Exemplo n.º 21
0
int Table::ReadTableConsole(const char* sFileName)
{
	int ndim;
	int dim[MAXDIMENS];
	int s;
	double rs;
	int i, j;
	
	printf("Number of Dimensions :: ");
	if(!scanf("%d", &s))
	{
		return 0;
	}
	if(s > MAXDIMENS)
	{
		printf("Increase MAXDIMENS!\n");
		return 0;
	}
	ndim = s;
    //read the dimensions
	for(i=0; i<ndim; i++)
	{
		printf("Index %d :: ", i+1);
		if(!scanf("%d", &s))
		{
			return 0;
		}
		dim[i] = s;
	}
	if(!Alloc(dim, ndim))
	{
		return 0;
	}
	
	int NotFinished = 1;
	GetFirst();
	for(i=0; i<Total; i++)
	{
		printf("(");
		for(j=0; j<nDimens-1; j++)
		{
			printf("%d,", Index[j]+1);
		}
		printf("%d) :: ", Index[nDimens-1]+1);
		if(!scanf("%lf", &rs))
		{
			return 0;
		}
		Data[i] = rs;
		if(NotFinished)
		{
			NotFinished = GetNext();
		}
	}
	return WriteTable(sFileName);
}
Exemplo n.º 22
0
void dBasicBlocksGraph::CalculateSuccessorsAndPredecessors ()
{
	m_mark += 1;
	dList<dBasicBlock*> stack;
	stack.Append(&GetFirst()->GetInfo());

	while (stack.GetCount()) {
		dBasicBlock* const block = stack.GetLast()->GetInfo();

		stack.Remove(stack.GetLast()->GetInfo());
		if (block->m_mark < m_mark) {

			block->m_mark = m_mark;
			//m_traversalBlocksOrder.Addtop(block);
//block->Trace();

			dCILInstr* const instruction = block->m_end->GetInfo();
			dAssert(instruction->IsBasicBlockEnd());
			if (instruction->GetAsIF()) {
				dCILInstrConditional* const ifInstr = instruction->GetAsIF();

				dAssert (ifInstr->GetTrueTarget());
				dAssert (ifInstr->GetFalseTarget());

				dCILInstrLabel* const target0 = ifInstr->GetTrueTarget()->GetInfo()->GetAsLabel();
				dCILInstrLabel* const target1 = ifInstr->GetFalseTarget()->GetInfo()->GetAsLabel();

				dBasicBlock* const block0 = target0->m_basicBlock;
				dAssert (block0);
				block->m_successors.Append (block0);
				block0->m_predecessors.Append(block);
				stack.Append (block0);

				dBasicBlock* const block1 = target1->m_basicBlock;
				dAssert(block1);
				block->m_successors.Append(block1);
				block1->m_predecessors.Append(block);
				stack.Append(block1);

			} else if (instruction->GetAsGoto()) {
				dCILInstrGoto* const gotoInst = instruction->GetAsGoto();

				dAssert(gotoInst->GetTarget());
				dCILInstrLabel* const target = gotoInst->GetTarget()->GetInfo()->GetAsLabel();
				dBasicBlock* const block0 = target->m_basicBlock;

				dAssert(block0);
				block->m_successors.Append(block0);
				block0->m_predecessors.Append(block);
				stack.Append(block0);
			}
		}
	}

	DeleteUnreachedBlocks();
}
Exemplo n.º 23
0
void *wxListBase::FirstThat(wxListIterateFunction F)
{
    for ( wxNodeBase *current = GetFirst(); current; current = current->GetNext() )
    {
        if ( (*F)(current->GetData()) )
            return current->GetData();
    }

    return NULL;
}
Exemplo n.º 24
0
CString CFunctionCollection::SymbolsProvided() {
  CString result;
  COHScriptObject *p_oh_script_object = GetFirst();
  while (p_oh_script_object != NULL) {
    result += p_oh_script_object->name(); 
    result += " ";
    p_oh_script_object = GetNext();  
  }
  return result;
}
Exemplo n.º 25
0
void CFunctionCollection::ClearCache() {
  CSLock lock(m_critsec);
  COHScriptObject *p_oh_script_object = GetFirst();
  while (p_oh_script_object != NULL) {
    if (p_oh_script_object->IsFunction() || p_oh_script_object->IsOpenPPLSymbol()) {
      ((CFunction*)p_oh_script_object)->ClearCache();
    }
    p_oh_script_object = GetNext();
  }
}
Exemplo n.º 26
0
int BuildConnections(LISTE *PLC_List)
{	
	ELEMENT *elt=GetFirst(PLC_List);
	if (elt!=NULL) do
	{	
		PLC *plc=elt->Data;
		if (BuildSession(plc)) BuildConnection(plc);
	} while ((elt=GetNext(PLC_List,elt))!=NULL);
	return(CONNECTIONs.Count);
}
void dgDeformableBodiesUpdate::SolveConstraintsAndIntegrate (dgFloat32 timestep)
{
    for (dgListNode* node = GetFirst(); node; node = node->GetNext()) {
        dgCollisionDeformableMesh* const softShape = node->GetInfo();

        if (softShape->GetBody()) {
            softShape->ResolvePositionsConstraints (timestep);
        }
    }
}
void dgDeformableBodiesUpdate::ApplyExternaForces(dgFloat32 timestep)
{
    for (dgListNode* node = GetFirst(); node; node = node->GetNext()) {
        dgCollisionDeformableMesh* const softShape = node->GetInfo();

        if (softShape->GetBody()) {
            softShape->ApplyExternalForces (timestep);
        }
    }
}
void dBonesToPoseBinding::UpdatePose() const
{
	if (m_updateCallback) {
		for (dListNode* node = GetFirst(); node; node = node->GetNext()) {
			dBindFrameToNode& bindFrame = node->GetInfo();
			m_updateCallback (bindFrame.m_userData, &bindFrame.m_sourceTranform->m_posit[0], &bindFrame.m_sourceTranform->m_rotation.m_q0); 
//break;
		}
	}
}
Exemplo n.º 30
0
wxResourceCache::~wxResourceCache ()
{
    wxList::compatibility_iterator node = GetFirst ();
    while (node) {
        wxObject *item = (wxObject *)node->GetData();
        delete item;

        node = node->GetNext ();
    }
}