FACT++  1.0
int main ( int  argc,
const char *  argv[] 
)

Definition at line 519 of file magicweather.cc.

References Configuration::DoParse(), Configuration::Get(), Configuration::Has(), PrintHelp(), PrintUsage(), Configuration::SetPrintUsage(), Main::SetupConfiguration(), and SetupConfiguration().

520 {
521  Configuration conf(argv[0]);
522  conf.SetPrintUsage(PrintUsage);
524  SetupConfiguration(conf);
525 
526  if (!conf.DoParse(argc, argv, PrintHelp))
527  return 127;
528 
529  //try
530  {
531  // No console access at all
532  if (!conf.Has("console"))
533  {
534  if (conf.Get<bool>("no-dim"))
535  return RunShell<LocalStream, StateMachine, ConnectionWeather>(conf);
536  else
537  return RunShell<LocalStream, StateMachineDim, ConnectionDimWeather>(conf);
538  }
539  // Cosole access w/ and w/o Dim
540  if (conf.Get<bool>("no-dim"))
541  {
542  if (conf.Get<int>("console")==0)
543  return RunShell<LocalShell, StateMachine, ConnectionWeather>(conf);
544  else
545  return RunShell<LocalConsole, StateMachine, ConnectionWeather>(conf);
546  }
547  else
548  {
549  if (conf.Get<int>("console")==0)
550  return RunShell<LocalShell, StateMachineDim, ConnectionDimWeather>(conf);
551  else
552  return RunShell<LocalConsole, StateMachineDim, ConnectionDimWeather>(conf);
553  }
554  }
555  /*catch (std::exception& e)
556  {
557  cerr << "Exception: " << e.what() << endl;
558  return -1;
559  }*/
560 
561  return 0;
562 }
void SetupConfiguration(Configuration &conf)
Definition: Main.h:25
void PrintUsage()
Commandline parsing, resource file parsing and database access.
Definition: Configuration.h:9
void PrintHelp()
void SetupConfiguration(Configuration &conf)

+ Here is the call graph for this function: