00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: DataSource.cpp 10732 2015-09-23 22:07:46Z davidsch@SLAC.STANFORD.EDU $ 00004 // 00005 // Description: 00006 // Class DataSource... 00007 // 00008 // Author List: 00009 // Andy Salnikov 00010 // 00011 //------------------------------------------------------------------------ 00012 00013 //----------------------- 00014 // This Class's Header -- 00015 //----------------------- 00016 #include "psana/DataSource.h" 00017 00018 //----------------- 00019 // C/C++ Headers -- 00020 //----------------- 00021 #include <boost/make_shared.hpp> 00022 00023 //------------------------------- 00024 // Collaborating Class Headers -- 00025 //------------------------------- 00026 #include "psana/EventLoop.h" 00027 00028 //----------------------------------------------------------------------- 00029 // Local Macros, Typedefs, Structures, Unions and Forward Declarations -- 00030 //----------------------------------------------------------------------- 00031 00032 // ---------------------------------------- 00033 // -- Public Function Member Definitions -- 00034 // ---------------------------------------- 00035 00036 namespace psana { 00037 00038 //---------------- 00039 // Constructors -- 00040 //---------------- 00041 DataSource::DataSource() 00042 : m_evtLoop() 00043 { 00044 } 00045 00046 DataSource::DataSource (const boost::shared_ptr<InputModule>& inputModule, 00047 const std::vector<boost::shared_ptr<Module> >& modules, 00048 const boost::shared_ptr<PSEnv::Env>& env) 00049 : m_evtLoop(boost::make_shared<EventLoop>(inputModule, modules, env)) 00050 { 00051 } 00052 00053 bool DataSource::liveAvail(int numEvents) { 00054 return m_evtLoop->liveAvail(numEvents); 00055 } 00056 00057 //-------------- 00058 // Destructor -- 00059 //-------------- 00060 DataSource::~DataSource () 00061 { 00062 } 00063 00064 /// Get environment object, cannot be called for "null" source 00065 PSEnv::Env& 00066 DataSource::env() const 00067 { 00068 return m_evtLoop->env(); 00069 } 00070 00071 } // namespace psana