Example #1
0
//-----------------------------------------------------------
void ClasseOperadores::adicionarElementoClasse(ElemClasseOperadores elemento)
{
 //Verifica se um elemento igual já não existe na lista de elementos
 if(elementoExiste(elemento))
  throw Excecao(ERR_PGMODELER_INSELEMDUPLIC,__PRETTY_FUNCTION__,__FILE__,__LINE__);

 elementos.push_back(elemento);
}
Example #2
0
void InsertIDtable(Lista *IDlist, int type)
{
	if(listaVazia(&IDtable))
		InitLista(&IDtable, sizeof(tableNode));

	tableNode aux;
	while(removeDoInicio(IDlist, aux.id) == 1)
	{
		if(elementoExiste(IDlist, aux.id, CompareID))
		{
			printf("<Error> in InsertIDtable(Lista *IDlist, int type)\n");
			exit(0);
		}
		else
		{
			static int i = 0;

			aux.pos 	 = ++i; 
			aux.type 	 = type;

			insereNoFim(&IDtable, &aux);
		}
	}
}