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

Definition at line 777 of file scheduler.cc.

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

778 {
779  Configuration conf(argv[0]);
780  conf.SetPrintUsage(PrintUsage);
782  SetupConfiguration(conf);
783 
784  po::variables_map vm;
785  try
786  {
787  vm = conf.Parse(argc, argv);
788  }
789 #if BOOST_VERSION > 104000
790  catch (po::multiple_occurrences &e)
791  {
792  cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
793  return -1;
794  }
795 #endif
796  catch (exception& e)
797  {
798  cerr << "Program options invalid due to: " << e.what() << endl;
799  return -1;
800  }
801 
802 // try
803  {
804  // No console access at all
805  if (!conf.Has("console"))
806  {
807  if (conf.Get<bool>("no-dim"))
808  return RunShell<LocalStream, StateMachine>(conf);
809  else
810  return RunShell<LocalStream, StateMachineDim>(conf);
811  }
812  // Cosole access w/ and w/o Dim
813  if (conf.Get<bool>("no-dim"))
814  {
815  if (conf.Get<int>("console")==0)
816  return RunShell<LocalShell, StateMachine>(conf);
817  else
818  return RunShell<LocalConsole, StateMachine>(conf);
819  }
820  else
821  {
822  if (conf.Get<int>("console")==0)
823  return RunShell<LocalShell, StateMachineDim>(conf);
824  else
825  return RunShell<LocalConsole, StateMachineDim>(conf);
826  }
827  }
828 /* catch (std::exception& e)
829  {
830  std::cerr << "Exception: " << e.what() << "\n";
831  }*/
832 
833  return 0;
834 }
void SetupConfiguration(Configuration &conf)
Definition: scheduler.cc:720
void SetupConfiguration(Configuration &conf)
Definition: Main.h:25
void PrintUsage()
Definition: scheduler.cc:756
Commandline parsing, resource file parsing and database access.
Definition: Configuration.h:9

+ Here is the call graph for this function: