void PnpPlanTemplate<PnpPlaceClass, PnpTransitionClass>::fail() { std::map<std::string,std::string>::iterator it = activePlaces.find(getPlanName()); if (it != activePlaces.end()) activePlaces.erase(it); //call end() on each active executable MapSecondArgument<std::string, PnpExecutable, void> callEnd(std::mem_fun(&PnpExecutable::end)); for_each(activeExecutables.begin(), activeExecutables.end(), callEnd); //move them to the inactive map inactiveExecutables.insert(activeExecutables.begin(), activeExecutables.end()); activeExecutables.clear(); }
void* create2(void *f, Tipo ret, unsigned n, Parametro *params){ int i,j,k=0; char *v = (char*)malloc(1024); k = inicia(k,v); printf("k = %d\n",k); printf("ant for\n"); int desl = ultParam(params,n); printf("desl = %d\n", desl); for(i=n-1;i>=0;i--){ printf("dentro for\n"); // AMARAÇÃO LIVRE if(params[i].amarracao == 0){ printf("AMARAÇÃO LIVRE\n"); //DOUBLE if(params[i].tipo == 4){ printf("DOUBLE\n"); printf("desl = %d\n", desl); // CHAMAR livreConstDouble(); k = livreDouble(k,v,desl); desl-=4; } // VOID , INT , CHAR , FLOAT e POINTER else if((params[i].tipo>=0 && params[i].tipo<=3) || (params[i].tipo==5)){ printf("NOT DOUBLE\n"); printf("desl = %d\n", desl); // CHAMAR livreNotDouble(); k = livreNotDouble(k,v,desl); } else{ printf("DEU PAU 1\n"); } } // AMARAÇÃO CONSTANTE else if(params[i].amarracao == 1){ printf("AMARAÇÃO CONSTANTE\n"); //DOUBLE if(params[i].tipo == 4){ printf("DOUBLE\n"); printf("desl = %d\n", desl); // CHAMAR livreConstDouble(); k = constDouble(k,v,desl,params[i].valor.vDouble); } // VOID , INT , CHAR , FLOAT e POINTER else if((params[i].tipo>=0 && params[i].tipo<=3) || (params[i].tipo==5)){ printf("NOT DOUBLE \n"); printf("desl = %d\n", desl); // CHAMAR constNotDouble(); //v[k] = descobrevalor(params[i]); // push valor if(params[i].tipo == CHAR){ v[k] = params[i].valor.vChar; } else if(params[i].tipo == FLOAT){ v[k] = params[i].valor.vFloat; } else if(params[i].tipo == INT){ v[k] = params[i].valor.vInt; } else if(params[i].tipo == DOUBLE){ v[k] = params[i].valor.vDouble; } else if(params[i].tipo == POINTER){ //v[k] = params[i].valor.vPointer; } else printf("DEU PAU\n"); //k++; } else printf("DEU PAU 2\n"); } // AMARAÇÃO FUNÇÃO else if(params[i].amarracao == 2){ //DOUBLE if(params[i].tipo == 4){ //v[k]= ;//asdas //k++; } // VOID , INT , CHAR , FLOAT e POINTER else if((params[i].tipo>=0 && params[i].tipo<=3) || (params[i].tipo==5)){ } else printf("DEU PAU 3\n"); } else printf("DEU PAU 4\n"); if(params[i].amarracao != 1){ desl-=4; } } k=callEnd(f,v,k); printf("FINAL create\n"); return v; }