CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/CommonTools/UtilAlgos/interface/FwdPtrConversionFactory.h

Go to the documentation of this file.
00001 #ifndef CommonTools_UtilAlgos_FwdPtrConversionFactory_h
00002 #define CommonTools_UtilAlgos_FwdPtrConversionFactory_h
00003 
00004 
00014 namespace edm {
00018   template<class T>
00019     class ProductFromFwdPtrFactory : public std::unary_function<edm::FwdPtr<T>, T > {
00020   public :
00021     T operator() (edm::FwdPtr<T> const &r)  const  { return T(*r); }
00022   };
00023 
00024 
00025 
00026 
00029   template<class T>
00030     class FwdPtrFromProductFactory : public std::binary_function<edm::View<T>, unsigned int, edm::FwdPtr<T> > {
00031   public :
00032     edm::FwdPtr<T> operator() (edm::View<T> const & view, unsigned int i)  const  { return edm::FwdPtr<T>(view.ptrAt(i),view.ptrAt(i)); }
00033   };
00034 
00035 
00036 
00037 }
00038 
00039 #endif