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

ApplicationMgr.h

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/GaudiSvc/src/ApplicationMgr/ApplicationMgr.h,v 1.1.1.3 2001/04/18 18:32:48 tlindner Exp $      //
00002 #ifndef GAUDI_APPLICATIONMGR_H
00003 #define GAUDI_APPLICATIONMGR_H 
00004 
00005 #include "GaudiKernel/Kernel.h"
00006 #include "GaudiKernel/IAppMgrUI.h"
00007 #include "GaudiKernel/ISvcLocator.h"
00008 #include "GaudiKernel/IObjManager.h"
00009 #include "GaudiKernel/ISvcManager.h"
00010 #include "GaudiKernel/IAlgManager.h"
00011 #include "GaudiKernel/ICnvManager.h"
00012 #include "GaudiKernel/IClassManager.h"
00013 #include "GaudiKernel/IEventProcessor.h"
00014 #include "GaudiKernel/IProperty.h"
00015 #include "GaudiKernel/PropertyMgr.h"
00016 
00017 // STL include files
00018 #include <list>
00019 #include <vector>
00020 
00021 // Forward declarations
00022 class ServiceFactory;
00023 class AlgorithmFactory;
00024 class ConverterFactory;
00025 class DLLClassManager;
00026 
00027 class IMessageSvc;
00028 class IIncidentSvc;
00029 class IRunable;
00030 class IDataManagerSvc;
00031 class IConversionSvc;
00032 
00045 class ApplicationMgr : virtual public IAppMgrUI,
00046                        virtual public ISvcLocator,
00047                        virtual public ISvcManager,
00048                        virtual public IAlgManager,
00049                        virtual public ICnvManager,
00050                        virtual public IObjManager,
00051                        virtual public IEventProcessor,
00052                        virtual public IProperty,
00053                        virtual public IClassManager {
00054 public:
00055   typedef std::list<IService*>     ListSvc;
00056   typedef std::list<std::string>   ListName;
00057   typedef std::vector<std::string> VectorName;
00058 
00059 public:
00060   
00061   // default creator
00062   ApplicationMgr(IInterface* = 0);
00063   // virtual destructor
00064   virtual ~ApplicationMgr();
00065 
00066   // implmentation of IInterface::addRef
00067   virtual unsigned long addRef();
00068   // implmentation of IInterface::release
00069   virtual unsigned long release();
00070   // implementation of IInterface::queryInterface
00071   virtual StatusCode queryInterface(const IID& iid, void** pinterface);
00072 
00073   // implementation of IAppMgrUI::run
00074   virtual StatusCode run();
00075   // implementation of IAppMgrUI::configure
00076   virtual StatusCode configure();
00077   // implementation of IAppMgrUI::terminate
00078   virtual StatusCode terminate();
00079   // implementation of IAppMgrUI::initalize
00080   virtual StatusCode initialize();
00081   // implementation of IAppMgrUI::finalize
00082   virtual StatusCode finalize();
00083   // implementation of IAppMgrUI::nextEvent
00084   virtual StatusCode nextEvent(int maxevt);
00085   // implementation of IAppMgrUI::state: current state of the application manager
00086   virtual const std::string& state()  const;
00087   // implementation of IAppMgrUI::name
00088   virtual const std::string&  name() const;
00090   virtual StatusCode executeEvent(void* par);
00091 
00092   // implementation of ISvcLocation::getService
00093   virtual StatusCode getService( const std::string& name, IService*& svc);
00094   // implementation of ISvcLocation::getService
00095   virtual StatusCode getService( const std::string& name, const IID& iid, IInterface*& pinterface);
00096   // implementation of ISvcLocation::existsService
00097   virtual bool existsService( const std::string& name) const;
00098   // implementation of ISvcLocation::getService
00099   virtual StatusCode getService( const std::string& name, IService*& svc, bool createIf);
00100   // Return the list of Services
00101   virtual std::list<IService*>& getServices( ) const;
00102 
00103   // implementation of ISvcManager::addService
00104   virtual StatusCode addService( IService* svc);
00105   // implementation of ISvcManager::removeService
00106   virtual StatusCode removeService( IService* svc);
00107   // implementation of ISvcManager::declareSvcCreator
00108   virtual StatusCode declareSvcCreator( ISvcManager::SvcCreator creator, const std::string& svctype );
00109   // implementation of ISvcManager::declareSvcModule
00110   virtual StatusCode declareSvcModule( const std::string& module, const std::string& svctype );
00111   // implementation of ISvcManager::declareSvcFactory
00112   virtual StatusCode declareSvcFactory( const ISvcFactory& factory, const std::string& svctype );
00113   // implementation of ISvcManager::createService
00114   virtual StatusCode createService( const std::string& svctype, const std::string& svcname, IService*& svc );
00115 
00116   // implementation of IAlgManager::addAlgorithm
00117   virtual StatusCode addAlgorithm( IAlgorithm* alg);
00118   // implementation of IAlgManager::removeAlgorithm
00119   virtual StatusCode removeAlgorithm( IAlgorithm* alg);
00120   // implementation of IAlgManager::declareAlgCreator
00121   virtual StatusCode declareAlgCreator( IAlgManager::AlgCreator creator, const std::string& algtype );
00122   // implementation of IAlgManager::declareAlgModule
00123   virtual StatusCode declareAlgModule( const std::string& module, const std::string& algtype );
00124   // implementation of IAlgManager::declareAlgFactory
00125   virtual StatusCode declareAlgFactory( const IAlgFactory& factory, const std::string& algtype );
00126   // implementation of IAlgManager::createAlgorithm
00127   virtual StatusCode createAlgorithm( const std::string& algtype, const std::string& algname, IAlgorithm*& alg);
00128   // implementation of IAlgManager::getAlgorithm
00129   virtual StatusCode getAlgorithm( const std::string& name, IAlgorithm*& alg) const;
00130   // implementation of IAlgManager::existsAlgorithm
00131   virtual bool existsAlgorithm( const std::string& name) const;
00132   // Return the list of Algorithms
00133   virtual std::list<IAlgorithm*>& getAlgorithms( ) const;
00134 
00135   // implementation of ICnvManager::declareCnvFactory
00136   virtual StatusCode declareCnvFactory( const ICnvFactory& factory      // Reference to the abastract factory
00137                                       );
00138   // implementation of ICnvManager::existsConverter
00139   virtual bool existsConverter(         const unsigned char repSvctype, // Converter service type 
00140                                         const CLID& objtype             // Converter object type
00141                                       ) const;
00142   // Get an existing converter factory
00143   virtual const ICnvFactory* factory(   const unsigned char repSvctype, // Converter service type 
00144                                         const CLID& objtype             // Converter object type
00145                                       ) const;
00146   // implementation of ICnvManager::begin
00147   virtual CnvIterator cnvBegin();
00148   // implementation of ICnvManager::end
00149   virtual CnvIterator cnvEnd();
00150 
00152   // implementation of IManager::existsFactory
00153   virtual bool existsObjFactory(        const std::string& objtype   // Factory's object type
00154                                       ) const;
00155   // implementation of IObjManager::objFactory
00156   virtual const IFactory* objFactory(   const std::string& objtype   // Factory's object type
00157                                       ) const;
00158   // implementation of IObjManager::declareObjFactory
00159   virtual StatusCode declareObjFactory( const IFactory& factory      // Reference to the abastract factory
00160                                       );
00161   // implementation of IObjManager::begin
00162   virtual ObjIterator objBegin();
00163   // implementation of IObjManager::end
00164   virtual ObjIterator objEnd();
00165 
00166   // implementation of IProperty::setProperty
00167   virtual StatusCode setProperty(const Property& value);
00169   virtual StatusCode setProperty( std::istream& s );
00171   virtual StatusCode setProperty( const std::string& n, const std::string& v );
00172   // implementation of IProperty::getProperty
00173   virtual StatusCode getProperty(Property* value) const;
00174   // implementation of IProperty::getProperty
00175   const Property& getProperty( const std::string& name ) const;
00176   // implementation of IProperty::getProperties
00177   const std::vector<Property*>& getProperties( ) const;
00179   virtual StatusCode getProperty( const std::string& n, std::string& v ) const;
00180 
00181   // implementation of IClassManager::declareFactory
00182   virtual StatusCode declareFactory( const IFactory& factory );
00183   // implementation of IClassManager::loadModule 
00184   virtual StatusCode loadModule( const std::string& module ); 
00185 
00186   // SI Go Handler
00187   void       SIGoHandler             ( Property& theProp );
00188   // SI Exit handler
00189   void       SIExitHandler           ( Property& theProp );
00190 
00191   // Property handlers
00192   void       evtLoopPropertyHandler  ( Property& theProp );
00193   StatusCode decodeExtSvcNameList    ( );
00194   void       extSvcNameListHandler   ( Property& theProp );
00195   StatusCode decodeDllNameList       ( );
00196   void       dllNameListHandler      ( Property& theProp );
00197 
00198 protected:
00199 
00201   StatusCode i_startup();
00203   IService* i_connectService(const std::string& typ, const std::string& name);
00204   // enums
00205   enum State { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED };
00206 
00207   // data members
00208   int                 m_refcount;           
00209   IObjManager*        m_objFactory;         
00210   ServiceFactory*     m_svcFactory;         
00211   AlgorithmFactory*   m_algFactory;         
00212   ConverterFactory*   m_cnvFactory;         
00213   DLLClassManager*    m_classManager;       
00214   ISvcLocator*        m_svcLocator;         
00215 
00216   IntegerProperty     m_SIGo;               
00217   IntegerProperty     m_SIExit;             
00218   StringArrayProperty m_topAlgNameList;     
00219   StringArrayProperty m_outStreamNameList;  
00220 
00221   
00222   ListSvc             m_topSvcList;         
00223   ListName            m_topSvcNameList;     
00224  
00225   std::string         m_name;               
00226   State               m_state;              
00227 
00228   VectorName          m_stateName;          
00229   VectorName          m_defServices;        
00230 
00231   PropertyMgr*        m_propertyMgr;        
00232   IMessageSvc*        m_messageSvc;         
00233   IRunable*           m_runable;            
00234   IAppMgrUI*          m_processingMgr;      
00235   
00236   //
00237   // The public ApplicationMgr properties
00238   //
00239 
00240   int                  m_evtMax;            
00241   StringArrayProperty  m_extSvcNameList;    
00242   StringArrayProperty  m_dllNameList;       
00243   std::string          m_jobOptionsType;    
00244   std::string          m_jobOptionsPath;    
00245   std::string          m_runableType;       
00246   std::string          m_eventLoopMgr;      
00247   std::string          m_evtsel;            
00248   std::string          m_histPersName;      
00249 
00250 };
00251 #endif  // GAUDI_APPLICATIONMGR_H

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