PSEvt/include/ProxyI.h

Go to the documentation of this file.
00001 #ifndef PSEVT_PROXYI_H
00002 #define PSEVT_PROXYI_H
00003 
00004 //--------------------------------------------------------------------------
00005 // File and Version Information:
00006 //      $Id: ProxyI.h 1840 2011-05-07 01:48:35Z salnikov $
00007 //
00008 // Description:
00009 //      Class ProxyI.
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------
00014 // C/C++ Headers --
00015 //-----------------
00016 #include <string>
00017 #include <boost/shared_ptr.hpp>
00018 #include <boost/utility.hpp>
00019 
00020 //----------------------
00021 // Base Class Headers --
00022 //----------------------
00023 
00024 //-------------------------------
00025 // Collaborating Class Headers --
00026 //-------------------------------
00027 #include "pdsdata/xtc/Src.hh"
00028 
00029 //------------------------------------
00030 // Collaborating Class Declarations --
00031 //------------------------------------
00032 namespace PSEvt {
00033   class ProxyDictI;
00034 }
00035 
00036 //              ---------------------
00037 //              -- Class Interface --
00038 //              ---------------------
00039 
00040 namespace PSEvt {
00041 
00042 /**
00043  *  @ingroup PSEvt
00044  *  
00045  *  @brief Class defining interface for all proxy classes.
00046  *  
00047  *  This is the interface used by the proxy dictionary which stores
00048  *  the objects of this type. This interface is untyped, as it returns 
00049  *  pointer to void. It should not be exposed to user code.
00050  *
00051  *  This software was developed for the LCLS project.  If you use all or 
00052  *  part of it, please give an appropriate acknowledgment.
00053  *
00054  *  @see ProxyDictI
00055  *
00056  *  @version \$Id: ProxyI.h 1840 2011-05-07 01:48:35Z salnikov $
00057  *
00058  *  @author Andrei Salnikov
00059  */
00060 
00061 class ProxyI : boost::noncopyable {
00062 public:
00063 
00064   // Destructor
00065   virtual ~ProxyI () {}
00066 
00067   /**
00068    *  @brief Get the object from the proxy.
00069    *  
00070    *  The parameters passed to the proxy can be used by the proxy 
00071    *  to find additional information from the same (or different)
00072    *  detector. 
00073    *  
00074    *  By default the request is forwarded to the virtual method getImp() 
00075    *  (customization point) but there is a possibility to do something 
00076    *  else too if needed.
00077    *  
00078    *  @param[in] dict    Proxy dictionary containing this proxy.
00079    *  @param[in] source Detector address information
00080    *  @param[in] key     String key, additional key supplied by user.
00081    *  @return Shared pointer of void type.
00082    */
00083   boost::shared_ptr<void> get(ProxyDictI* dict,
00084                               const Pds::Src& source, 
00085                               const std::string& key)
00086   {
00087     return this->getImpl(dict, source, key);
00088   }
00089   
00090 protected:
00091 
00092   // Default constructor
00093   ProxyI () {}
00094 
00095   /**
00096    *  @brief Get the object from the proxy.
00097    *  
00098    *  The parameters passed to the proxy can be used by the proxy 
00099    *  to find additional information from the same (or different)
00100    *  detector. 
00101    *  
00102    *  @param[in] dict    Proxy dictionary containing this proxy.
00103    *  @param[in] source Detector address information
00104    *  @param[in] key     String key, additional key supplied by user.
00105    *  @return Shared pointer of void type.
00106    */
00107   virtual boost::shared_ptr<void> getImpl(ProxyDictI* dict,
00108                                           const Pds::Src& source, 
00109                                           const std::string& key) = 0;
00110 
00111 private:
00112 
00113 };
00114 
00115 } // namespace PSEvt
00116 
00117 #endif // PSEVT_PROXYI_H

Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7