Ignore:
Timestamp:
Jul 10, 2012, 1:15:51 PM (13 years ago)
Author:
Frederik Heber <heber@…>
Children:
ab755a
Parents:
52aacc
git-author:
Frederik Heber <heber@…> (07/08/12 19:56:08)
git-committer:
Frederik Heber <heber@…> (07/10/12 13:15:51)
Message:

Extracted actual work out of try_main() into own function.

  • now only command-lime arguments parsing remains in try_main().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/bin/mpqc/mpqc.cc

    r52aacc rce1e39  
    11281128}
    11291129
     1130void Work(ostream *&outstream, struct OptionValues &values, const char *&input, const char *&generic_input, int argc, char **argv);
     1131
    11301132int
    11311133try_main(int argc, char *argv[])
     
    11771179  parseRemainderOptions(options, values, argc, argv);
    11781180
    1179   // get the message group.  first try the commandline and environment
    1180   Ref<MessageGrp> grp;
    1181   getMessageGroup(grp, argc, argv);
    1182 
    11831181  // get input file names, either object-oriented or generic
    11841182  const char *object_input = 0;
     
    11891187  if (generic_input) input = generic_input;
    11901188
     1189  // get the basename for output files
     1190  setOutputBaseName(input, output);
     1191
     1192  // now comes the actual work
     1193  Work(outstream, values, input, generic_input, argc, argv);
     1194
     1195  if (output != 0) {
     1196    ExEnv::set_out(&cout);
     1197    delete outstream;
     1198  }
     1199
     1200  return 0;
     1201}
     1202
     1203void Work(ostream *&outstream, struct OptionValues &values, const char *&input, const char *&generic_input, int argc, char **argv)
     1204{
     1205  // get the message group.  first try the commandline and environment
     1206  Ref<MessageGrp> grp;
     1207  getMessageGroup(grp, argc, argv);
     1208
    11911209  // parse input into keyvalue container
    11921210  Ref<ParsedKeyVal> parsedkv;
    11931211  parseInputfile(grp, parsedkv, values, input, generic_input);
     1212
     1213  // prefix parsed values wit "mpqc"
    11941214  if (values.keyvalue) parsedkv->verbose(1);
    11951215  Ref<KeyVal> keyval = new PrefixKeyVal(parsedkv.pointer(),"mpqc");
    1196 
    1197   // get the basename for output files
    1198   setOutputBaseName(input, output);
    11991216
    12001217  // set up output classes
     
    14871504  ExEnv::out0() << endl
    14881505               << indent << scprintf("End Time: %s", tstr) << endl;
    1489 
    1490   if (output != 0) {
    1491     ExEnv::set_out(&cout);
    1492     delete outstream;
    1493   }
    1494 
    1495   return 0;
    14961506}
    14971507
Note: See TracChangeset for help on using the changeset viewer.