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

Definition at line 611 of file tngweather.cc.

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

612 {
613  Configuration conf(argv[0]);
614  conf.SetPrintUsage(PrintUsage);
616  SetupConfiguration(conf);
617 
618  if (!conf.DoParse(argc, argv, PrintHelp))
619  return 127;
620 
621  //try
622  {
623  // No console access at all
624  if (!conf.Has("console"))
625  {
626  if (conf.Get<bool>("no-dim"))
627  return RunShell<LocalStream, StateMachine, ConnectionWeather>(conf);
628  else
629  return RunShell<LocalStream, StateMachineDim, ConnectionDimWeather>(conf);
630  }
631  // Cosole access w/ and w/o Dim
632  if (conf.Get<bool>("no-dim"))
633  {
634  if (conf.Get<int>("console")==0)
635  return RunShell<LocalShell, StateMachine, ConnectionWeather>(conf);
636  else
637  return RunShell<LocalConsole, StateMachine, ConnectionWeather>(conf);
638  }
639  else
640  {
641  if (conf.Get<int>("console")==0)
642  return RunShell<LocalShell, StateMachineDim, ConnectionDimWeather>(conf);
643  else
644  return RunShell<LocalConsole, StateMachineDim, ConnectionDimWeather>(conf);
645  }
646  }
647  /*catch (std::exception& e)
648  {
649  cerr << "Exception: " << e.what() << endl;
650  return -1;
651  }*/
652 
653  return 0;
654 }
void SetupConfiguration(Configuration &conf)
Definition: tngweather.cc:550
void PrintUsage()
Definition: tngweather.cc:574
void SetupConfiguration(Configuration &conf)
Definition: Main.h:25
void PrintHelp()
Definition: tngweather.cc:589
Commandline parsing, resource file parsing and database access.
Definition: Configuration.h:9

+ Here is the call graph for this function: