cspad_mod/include/DataProxyT.h

Go to the documentation of this file.
00001 #ifndef CSPAD_MOD_DATAPROXYT_H
00002 #define CSPAD_MOD_DATAPROXYT_H
00003 
00004 //--------------------------------------------------------------------------
00005 // File and Version Information:
00006 //      $Id: DataProxyT.h 2753 2011-12-14 21:40:37Z salnikov@SLAC.STANFORD.EDU $
00007 //
00008 // Description:
00009 //      Class DataProxyT.
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------
00014 // C/C++ Headers --
00015 //-----------------
00016 
00017 //----------------------
00018 // Base Class Headers --
00019 //----------------------
00020 #include "PSEvt/Proxy.h"
00021 
00022 //-------------------------------
00023 // Collaborating Class Headers --
00024 //-------------------------------
00025 #include "cspad_mod/DataT.h"
00026 #include "cspad_mod/ElementT.h"
00027 #include "psddl_psana/cspad.ddl.h"
00028 #include "PSEnv/EnvObjectStore.h"
00029 #include "PSEvt/EventKey.h"
00030 
00031 //------------------------------------
00032 // Collaborating Class Declarations --
00033 //------------------------------------
00034 
00035 //              ---------------------
00036 //              -- Class Interface --
00037 //              ---------------------
00038 
00039 namespace cspad_mod {
00040 
00041 /// @addtogroup cspad_mod
00042 
00043 /**
00044  *  @ingroup cspad_mod
00045  *
00046  *  @brief Proxy for DataT/ElementT which performs calibration.
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: DataProxyT.h 2753 2011-12-14 21:40:37Z salnikov@SLAC.STANFORD.EDU $
00052  *
00053  *  @author Andy Salnikov
00054  */
00055 
00056 template <typename DataType, typename ElemType>
00057 class DataProxyT : public PSEvt::Proxy<typename DataType::IfaceType> {
00058 public:
00059 
00060   typedef typename DataType::IfaceType DataIfaceType;
00061   typedef typename ElemType::IfaceType ElemIfaceType;
00062 
00063   // Default constructor
00064   DataProxyT (const PSEvt::EventKey& key, PSEnv::EnvObjectStore& calibStore) ;
00065 
00066   // Destructor
00067   virtual ~DataProxyT () ;
00068 
00069   /**
00070    *  @brief Get the correctly-typed object from the proxy.
00071    *
00072    *  @param[in] dict    Proxy dictionary containing this proxy.
00073    *  @param[in] source Detector address information
00074    *  @param[in] key     String key, additional key supplied by user.
00075    *  @return Shared pointer of the correct type.
00076    */
00077   virtual boost::shared_ptr<DataIfaceType>
00078   getTypedImpl(PSEvt::ProxyDictI* dict, const Pds::Src& source, const std::string& key);
00079 
00080 protected:
00081 
00082 private:
00083 
00084   // Data members
00085   PSEvt::EventKey m_key;
00086   PSEnv::EnvObjectStore& m_calibStore;
00087   boost::shared_ptr<DataType> m_data;
00088 
00089 };
00090 
00091 typedef DataProxyT<cspad_mod::DataV1, cspad_mod::ElementV1> DataProxyV1;
00092 typedef DataProxyT<cspad_mod::DataV2, cspad_mod::ElementV2> DataProxyV2;
00093 
00094 } // namespace cspad_mod
00095 
00096 #endif // CSPAD_MOD_DATAPROXYT_H

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7