| # 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
EventCollectionSelector.h
Go to the documentation of this file.
1 //====================================================================
2 // EventCollectionSelector.h
3 //--------------------------------------------------------------------
4 //
5 // Package : EventCollectionSelector (LHCb Event Selector Package)
6 //
7 // Author : M.Frank
8 // Created : 4/10/00
9 //
10 //====================================================================
11 #ifndef GAUDISVC_EventCollectionSelector_EventCollectionSelector_H
12 #define GAUDISVC_EventCollectionSelector_EventCollectionSelector_H 1
13
14 // Include files
15 #include "GaudiKernel/Service.h"
16 #include "GaudiKernel/GenericAddress.h"
17 #include "GaudiKernel/IEvtSelector.h"
18 #include "GaudiKernel/NTuple.h"
19
20 // Forward declarations
21 class INTuple;
22 class INTupleSvc;
23 class IAddressCreator;
24 class EventSelectorDataStream;
25 template <class TYPE> class EventIterator;
26
41 class EventCollectionSelector : public extends1<Service, IEvtSelector> {
42 public:
43 class MyContextType : public IEvtSelector::Context {
44 public:
45 std::string criteria;
46 NTuple::Tuple* tuple;
47 NTuple::Item<IOpaqueAddress*>* item;
48 IOpaqueAddress* addressBuffer;
49 MyContextType(NTuple::Tuple* t, NTuple::Item<IOpaqueAddress*>* i) {
50 addressBuffer = new GenericAddress();
51 addressBuffer->addRef();
52 tuple = t;
53 item = i;
54 }
55 MyContextType(MyContextType* ctxt=0) {
56 addressBuffer = new GenericAddress();
57 addressBuffer->addRef();
58 tuple = (ctxt) ? ctxt->tuple : 0;
59 item = (ctxt) ? ctxt->item : 0;
60 }
61 MyContextType(const MyContextType& ctxt)
62 : IEvtSelector::Context(ctxt)
63 {
64 addressBuffer = new GenericAddress();
65 addressBuffer->addRef();
66 tuple = ctxt.tuple;
67 item = ctxt.item;
68 }
69 virtual ~MyContextType() {
70 addressBuffer->release();
71 }
72 virtual void* identifier() const {
73 return (void*)addressBuffer;
74 }
75 void setAddress(IOpaqueAddress* pAddr);
76 };
77 protected:
79 mutable SmartIF<INTupleSvc> m_tupleSvc;
80 mutable SmartIF<IAddressCreator> m_pAddrCreator;
82 std::string m_tupleSvcName;
84 std::string m_authentication;
86 std::string m_cntName;
88 std::string m_itemName;
90 std::string m_criteria;
92 std::string m_database;
94 std::string m_dbType;
96 std::string m_dbSvc;
98 std::string m_statement;
99 public:
100
102 virtual StatusCode initialize();
104 virtual StatusCode finalize();
105
107
111 virtual StatusCode createContext(Context*& refpCtxt) const;
112
114
118 virtual StatusCode next(Context& refCtxt) const;
119
121
125 virtual StatusCode next(Context& refCtxt,int jump) const;
126
128
133 virtual StatusCode previous(Context& refCtxt) const;
134
136
141 virtual StatusCode previous(Context& refCtxt,int jump) const;
142
144
148 virtual StatusCode rewind(Context& refCtxt) const;
149
151
156 virtual StatusCode createAddress(const Context& refCtxt, IOpaqueAddress*& refpAddr) const;
157
159
163 virtual StatusCode releaseContext(Context*& refCtxt) const;
164
173 virtual StatusCode resetCriteria(const std::string& cr,Context& c)const;
174
180 virtual StatusCode last(Context& refCtxt) const;
181
183 virtual StatusCode connectCollection(MyContextType* ctxt) const;
184
186 virtual StatusCode connectDataSource(const std::string& db, const std::string& typ) const;
188 virtual StatusCode connectTuple(const std::string& nam, const std::string& itName, NTuple::Tuple*& tup, NTuple::Item<IOpaqueAddress*>*& item) const;
190 virtual StatusCode connectStatement(const std::string& typ, const std::string& crit, INTuple* tuple) const;
192 virtual StatusCode getNextRecord(NTuple::Tuple* tuple) const;
194 virtual StatusCode getPreviousRecord(NTuple::Tuple* tuple) const;
195
197 EventCollectionSelector( const std::string& name, ISvcLocator* svcloc );
199 virtual ~EventCollectionSelector();
200 };
201
202 #endif // GAUDISVC_EventCollectionSelector_EventCollectionSelector_H