| # Gaudi Framework, version v20r4
Generated: 8 Jan 2009

# 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 DataSvc,
    00028                   virtual public INTupleSvc,
    00029                   virtual public IDataSourceMgr
    00030 {
    00031 private:
    00032 protected:
    00033   struct Connection  {
    00034     IConversionSvc* service;
    00035     Connection(IConversionSvc* s) : service(s) {}
    00036     Connection(const Connection& c) : service(c.service) {}
    00037   };
    00038   friend class SvcFactory<NTupleSvc>;
    00039   typedef std::vector< std::string >              DBaseEntries;
    00040   typedef std::map<std::string, Connection>       Connections;
    00041   typedef std::pair<std::string,std::string>      Prop;
    00042
    00043 private:
    00044 public:
    00046   virtual StatusCode initialize();
    00048   virtual StatusCode reinitialize();
    00050   virtual StatusCode finalize();
    00052   virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
    00054   virtual IConversionSvc* getDataLoader(IRegistry* pReg);
    00055
    00057   virtual NTuple::Directory* createDirectory (DataObject* pParent, const std::string& title);
    00059   virtual NTuple::Directory* createDirectory (DataObject* pParent, long id);
    00061   virtual NTuple::Directory* createDirectory (const std::string& dirPath, long id);
    00063   virtual NTuple::Directory* createDirectory (const std::string& dirPath, const std::string& title);
    00065   virtual NTuple::Directory* createDirectory (const std::string& fullPath);
    00066
    00068   virtual StatusCode create(const CLID& typ, const std::string& title, NTuple::Tuple*& refpTuple);
    00070   virtual NTuple::Tuple* book (const std::string& fullPath, const CLID& type, const std::string& title);
    00072   virtual NTuple::Tuple* book (const std::string& dirPath, const std::string& relPath, const CLID& type, const std::string& title);
    00074   virtual NTuple::Tuple* book (const std::string& dirPath, long id, const CLID& type, const std::string& title);
    00076   virtual NTuple::Tuple* book (DataObject* pParent, const std::string& relPath, const CLID& type, const std::string& title);
    00078   virtual NTuple::Tuple* book (DataObject* pParent, long id, const CLID& type, const std::string& title);
    00080   virtual NTuple::Tuple* access(const std::string& fullPath, const std::string& filename);
    00082   virtual StatusCode save(const std::string& fullPath);
    00084   virtual StatusCode save(NTuple::Tuple* tuple);
    00086   virtual StatusCode save(DataObject* pParent, const std::string& relPath);
    00088   virtual StatusCode writeRecord( NTuple::Tuple* tuple );
    00090   virtual StatusCode writeRecord( const std::string& fullPath );
    00092   virtual StatusCode writeRecord( DataObject* pParent, const std::string& relPath );
    00094   virtual StatusCode readRecord( NTuple::Tuple* tuple );
    00096   virtual StatusCode readRecord( const std::string& fullPath );
    00098   virtual StatusCode readRecord( DataObject* pParent, const std::string& relPath);
    00099
    00101   virtual bool isConnected(const std::string& identifier)   const;
    00103   virtual StatusCode connect(const std::string& ident);
    00105   virtual StatusCode connect(const std::string& ident, std::string& logname);
    00107   virtual StatusCode disconnect(const std::string& nam);
    00109   virtual StatusCode disconnectAll();
    00110
    00112   NTupleSvc(const std::string& name, ISvcLocator* svc);
    00114   virtual ~NTupleSvc();
    00115 protected:
    00116
    00118   StatusCode createService( const std::string& nam,
    00119                             const std::string& typ,
    00120                             const std::vector<Prop>& props,
    00121                             IConversionSvc*& pSvc);
    00123   void releaseConnection(Connection& c);
    00125   StatusCode attachTuple(const std::string& filename, const std::string& logname, const char typ, const long t);
    00127   StatusCode updateDirectories();
    00128
    00130   DBaseEntries                 m_output;
    00132   DBaseEntries                 m_input;
    00134   Connections                  m_connections;
    00135 };
    00136
    00137 #endif // GAUDI_NTUPLESVC_H