CMS 3D CMS Logo

FwdPtrConversionFactory.h
Go to the documentation of this file.
1 #ifndef CommonTools_UtilAlgos_FwdPtrConversionFactory_h
2 #define CommonTools_UtilAlgos_FwdPtrConversionFactory_h
3 
4 
15 
16 #include <functional>
17 
18 namespace edm {
22  template<class T>
23  class ProductFromFwdPtrFactory : public std::unary_function<edm::FwdPtr<T>, T > {
24  public :
25  T operator() (edm::FwdPtr<T> const &r) const { return T(*r); }
26  };
27 
28 
29 
30 
33  template<class T>
34  class FwdPtrFromProductFactory : public std::binary_function<edm::View<T>, unsigned int, edm::FwdPtr<T> > {
35  public :
36  edm::FwdPtr<T> operator() (edm::View<T> const & view, unsigned int i) const { return edm::FwdPtr<T>(view.ptrAt(i),view.ptrAt(i)); }
37  };
38 
39 
40 
41 }
42 
43 #endif
T operator()(edm::FwdPtr< T > const &r) const
HLT enums.
long double T