File indexing completed on 2024-04-06 12:04:09
0001 #ifndef DataFormats_FWLite_EventBase_h
0002 #define DataFormats_FWLite_EventBase_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include <string>
0022 #include <typeinfo>
0023
0024
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 }
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 }
0073
0074 #endif