SFrame 3.6
core/include/SProofManager.h
Go to the documentation of this file.
00001 // Dear emacs, this is -*- c++ -*-
00002 // $Id: SProofManager.h 303 2012-04-11 07:01:27Z krasznaa $
00003 /***************************************************************************
00004  * @Project: SFrame - ROOT-based analysis framework for ATLAS
00005  * @Package: Core
00006  *
00007  * @author Stefan Ask       <Stefan.Ask@cern.ch>           - Manchester
00008  * @author David Berge      <David.Berge@cern.ch>          - CERN
00009  * @author Johannes Haller  <Johannes.Haller@cern.ch>      - Hamburg
00010  * @author A. Krasznahorkay <Attila.Krasznahorkay@cern.ch> - CERN/Debrecen
00011  *
00012  ***************************************************************************/
00013 
00014 // STL include(s):
00015 #include <map>
00016 
00017 // ROOT include(s):
00018 #include <TString.h>
00019 
00020 // Local include(s):
00021 #include "SLogger.h"
00022 #include "SError.h"
00023 
00024 // Forward declaration(s):
00025 class TProof;
00026 
00043 class SProofManager {
00044 
00046    typedef std::map< std::pair< TString, TString >,
00047                      std::pair< TProof*, Bool_t > > ConnMap_t;
00048 
00049 public:
00051    ~SProofManager();
00052 
00054    static SProofManager* Instance();
00055 
00057    TProof* Open( const TString& url, const TString& param = "" ) throw( SError );
00059    Bool_t IsConfigured( const TString& url, const TString& param = "" ) const;
00061    void SetConfigured( const TString& url, const TString& param = "",
00062                        Bool_t state = kTRUE ) throw( SError );
00064    void Cleanup();
00065 
00066 private:
00068    SProofManager();
00070    void PrintWorkerLogs() const;
00071 
00073    ConnMap_t m_connections;
00074 
00076    static SProofManager* m_instance;
00078    mutable SLogger m_logger;
00079 
00080 }; // class SProofManager