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

Definition at line 555 of file pwrctrl.cc.

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

556 {
557  Configuration conf(argv[0]);
558  conf.SetPrintUsage(PrintUsage);
560  SetupConfiguration(conf);
561 
562  if (!conf.DoParse(argc, argv, PrintHelp))
563  return 127;
564 
565  // No console access at all
566  if (!conf.Has("console"))
567  {
568  if (conf.Get<bool>("no-dim"))
569  return RunShell<LocalStream, StateMachine, ConnectionInterlock>(conf);
570  else
571  return RunShell<LocalStream, StateMachineDim, ConnectionDimWeather>(conf);
572  }
573  // Cosole access w/ and w/o Dim
574  if (conf.Get<bool>("no-dim"))
575  {
576  if (conf.Get<int>("console")==0)
577  return RunShell<LocalShell, StateMachine, ConnectionInterlock>(conf);
578  else
579  return RunShell<LocalConsole, StateMachine, ConnectionInterlock>(conf);
580  }
581  else
582  {
583  if (conf.Get<int>("console")==0)
584  return RunShell<LocalShell, StateMachineDim, ConnectionDimWeather>(conf);
585  else
586  return RunShell<LocalConsole, StateMachineDim, ConnectionDimWeather>(conf);
587  }
588 
589  return 0;
590 }
void SetupConfiguration(Configuration &conf)
Definition: Main.h:25
void PrintUsage()
Definition: pwrctrl.cc:518
void SetupConfiguration(Configuration &conf)
Definition: pwrctrl.cc:493
Commandline parsing, resource file parsing and database access.
Definition: Configuration.h:9
void PrintHelp()
Definition: pwrctrl.cc:533

+ Here is the call graph for this function: