Exemple #1
0
void print_variable_list()
{
    CActions  * actions;
    CAction   * action;
    int printed = 0;
    bool found;

    printf("Action defined Per Message :" SIPP_ENDL);
    printed++;
    found = false;
    for(unsigned int i=0; i<display_scenario->messages.size(); i++) {
        message *curmsg = display_scenario->messages[i];
        actions = curmsg->M_actions;
        if(actions != NULL) {
            switch(curmsg->M_type) {
            case MSG_TYPE_RECV:
                printf("=> Message[%u] (Receive Message) - "
                       "[%d] action(s) defined :" SIPP_ENDL,
                       i,
                       actions->getActionSize());
                printed++;
                break;
            case MSG_TYPE_RECVCMD:
                printf("=> Message[%u] (Receive Command Message) - "
                       "[%d] action(s) defined :" SIPP_ENDL,
                       i,
                       actions->getActionSize());
                printed++;
                break;
            default:
                printf("=> Message[%u] - [%d] action(s) defined :" SIPP_ENDL,
                       i,
                       actions->getActionSize());
                printed++;
                break;
            }

            for(int j=0; j<actions->getActionSize(); j++) {
                action = actions->getAction(j);
                if(action != NULL) {
                    printf("   --> action[%d] = ", j);
                    action->afficheInfo();
                    printf(SIPP_ENDL);
                    printed++;
                    found = true;
                }
            }
        }
    }
    if(!found) {
        printed++;
        printf("=> No action found on any messages"SIPP_ENDL);
    }

    printf(SIPP_ENDL);
    for(unsigned int i=0; i<(display_scenario->messages.size() + 5 - printed); i++) {
        printf(SIPP_ENDL);
    }
}