Ignore:
Timestamp:
04/09/15 23:51:28 (9 years ago)
Author:
Maciej Komosinski
Message:
  • explicit c_str() in SString instead of (const char*) cast
  • genetic converters and GenMan? are now thread-local which enables multi-threaded simulator separation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/f0_variants_test.cpp

    r286 r348  
    7979DefaultGenoConvManager gcm;
    8080gcm.addDefaultConverters();
    81 Geno::useConverters(gcm);
     81Geno::useConverters(&gcm);
    8282
     83Geno::Validators validators;
     84Geno::useValidators(&validators);
    8385ModelGenoValidator model_validator;
    84 Geno::addValidator(&model_validator); //This simple validator handles all cases where a converter for a particular format is available but there is no genetic operator. Converters may be less strict in detecting invalid genotypes but it is better than nothing
     86validators+=&model_validator; //This simple validator handles all cases where a converter for a particular format is available but there is no genetic operator. Converters may be less strict in detecting invalid genotypes but it is better than nothing
    8587
    8688SString gen(argc>1?argv[1]:"X[|G:1.23]");
    87 if (!strcmp(gen,"-"))
     89if (!strcmp(gen.c_str(),"-"))
    8890        {
    8991        gen=0;
     
    9294        }
    9395Geno g(gen);
    94 printf("\nSource genotype: '%s'\n",(const char*)g.getGene());
     96printf("\nSource genotype: '%s'\n",g.getGene().c_str());
    9597printf("                  ( format %c %s)\n",
    96        g.getFormat(), (const char*)g.getComment());
     98       g.getFormat(), g.getComment().c_str());
    9799
    98100Model m(g);//.getConverted('0'));
     
    112114save_as_f0(f0_no_skipping_defaults,m,false);
    113115
    114 printf("\n==== with defdata (skips default values) ======\n%s\n",(const char*)f0_skipping_defaults);
    115 printf("\n==== without defdata (saves all fields) ======\n%s\n",(const char*)f0_no_skipping_defaults);
     116printf("\n==== with defdata (skips default values) ======\n%s\n",f0_skipping_defaults.c_str());
     117printf("\n==== without defdata (saves all fields) ======\n%s\n",f0_no_skipping_defaults.c_str());
    116118
    117119return 0;
Note: See TracChangeset for help on using the changeset viewer.