Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:09

0001 #ifndef DataFormats_FWLite_EventBase_h
0002 #define DataFormats_FWLite_EventBase_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWLite
0006 // Class  :     EventBase
0007 //
0008 /**\class EventBase EventBase.h DataFormats/FWLite/interface/EventBase.h
0009 
0010    Description: <one line class summary>
0011 
0012    Usage:
0013    <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Charles Plager
0018 //         Created:  Tue May  8 15:01:20 EDT 2007
0019 //
0020 // system include files
0021 #include <string>
0022 #include <typeinfo>
0023 //
0024 // // user include files
0025 #include "FWCore/Common/interface/EventBase.h"
0026 
0027 #include "Rtypes.h"
0028 
0029 namespace edm {
0030   class BasicHandle;
0031   class ProductID;
0032   class WrapperBase;
0033 }  // namespace edm
0034 
0035 namespace fwlite {
0036   class EventBase : public edm::EventBase {
0037   public:
0038     EventBase();
0039 
0040     ~EventBase() override;
0041 
0042     virtual bool getByLabel(std::type_info const&, char const*, char const*, char const*, void*) const = 0;
0043 
0044     virtual edm::WrapperBase const* getByProductID(edm::ProductID const&) const = 0;
0045 
0046     using edm::EventBase::getByLabel;
0047 
0048     virtual std::string const getBranchNameFor(std::type_info const&, char const*, char const*, char const*) const = 0;
0049 
0050     virtual bool atEnd() const = 0;
0051 
0052     virtual EventBase const& operator++() = 0;
0053 
0054     virtual EventBase const& toBegin() = 0;
0055 
0056     virtual Long64_t fileIndex() const { return -1; }
0057     virtual Long64_t secondaryFileIndex() const { return -1; }
0058 
0059   protected:
0060     template <typename T>
0061     static edm::EDGetTokenT<T> makeTokenUsing(unsigned int iIndex) {
0062       return edm::EDGetTokenT<T>(iIndex);
0063     }
0064 
0065   private:
0066     virtual bool getByTokenImp(edm::EDGetToken, edm::WrapperBase const*&) const = 0;
0067     edm::BasicHandle getByLabelImpl(std::type_info const&, std::type_info const&, const edm::InputTag&) const override;
0068     edm::BasicHandle getByTokenImpl(std::type_info const&, edm::EDGetToken) const override;
0069 
0070     edm::BasicHandle getImpl(std::type_info const&, edm::ProductID const&) const override;
0071   };
0072 }  // namespace fwlite
0073 
0074 #endif