00001 #ifndef PSANA_STEP_H 00002 #define PSANA_STEP_H 00003 00004 //-------------------------------------------------------------------------- 00005 // File and Version Information: 00006 // $Id: Step.h 8825 2014-08-28 01:16:10Z davidsch@SLAC.STANFORD.EDU $ 00007 // 00008 // Description: 00009 // Class Step. 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/EventIter.h" 00026 #include "psana/EventLoop.h" 00027 #include "PSEnv/Env.h" 00028 00029 //------------------------------------ 00030 // Collaborating Class Declarations -- 00031 //------------------------------------ 00032 namespace psana { 00033 class StepIter; 00034 } 00035 00036 // --------------------- 00037 // -- Class Interface -- 00038 // --------------------- 00039 00040 namespace psana { 00041 00042 /// @addtogroup psana 00043 00044 /** 00045 * @ingroup psana 00046 * 00047 * @brief Class representing a step (calib cycle). 00048 * 00049 * Main purpose of this class is to provide iteration over contained 00050 * events. 00051 * 00052 * This software was developed for the LCLS project. If you use all or 00053 * part of it, please give an appropriate acknowledgment. 00054 * 00055 * @version $Id: Step.h 8825 2014-08-28 01:16:10Z davidsch@SLAC.STANFORD.EDU $ 00056 * 00057 * @author Andy Salnikov 00058 */ 00059 00060 class Step { 00061 public: 00062 00063 /// Default constructor makes "null" Step object 00064 Step(); 00065 00066 // Constructor takes event loop object 00067 Step(const boost::shared_ptr<EventLoop>& evtLoop); 00068 00069 // Destructor 00070 ~Step () ; 00071 00072 /// This object is converted to true for non-null instance 00073 operator bool() const { return bool(m_evtLoop); } 00074 bool operator!() const { return not bool(m_evtLoop); } 00075 00076 /// Get environment object, cannot be called for "null" object 00077 PSEnv::Env& env() const; 00078 00079 /// Returns iterator for events in this step 00080 EventIter events() { return EventIter(m_evtLoop, EventLoop::EndCalibCycle); } 00081 00082 protected: 00083 00084 private: 00085 00086 // Data members 00087 boost::shared_ptr<EventLoop> m_evtLoop; 00088 00089 }; 00090 00091 } // namespace psana 00092 00093 #endif // PSANA_STEP_H