psana/include/StepIter.h

Go to the documentation of this file.
00001 #ifndef PSANA_STEPITER_H
00002 #define PSANA_STEPITER_H
00003 
00004 //--------------------------------------------------------------------------
00005 // File and Version Information:
00006 //     $Id: StepIter.h 8825 2014-08-28 01:16:10Z davidsch@SLAC.STANFORD.EDU $
00007 //
00008 // Description:
00009 //     Class StepIter.
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/Step.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 steps (calib cycles)
00046  *
00047  *
00048  *  This software was developed for the LCLS project.  If you use all or 
00049  *  part of it, please give an appropriate acknowledgment.
00050  *
00051  *  @version $Id: StepIter.h 8825 2014-08-28 01:16:10Z davidsch@SLAC.STANFORD.EDU $
00052  *
00053  *  @author Andy Salnikov
00054  */
00055 
00056 class StepIter  {
00057 public:
00058 
00059   typedef Step value_type;
00060     
00061   /// Default constructor makes invalid iterator
00062   StepIter () ;
00063 
00064   /**
00065    *  @brief Constructor takes event loop instance and "stop event type".
00066    *
00067    *  Do not use EventLoop::Event for stop type, first it does not make
00068    *  sense, second this iterator uses it for special purpose.
00069    */
00070   StepIter (const boost::shared_ptr<EventLoop>& evtLoop, EventLoop::EventType stopType);
00071 
00072   // Destructor
00073   ~StepIter () ;
00074 
00075   /// get next step, when done returns object which is convertible to "false"
00076   value_type next();
00077 
00078   /// get next step and corresonding event. When done returns object which is convertible to "false"
00079   std::pair<value_type, boost::shared_ptr<PSEvt::Event> > nextWithEvent();
00080 
00081 protected:
00082 
00083 private:
00084 
00085   // Data members
00086   boost::shared_ptr<EventLoop> m_evtLoop;
00087   EventLoop::EventType m_stopType;
00088 
00089 };
00090 
00091 } // namespace psana
00092 
00093 #endif // PSANA_STEPITER_H

Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7