Logo Search packages:      
Sourcecode: tablix2 version File versions  Download package

void parser_addtable ( table tab  ) 

Saves definitions of variable resources for all events in the table struct to the XML tree.

Any previous definitions of variable resources are replaced.

tab Pointer to the table struct.

Definition at line 986 of file xmlsup.c.

References table_t::chr, config, dat_restype, dat_typenum, table_t::fitness, chromo_t::gen, parser_clean(), parser_event_add_res(), parser_getprop_int(), parser_newprop_int(), parser_remove_repeats(), resourcetype_t::res, and resourcetype_t::var.

{
        xmlNodePtr cur, root;
      xmlNodePtr events=NULL;
      int n;

      resourcetype *restype;
      resource *res;
      int resid;
      int tupleid;

      assert(tab!=NULL);

        root=xmlDocGetRootElement(config);

      parser_newprop_int(root, "fitness", tab->fitness);

        cur=root->children;
        while(cur!=NULL) {
                if (!strcmp(cur->name, "events")) events=cur;
                cur=cur->next;
        }

      assert(events!=NULL);

      parser_remove_repeats(events->children);

      cur=events->children;
      while(cur!=NULL) {
                if (!strcmp(cur->name, "event")) {
                  parser_clean(cur);
                  tupleid=parser_getprop_int(cur, "tupleid");
                  assert(parser_getprop_int(cur, "repeats")==1);

                  for(n=0;n<dat_typenum;n++) {
                        restype=&dat_restype[n];

                        if(!restype->var) continue;

                        resid=tab->chr[n].gen[tupleid];
                        res=&restype->res[resid];

                        parser_event_add_res(cur, res);
                  }
                }
            cur=cur->next;
      }

}


Generated by  Doxygen 1.6.0   Back to index