00001 #ifndef PSANA_RUNITER_H 00002 #define PSANA_RUNITER_H 00003 00004 //-------------------------------------------------------------------------- 00005 // File and Version Information: 00006 // $Id: RunIter.h 8825 2014-08-28 01:16:10Z davidsch@SLAC.STANFORD.EDU $ 00007 // 00008 // Description: 00009 // Class RunIter. 00010 // 00011 //------------------------------------------------------------------------ 00012 00013 //----------------- 00014 // C/C++ Headers -- 00015 //----------------- 00016 #include <boost/shared_ptr.hpp> 00017 00018 //---------------------- 00019 // Base Class Headers -- 00020 //---------------------- 00021 00022 //------------------------------- 00023 // Collaborating Class Headers -- 00024 //------------------------------- 00025 #include "psana/Run.h" 00026 00027 //------------------------------------ 00028 // Collaborating Class Declarations -- 00029 //------------------------------------ 00030 namespace psana { 00031 class EventLoop; 00032 } 00033 00034 // --------------------- 00035 // -- Class Interface -- 00036 // --------------------- 00037 00038 namespace psana { 00039 00040 /// @addtogroup psana 00041 00042 /** 00043 * @ingroup psana 00044 * 00045 * @brief Class representing iterator over runs. 00046 * 00047 * This software was developed for the LCLS project. If you use all or 00048 * part of it, please give an appropriate acknowledgment. 00049 * 00050 * @version $Id: RunIter.h 8825 2014-08-28 01:16:10Z davidsch@SLAC.STANFORD.EDU $ 00051 * 00052 * @author Andy Salnikov 00053 */ 00054 00055 class RunIter { 00056 public: 00057 00058 typedef Run value_type; 00059 00060 /// Default constructor makes invalid iterator 00061 RunIter () ; 00062 00063 /// Constructor takes event loop instance. 00064 RunIter (const boost::shared_ptr<EventLoop>& evtLoop); 00065 00066 // Destructor 00067 ~RunIter () ; 00068 00069 /// get next run, when done returns object which is convertible to "false" 00070 value_type next(); 00071 00072 /// get next run and event. When done returns object which is convertible to "false" 00073 std::pair<value_type, boost::shared_ptr<PSEvt::Event> > nextWithEvent(); 00074 00075 protected: 00076 00077 private: 00078 00079 // Data members 00080 boost::shared_ptr<EventLoop> m_evtLoop; 00081 00082 // for indexing 00083 std::vector<unsigned>::const_iterator _runIter; 00084 }; 00085 00086 } // namespace psana 00087 00088 #endif // PSANA_RUNITER_H