Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-23 02:49:23

0001 #ifndef IOPool_Streamer_StreamerFileReader_h
0002 #define IOPool_Streamer_StreamerFileReader_h
0003 
0004 #include "IOPool/Streamer/interface/StreamerInputSource.h"
0005 #include "FWCore/Utilities/interface/get_underlying_safe.h"
0006 
0007 #include <memory>
0008 #include <string>
0009 #include <vector>
0010 
0011 class EventMsgView;
0012 class InitMsgView;
0013 
0014 namespace edm {
0015   class ConfigurationDescriptions;
0016   class EventPrincipal;
0017   class EventSkipperByID;
0018   class FileCatalogItem;
0019   struct InputSourceDescription;
0020   class ParameterSet;
0021   class StreamerInputFile;
0022   class StreamerFileReader : public StreamerInputSource {
0023   public:
0024     StreamerFileReader(ParameterSet const& pset, InputSourceDescription const& desc);
0025     ~StreamerFileReader() override;
0026 
0027     static void fillDescriptions(ConfigurationDescriptions& descriptions);
0028 
0029   private:
0030     InitMsgView const* getHeader();
0031     EventMsgView const* getNextEvent();
0032     bool newHeader();
0033 
0034     Next checkNext() override;
0035     void skip(int toSkip) override;
0036     void genuineReadFile() override;
0037     void genuineCloseFile() override;
0038     void reset_() override;
0039 
0040     std::shared_ptr<EventSkipperByID const> eventSkipperByID() const { return get_underlying_safe(eventSkipperByID_); }
0041     std::shared_ptr<EventSkipperByID>& eventSkipperByID() { return get_underlying_safe(eventSkipperByID_); }
0042 
0043     std::vector<FileCatalogItem> streamerNames_;  // names of Streamer files
0044     edm::propagate_const<std::unique_ptr<StreamerInputFile>> streamReader_;
0045     edm::propagate_const<std::shared_ptr<EventSkipperByID>> eventSkipperByID_;
0046     int initialNumberOfEventsToSkip_;
0047     int prefetchMBytes_;
0048     bool isFirstFile_ = true;
0049   };
0050 }  // namespace edm
0051 
0052 #endif