slic/src
diff -u -r1.6 -r1.7
--- SlicMain.cc 27 Nov 2012 19:32:19 -0000 1.6
+++ SlicMain.cc 28 Nov 2012 01:40:48 -0000 1.7
@@ -1,10 +1,9 @@
-// $Id: SlicMain.cc,v 1.6 2012/11/27 19:32:19 jeremy Exp $
+// $Id: SlicMain.cc,v 1.7 2012/11/28 01:40:48 jeremy Exp $
#include "SlicMain.hh"
// slic
#include "SlicApplication.hh"
-//#include "TimeUtil.hh"
// geant4
#include "G4RunManager.hh"
@@ -30,35 +29,36 @@
// Top-level try block.
#ifdef SLIC_CATCH_STD_EXCEPTIONS
try {
+ std::cout << "SLIC is enabled to catch std exceptions." << std::endl;
#endif
- // Create the SLIC application using the singleton function.
- slicApp = SlicApplication::instance();
+ // Create the SLIC application using the singleton function.
+ slicApp = SlicApplication::instance();
- // Setup the command line arguments.
- slicApp->initialize(argc, argv);
+ // Setup the command line arguments.
+ slicApp->initialize(argc, argv);
- // Run the simulator.
- slicApp->run();
+ // Run the app.
+ slicApp->run();
- // Get the application return code.
- returnCode = slicApp->getReturnCode();
-
- // Delete the application.
- if (slicApp) {
- delete slicApp;
- }
+ // Get the application return code.
+ returnCode = slicApp->getReturnCode();
+
+ // Delete the application.
+ if (slicApp) {
+ delete slicApp;
+ }
#ifdef SLIC_CATCH_STD_EXCEPTIONS
// Catch a generic std::exception.
-} catch(std::exception& stde) {
- log() << LOG::error << LOG::head << stde.what() << LOG::done;
- returnCode = SlicApplication::STD_EXCEPTION;
-}
-// Catch an unknown exception.
-catch(...) {
- log() << LOG::error << LOG::head << "Top-level catch block caught an unknown exception!" << LOG::done;
- returnCode = SlicApplication::UNKNOWN_EXCEPTION;
-}
+ } catch(std::exception& stde) {
+ log() << LOG::error << LOG::head << stde.what() << LOG::done;
+ returnCode = SlicApplication::STD_EXCEPTION;
+ }
+ // Catch an unknown exception.
+ catch(...) {
+ log() << LOG::error << LOG::head << "Top-level catch block caught an unknown exception!" << LOG::done;
+ returnCode = SlicApplication::UNKNOWN_EXCEPTION;
+ }
#endif
return returnCode;