Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

GuiMain.cxx

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/GuiSvc/src/GuiMain.cxx,v 1.6 2001/07/14 01:08:49 igable Exp $
00002 
00003 // Include files
00004 #include "GaudiKernel/SmartIF.h"
00005 #include "GaudiKernel/Bootstrap.h"
00006 #include "GaudiKernel/IAppMgrUI.h"
00007 #include "GaudiKernel/IProperty.h"
00008 #include "GaudiKernel/IJobOptionsSvc.h"
00009 #include "GaudiKernel/System.h"
00010 //------------------------------------------------------------------------------
00011 //
00012 //  Package    : GuiSvc
00013 //
00014 //  Description: Graphics Main Program
00015 //
00016 //------------------------------------------------------------------------------
00025 // declare function that may reduce the execution priority
00026 //void setPriority();
00027 
00028 int main( int argn, char** argc) {
00029     
00030     std::string joboptions_file="src/jobOptions.txt"; // default
00031     
00032     const char* job = ::getenv("JOBOPTIONS"); // check for env var
00033     
00034     if( argn>1 ) { joboptions_file = argc[1];} // priority to command arg.
00035     else if( job ) { joboptions_file = job; }
00036     std::cerr << "Starting Glast-Gaudi job with job options file " 
00037         << joboptions_file << std::endl;
00038     
00039     
00040     // Create an instance of an application manager
00041     IInterface* iface = Gaudi::createApplicationMgr();
00042     
00043     SmartIF<IProperty>     propMgr ( IID_IProperty, iface );
00044     SmartIF<IAppMgrUI>     appMgr  ( IID_IAppMgrUI, iface );
00045     
00046     // Set properties of algorithms and services
00047     StatusCode status = StatusCode::SUCCESS;
00048     if ( iface && propMgr == iface )    {
00049         status = propMgr->setProperty( "JobOptionsPath", joboptions_file );
00050     }
00051     else  {
00052         exit(-1);
00053     }
00054     
00055     // Run the application manager and process events
00056     if ( appMgr )   {
00057       //setPriority();
00058         status = appMgr->run();
00059     }
00060     else  {
00061         return 0;
00062     }
00063     // All done - exit
00064     return 0;
00065     
00066 }

Generated at Wed Nov 21 12:20:16 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000