ATLAS Offline Software
RootCollectionCursor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ROOTCOLLECTION_ROOTCOLLECTIONCURSOR_H
6 #define ROOTCOLLECTION_ROOTCOLLECTIONCURSOR_H
7 
8 
10 
14 
17 
18 #include "TTree.h"
19 #include "TEventList.h"
20 
21 namespace pool {
22  namespace RootCollection {
29  virtual public IPositionSeek,
30  virtual public implements<ICollectionSize>
31  {
32  public:
33 
36  const pool::CollectionRowBuffer& collectionRowBuffer,
37  TTree *tree,
38  const TEventList *evl );
39 
40 
42  virtual bool next() override;
43 
45  virtual const pool::CollectionRowBuffer& currentRow() const override;
46 
48  virtual bool seek(long long int position) override;
49 
51  virtual int size() override;
52 
54  virtual const Token& eventRef() const override;
55 
57  virtual void close() override;
58 
60 
61  protected:
62 
63  static const unsigned int c_maxLengthOfStrings = 5000;
64 
66 
69 
70  const TEventList *m_eventList;
71 
72 
74 
75  typedef std::vector< std::pair<TBranch*, std::string*> > AttrBranchVector_t;
76  typedef std::vector< std::pair<TBranch*, Token*> > TokenBranchVector_t;
77 
80 
81  int m_idx;
82  Long64_t m_entries;
83  bool m_dummyRef;
84  };
85  }
86 }
87 
88 #endif
89 
90 
pool::RootCollection::RootCollectionCursor::currentRow
virtual const pool::CollectionRowBuffer & currentRow() const override
Returns the selected Tokens and Attributes for the current row of the query result set.
pool::RootCollection::RootCollectionCursor::m_attrBranches
AttrBranchVector_t m_attrBranches
Definition: RootCollectionCursor.h:78
ICollectionCursor.h
tree
TChain * tree
Definition: tile_monitor.h:30
pool
pool namespace
Definition: libname.h:15
ICollectionSize.h
Abstract interface for finding the size of an event collection.
pool::RootCollection::RootCollectionCursor::eventRef
virtual const Token & eventRef() const override
Returns the event reference Token for the current row.
pool::RootCollection::RootCollectionCursor::m_charBuffer
char m_charBuffer[c_maxLengthOfStrings]
Definition: RootCollectionCursor.h:73
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
pool::RootCollection::RootCollectionCursor::next
virtual bool next() override
Advances the cursor to the next row of the query result set.
pool::RootCollection::RootCollectionCursor::size
virtual int size() override
Return the size of the collection.
CollectionRowBuffer.h
pool::RootCollection::RootCollectionCursor::m_tokenBranches
TokenBranchVector_t m_tokenBranches
Definition: RootCollectionCursor.h:79
pool::RootCollection::RootCollectionCursor::~RootCollectionCursor
virtual ~RootCollectionCursor()
IPositionSeek.h
Abstract interface for seeking within an event stream.
pool::RootCollection::RootCollectionCursor::m_entries
Long64_t m_entries
Definition: RootCollectionCursor.h:82
pool::ICollectionCursor
Definition: ICollectionCursor.h:21
pool::CollectionRowBuffer
Definition: CollectionRowBuffer.h:31
pool::RootCollection::RootCollectionCursor::m_eventList
const TEventList * m_eventList
Definition: RootCollectionCursor.h:70
pool::RootCollection::RootCollectionCursor::c_maxLengthOfStrings
static const unsigned int c_maxLengthOfStrings
Definition: RootCollectionCursor.h:63
pool::RootCollection::RootCollectionCursor::TokenBranchVector_t
std::vector< std::pair< TBranch *, Token * > > TokenBranchVector_t
Definition: RootCollectionCursor.h:76
pool::RootCollection::RootCollectionCursor::RootCollectionCursor
RootCollectionCursor(const pool::ICollectionDescription &description, const pool::CollectionRowBuffer &collectionRowBuffer, TTree *tree, const TEventList *evl)
pool::RootCollection::RootCollectionCursor::seek
virtual bool seek(long long int position) override
Seeks the cursor to a given position in the collection.
pool::RootCollection::RootCollectionCursor::m_collectionRowBuffer
pool::CollectionRowBuffer m_collectionRowBuffer
Row buffer containing Tokens and Attributes selected by query.
Definition: RootCollectionCursor.h:68
pool::IPositionSeek
Abstract interface for seeking inside a collection.
Definition: IPositionSeek.h:26
pool::RootCollection::RootCollectionCursor::m_idx
int m_idx
Definition: RootCollectionCursor.h:81
pool::RootCollection::RootCollectionCursor::m_description
const ICollectionDescription & m_description
Definition: RootCollectionCursor.h:65
ICollectionDescription.h
Token.h
This file contains the class definition for the Token class (migrated from POOL).
pool::RootCollection::RootCollectionCursor::m_dummyRef
bool m_dummyRef
Definition: RootCollectionCursor.h:83
pool::RootCollection::RootCollectionCursor::close
virtual void close() override
Cleanup.
pool::ICollectionDescription
Definition: ICollectionDescription.h:26
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88
pool::RootCollection::RootCollectionCursor
Definition: RootCollectionCursor.h:31
pool::RootCollection::RootCollectionCursor::AttrBranchVector_t
std::vector< std::pair< TBranch *, std::string * > > AttrBranchVector_t
Definition: RootCollectionCursor.h:75