| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
NTupleSvc.h
Go to the documentation of this file.
1 // $Id: NTupleSvc.h,v 1.9 2006/11/30 14:57:04 mato Exp $
2 #ifndef GAUDI_NTUPLESVC_H
3 #define GAUDI_NTUPLESVC_H 1
4
5 // Framework include files
6 #include "GaudiKernel/INTupleSvc.h"
7 #include "GaudiKernel/IDataSourceMgr.h"
8 #include "GaudiKernel/DataSvc.h"
9
10 // STL include files
11 #include <map>
12
13
25 class NTupleSvc : public extends2<DataSvc, INTupleSvc, IDataSourceMgr>
26 {
27 private:
28 protected:
29 struct Connection {
30 IConversionSvc* service;
31 Connection(IConversionSvc* s) : service(s) {}
32 Connection(const Connection& c) : service(c.service) {}
33 };
34 typedef std::vector< std::string > DBaseEntries;
35 typedef std::map<std::string, Connection> Connections;
36 typedef std::pair<std::string,std::string> Prop;
37
38 private:
39 public:
41 virtual StatusCode initialize();
43 virtual StatusCode reinitialize();
45 virtual StatusCode finalize();
47 virtual IConversionSvc* getDataLoader(IRegistry* pReg);
48
50 virtual NTuple::Directory* createDirectory (DataObject* pParent, const std::string& title);
52 virtual NTuple::Directory* createDirectory (DataObject* pParent, long id);
54 virtual NTuple::Directory* createDirectory (const std::string& dirPath, long id);
56 virtual NTuple::Directory* createDirectory (const std::string& dirPath, const std::string& title);
58 virtual NTuple::Directory* createDirectory (const std::string& fullPath);
59
61 virtual StatusCode create(const CLID& typ, const std::string& title, NTuple::Tuple*& refpTuple);
63 virtual NTuple::Tuple* book (const std::string& fullPath, const CLID& type, const std::string& title);
65 virtual NTuple::Tuple* book (const std::string& dirPath, const std::string& relPath, const CLID& type, const std::string& title);
67 virtual NTuple::Tuple* book (const std::string& dirPath, long id, const CLID& type, const std::string& title);
69 virtual NTuple::Tuple* book (DataObject* pParent, const std::string& relPath, const CLID& type, const std::string& title);
71 virtual NTuple::Tuple* book (DataObject* pParent, long id, const CLID& type, const std::string& title);
73 virtual NTuple::Tuple* access(const std::string& fullPath, const std::string& filename);
75 virtual StatusCode save(const std::string& fullPath);
77 virtual StatusCode save(NTuple::Tuple* tuple);
79 virtual StatusCode save(DataObject* pParent, const std::string& relPath);
81 virtual StatusCode writeRecord( NTuple::Tuple* tuple );
83 virtual StatusCode writeRecord( const std::string& fullPath );
85 virtual StatusCode writeRecord( DataObject* pParent, const std::string& relPath );
87 virtual StatusCode readRecord( NTuple::Tuple* tuple );
89 virtual StatusCode readRecord( const std::string& fullPath );
91 virtual StatusCode readRecord( DataObject* pParent, const std::string& relPath);
92
94 virtual bool isConnected(const std::string& identifier) const;
96 virtual StatusCode connect(const std::string& ident);
98 virtual StatusCode connect(const std::string& ident, std::string& logname);
100 virtual StatusCode disconnect(const std::string& nam);
102 virtual StatusCode disconnectAll();
103
105 NTupleSvc(const std::string& name, ISvcLocator* svc);
107 virtual ~NTupleSvc();
108 protected:
109
111 StatusCode createService( const std::string& nam,
112 const std::string& typ,
113 const std::vector<Prop>& props,
114 IConversionSvc*& pSvc);
116 void releaseConnection(Connection& c);
118 StatusCode attachTuple(const std::string& filename, const std::string& logname, const char typ, const long t);
120 StatusCode updateDirectories();
121
123 DBaseEntries m_output;
125 DBaseEntries m_input;
127 Connections m_connections;
128 };
129
130 #endif // GAUDI_NTUPLESVC_H