00001 #ifndef FWCore_Framework_UnscheduledHandler_h 00002 #define FWCore_Framework_UnscheduledHandler_h 00003 // -*- C++ -*- 00004 // 00005 // Package: Framework 00006 // Class : UnscheduledHandler 00007 // 00017 // 00018 // Original Author: Chris Jones 00019 // Created: Mon Feb 13 16:26:33 IST 2006 00020 // 00021 00022 // system include files 00023 00024 // user include files 00025 #include "FWCore/Framework/interface/Frameworkfwd.h" 00026 #include <string> 00027 00028 // forward declarations 00029 namespace edm { 00030 class CurrentProcessingContext; 00031 class UnscheduledHandlerSentry; 00032 00033 class UnscheduledHandler { 00034 00035 public: 00036 friend class UnscheduledHandlerSentry; 00037 UnscheduledHandler(): m_setup(nullptr), m_context(nullptr) {} 00038 virtual ~UnscheduledHandler(); 00039 00040 UnscheduledHandler(UnscheduledHandler const&) = delete; // Disallow copying and moving 00041 UnscheduledHandler& operator=(UnscheduledHandler const&) = delete; // Disallow copying and moving 00042 00043 // ---------- const member functions --------------------- 00044 00045 // ---------- static member functions -------------------- 00046 00047 // ---------- member functions --------------------------- 00049 bool tryToFill(std::string const& label, 00050 EventPrincipal& iEvent); 00051 00052 void setEventSetup(EventSetup const& iSetup) { 00053 m_setup = &iSetup; 00054 } 00055 private: 00056 CurrentProcessingContext const* setCurrentProcessingContext(CurrentProcessingContext const* iContext); 00057 //void popCurrentProcessingContext(); 00058 00059 virtual bool tryToFillImpl(std::string const&, 00060 EventPrincipal&, 00061 EventSetup const&, 00062 CurrentProcessingContext const*) = 0; 00063 // ---------- member data -------------------------------- 00064 EventSetup const* m_setup; 00065 CurrentProcessingContext const* m_context; 00066 }; 00067 class UnscheduledHandlerSentry { 00068 public: 00069 UnscheduledHandlerSentry(UnscheduledHandler* iHandler, 00070 CurrentProcessingContext const* iContext); 00071 ~UnscheduledHandlerSentry(); 00072 private: 00073 UnscheduledHandler* m_handler; 00074 CurrentProcessingContext const* m_old; 00075 }; 00076 } 00077 00078 #endif