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 
15 class TTree;
16 class TBranch;
17 class TEventList;
18 
19 namespace pool {
20  namespace RootCollection {
27  {
28  public:
29 
32  const pool::CollectionRowBuffer& collectionRowBuffer,
33  TTree *tree,
34  const TEventList *evl );
35 
36 
38  virtual bool next() override;
39 
41  virtual const pool::CollectionRowBuffer& currentRow() const override;
42 
44  virtual std::size_t size() override;
45 
47  virtual bool seek(std::size_t position) override;
48 
50  virtual const Token& eventRef() const override;
51 
53  virtual void close() override;
54 
56 
57  protected:
58 
59  static const unsigned int c_maxLengthOfStrings = 5000;
60 
62 
65 
66  const TEventList *m_eventList;
67 
69 
70  typedef std::vector< std::pair<TBranch*, std::string*> > AttrBranchVector_t;
71  typedef std::vector< std::pair<TBranch*, Token*> > TokenBranchVector_t;
72 
75 
76  std::size_t m_idx;
77  std::size_t m_entries;
78  bool m_dummyRef;
79  };
80  }
81 }
82 
83 #endif
84 
85 
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:73
pool::RootCollection::RootCollectionCursor::m_idx
std::size_t m_idx
Definition: RootCollectionCursor.h:76
ICollectionCursor.h
tree
TChain * tree
Definition: tile_monitor.h:30
pool
pool namespace
Definition: libname.h:15
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:68
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.
CollectionRowBuffer.h
pool::RootCollection::RootCollectionCursor::m_tokenBranches
TokenBranchVector_t m_tokenBranches
Definition: RootCollectionCursor.h:74
pool::RootCollection::RootCollectionCursor::~RootCollectionCursor
virtual ~RootCollectionCursor()
pool::ICollectionCursor
Definition: ICollectionCursor.h:22
pool::RootCollection::RootCollectionCursor::size
virtual std::size_t size() override
Return the size of the collection.
pool::RootCollection::RootCollectionCursor::seek
virtual bool seek(std::size_t position) override
Seeks the cursor to a given position in the collection.
pool::CollectionRowBuffer
Definition: CollectionRowBuffer.h:31
pool::RootCollection::RootCollectionCursor::m_eventList
const TEventList * m_eventList
Definition: RootCollectionCursor.h:66
pool::RootCollection::RootCollectionCursor::c_maxLengthOfStrings
static const unsigned int c_maxLengthOfStrings
Definition: RootCollectionCursor.h:59
pool::RootCollection::RootCollectionCursor::TokenBranchVector_t
std::vector< std::pair< TBranch *, Token * > > TokenBranchVector_t
Definition: RootCollectionCursor.h:71
pool::RootCollection::RootCollectionCursor::RootCollectionCursor
RootCollectionCursor(const pool::ICollectionDescription &description, const pool::CollectionRowBuffer &collectionRowBuffer, TTree *tree, const TEventList *evl)
pool::RootCollection::RootCollectionCursor::m_collectionRowBuffer
pool::CollectionRowBuffer m_collectionRowBuffer
Row buffer containing Tokens and Attributes selected by query.
Definition: RootCollectionCursor.h:64
pool::RootCollection::RootCollectionCursor::m_entries
std::size_t m_entries
Definition: RootCollectionCursor.h:77
pool::RootCollection::RootCollectionCursor::m_description
const ICollectionDescription & m_description
Definition: RootCollectionCursor.h:61
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:78
pool::RootCollection::RootCollectionCursor::close
virtual void close() override
Cleanup.
pool::ICollectionDescription
Definition: ICollectionDescription.h:25
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88
pool::RootCollection::RootCollectionCursor
Definition: RootCollectionCursor.h:27
pool::RootCollection::RootCollectionCursor::AttrBranchVector_t
std::vector< std::pair< TBranch *, std::string * > > AttrBranchVector_t
Definition: RootCollectionCursor.h:70