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

GuiTestAlg.cxx

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/GuiSvc/src/test/GuiTestAlg.cxx,v 1.2 2001/04/18 21:01:22 burnett Exp $
00002 
00003 // Include files
00004 #include "GuiTestAlg.h"
00005 #include "GuiSvc/IGuiSvc.h"
00006 
00007 #include "GaudiKernel/MsgStream.h"
00008 #include "GaudiKernel/AlgFactory.h"
00009 
00010 #include "src/test/Demo.h"
00011 #include "gui/GuiMgr.h"
00012  
00013 static const AlgFactory<GuiTestAlg>  Factory;
00014 const IAlgFactory& GuiTestAlgFactory = Factory;
00015 
00016 
00017 //------------------------------------------------------------------------------
00018 //
00019 GuiTestAlg::GuiTestAlg(const std::string& name, ISvcLocator* pSvcLocator) :
00020 Algorithm(name, pSvcLocator), m_guiMgr(0), m_demo(0) {
00021  
00022 }
00023 
00024 
00025 //------------------------------------------------------------------------------
00027 StatusCode GuiTestAlg::initialize() {
00028     
00029     MsgStream log(msgSvc(), name());
00030     log << MSG::INFO << "initialize" << endreq;
00031     
00032     // Use the Job options service to set the Algorithm's parameters
00033     setProperties();
00034 
00035     // get the pointer to the GUI Service 
00036     IGuiSvc* gsvc=0;
00037 
00038     // get the service
00039     StatusCode sc = service("GuiSvc", gsvc);
00040     
00041     if( sc.isFailure()) {
00042         log << MSG::ERROR << "Could not find GuiSvc" << endreq;
00043         return sc;
00044     }
00045     // now get the gui manager and set up the demo from gui.
00046     m_guiMgr = gsvc->guiMgr();
00047 
00048     m_demo = new Demo(m_guiMgr->display());
00049 
00050     return sc;
00051 }
00052 
00053 
00054 //------------------------------------------------------------------------------
00055 StatusCode GuiTestAlg::execute() {
00056     
00057     StatusCode  sc = StatusCode::SUCCESS;
00058     MsgStream   log( msgSvc(), name() );
00059 
00060     // have the demo object do its thing.
00061     m_demo->process();
00062     return sc;
00063 }
00064 
00065 
00066 //------------------------------------------------------------------------------
00067 StatusCode GuiTestAlg::finalize() {
00068     
00069     delete m_demo;
00070     return StatusCode::SUCCESS;
00071 }
00072 
00073 
00074 
00075 
00076 
00077 

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