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

Definition at line 562 of file gpsctrl.cc.

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

563 {
564  Configuration conf(argv[0]);
565  conf.SetPrintUsage(PrintUsage);
567  SetupConfiguration(conf);
568 
569  if (!conf.DoParse(argc, argv, PrintHelp))
570  return 127;
571 
572  // No console access at all
573  if (!conf.Has("console"))
574  {
575  if (conf.Get<bool>("no-dim"))
576  return RunShell<LocalStream, StateMachine, ConnectionGPS>(conf);
577  else
578  return RunShell<LocalStream, StateMachineDim, ConnectionDimWeather>(conf);
579  }
580  // Cosole access w/ and w/o Dim
581  if (conf.Get<bool>("no-dim"))
582  {
583  if (conf.Get<int>("console")==0)
584  return RunShell<LocalShell, StateMachine, ConnectionGPS>(conf);
585  else
586  return RunShell<LocalConsole, StateMachine, ConnectionGPS>(conf);
587  }
588  else
589  {
590  if (conf.Get<int>("console")==0)
591  return RunShell<LocalShell, StateMachineDim, ConnectionDimWeather>(conf);
592  else
593  return RunShell<LocalConsole, StateMachineDim, ConnectionDimWeather>(conf);
594  }
595 
596  return 0;
597 }
void PrintUsage()
Definition: gpsctrl.cc:525
void SetupConfiguration(Configuration &conf)
Definition: Main.h:25
void SetupConfiguration(Configuration &conf)
Definition: gpsctrl.cc:503
Commandline parsing, resource file parsing and database access.
Definition: Configuration.h:9
void PrintHelp()
Definition: gpsctrl.cc:540

+ Here is the call graph for this function: