CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RootDelayedReader.h
Go to the documentation of this file.
1 #ifndef IOPool_Input_RootDelayedReader_h
2 #define IOPool_Input_RootDelayedReader_h
3 
4 /*----------------------------------------------------------------------
5 
6 RootDelayedReader.h // used by ROOT input sources
7 
8 ----------------------------------------------------------------------*/
9 
13 #include "RootTree.h"
14 
15 #include <map>
16 #include <memory>
17 #include <string>
18 
19 namespace edm {
20  class InputFile;
21  class RootTree;
23 
24  //------------------------------------------------------------
25  // Class RootDelayedReader: pretends to support file reading.
26  //
27 
29  public:
32  typedef roottree::BranchMap::const_iterator iterator;
35  RootTree const& tree,
36  boost::shared_ptr<InputFile> filePtr,
37  InputType inputType);
38 
39  virtual ~RootDelayedReader();
40 
41  RootDelayedReader(RootDelayedReader const&) = delete; // Disallow copying and moving
42  RootDelayedReader& operator=(RootDelayedReader const&) = delete; // Disallow copying and moving
43 
44  private:
46  WrapperInterfaceBase const* interface,
47  EDProductGetter const* ep) const override;
48  virtual void mergeReaders_(DelayedReader* other) {nextReader_ = other;}
49  virtual void reset_() {nextReader_ = 0;}
50  SharedResourcesAcquirer* sharedResources_() const override;
51 
52  BranchMap const& branches() const {return tree_.branches();}
53  iterator branchIter(BranchKey const& k) const {return branches().find(k);}
54  bool found(iterator const& iter) const {return iter != branches().end();}
55  BranchInfo const& getBranchInfo(iterator const& iter) const {return iter->second; }
56  // NOTE: filePtr_ appears to be unused, but is needed to prevent
57  // the file containing the branch from being reclaimed.
58  RootTree const& tree_;
59  boost::shared_ptr<InputFile> filePtr_;
61  std::unique_ptr<SharedResourcesAcquirer> resourceAcquirer_;
63  }; // class RootDelayedReader
64  //------------------------------------------------------------
65 }
66 #endif
InputType
Definition: InputType.h:5
virtual void mergeReaders_(DelayedReader *other)
RootTree const & tree_
roottree::BranchMap BranchMap
BranchInfo const & getBranchInfo(iterator const &iter) const
DelayedReader * nextReader_
std::map< BranchKey const, BranchInfo > BranchMap
Definition: RootTree.h:53
boost::shared_ptr< InputFile > filePtr_
IndexIntoFile::EntryNumber_t EntryNumber
Definition: RootTree.h:41
roottree::BranchMap::const_iterator iterator
RootDelayedReader & operator=(RootDelayedReader const &)=delete
int k[5][pyjets_maxn]
virtual WrapperOwningHolder getProduct_(BranchKey const &k, WrapperInterfaceBase const *interface, EDProductGetter const *ep) const override
bool found(iterator const &iter) const
roottree::BranchInfo BranchInfo
SharedResourcesAcquirer * sharedResources_() const override
std::unique_ptr< SharedResourcesAcquirer > resourceAcquirer_
roottree::EntryNumber EntryNumber
RootDelayedReader(RootTree const &tree, boost::shared_ptr< InputFile > filePtr, InputType inputType)
BranchMap const & branches() const
Definition: RootTree.cc:172
iterator branchIter(BranchKey const &k) const
BranchMap const & branches() const