| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 2010

# NTupleSvc.h

Go to the documentation of this file.

    00001 // $Id: NTupleSvc.h,v 1.9 2006/11/30 14:57:04 mato Exp $
    00002 #ifndef GAUDI_NTUPLESVC_H
    00003 #define GAUDI_NTUPLESVC_H 1
    00004
    00005 // Framework include files
    00006 #include "GaudiKernel/INTupleSvc.h"
    00007 #include "GaudiKernel/IDataSourceMgr.h"
    00008 #include "GaudiKernel/DataSvc.h"
    00009
    00010 // STL include files
    00011 #include <map>
    00012
    00013 // Forward declarations
    00014 template <class TYPE> class SvcFactory;
    00015
    00027 class NTupleSvc : public extends2<DataSvc, INTupleSvc, IDataSourceMgr>
    00028 {
    00029 private:
    00030 protected:
    00031   struct Connection  {
    00032     IConversionSvc* service;
    00033     Connection(IConversionSvc* s) : service(s) {}
    00034     Connection(const Connection& c) : service(c.service) {}
    00035   };
    00036   friend class SvcFactory<NTupleSvc>;
    00037   typedef std::vector< std::string >              DBaseEntries;
    00038   typedef std::map<std::string, Connection>       Connections;
    00039   typedef std::pair<std::string,std::string>      Prop;
    00040
    00041 private:
    00042 public:
    00044   virtual StatusCode initialize();
    00046   virtual StatusCode reinitialize();
    00048   virtual StatusCode finalize();
    00050   virtual IConversionSvc* getDataLoader(IRegistry* pReg);
    00051
    00053   virtual NTuple::Directory* createDirectory (DataObject* pParent, const std::string& title);
    00055   virtual NTuple::Directory* createDirectory (DataObject* pParent, long id);
    00057   virtual NTuple::Directory* createDirectory (const std::string& dirPath, long id);
    00059   virtual NTuple::Directory* createDirectory (const std::string& dirPath, const std::string& title);
    00061   virtual NTuple::Directory* createDirectory (const std::string& fullPath);
    00062
    00064   virtual StatusCode create(const CLID& typ, const std::string& title, NTuple::Tuple*& refpTuple);
    00066   virtual NTuple::Tuple* book (const std::string& fullPath, const CLID& type, const std::string& title);
    00068   virtual NTuple::Tuple* book (const std::string& dirPath, const std::string& relPath, const CLID& type, const std::string& title);
    00070   virtual NTuple::Tuple* book (const std::string& dirPath, long id, const CLID& type, const std::string& title);
    00072   virtual NTuple::Tuple* book (DataObject* pParent, const std::string& relPath, const CLID& type, const std::string& title);
    00074   virtual NTuple::Tuple* book (DataObject* pParent, long id, const CLID& type, const std::string& title);
    00076   virtual NTuple::Tuple* access(const std::string& fullPath, const std::string& filename);
    00078   virtual StatusCode save(const std::string& fullPath);
    00080   virtual StatusCode save(NTuple::Tuple* tuple);
    00082   virtual StatusCode save(DataObject* pParent, const std::string& relPath);
    00084   virtual StatusCode writeRecord( NTuple::Tuple* tuple );
    00086   virtual StatusCode writeRecord( const std::string& fullPath );
    00088   virtual StatusCode writeRecord( DataObject* pParent, const std::string& relPath );
    00090   virtual StatusCode readRecord( NTuple::Tuple* tuple );
    00092   virtual StatusCode readRecord( const std::string& fullPath );
    00094   virtual StatusCode readRecord( DataObject* pParent, const std::string& relPath);
    00095
    00097   virtual bool isConnected(const std::string& identifier)   const;
    00099   virtual StatusCode connect(const std::string& ident);
    00101   virtual StatusCode connect(const std::string& ident, std::string& logname);
    00103   virtual StatusCode disconnect(const std::string& nam);
    00105   virtual StatusCode disconnectAll();
    00106
    00108   NTupleSvc(const std::string& name, ISvcLocator* svc);
    00110   virtual ~NTupleSvc();
    00111 protected:
    00112
    00114   StatusCode createService( const std::string& nam,
    00115                             const std::string& typ,
    00116                             const std::vector<Prop>& props,
    00117                             IConversionSvc*& pSvc);
    00119   void releaseConnection(Connection& c);
    00121   StatusCode attachTuple(const std::string& filename, const std::string& logname, const char typ, const long t);
    00123   StatusCode updateDirectories();
    00124
    00126   DBaseEntries                 m_output;
    00128   DBaseEntries                 m_input;
    00130   Connections                  m_connections;
    00131 };
    00132
    00133 #endif // GAUDI_NTUPLESVC_H