CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RefToPtr.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_RefToPtr_h
2 #define DataFormats_Common_RefToPtr_h
3 
4 /*----------------------------------------------------------------------
5 
6 Ref: A function template for conversion from Ref to Ptr
7 
8 ----------------------------------------------------------------------*/
9 /*
10  ----------------------------------------------------------------------*/
11 
15 
16 namespace edm {
17  template <typename C>
20  typedef typename C::value_type T;
21  if (ref.isTransient()) {
22  return Ptr<T>(ref.product(), ref.key());
23  } else if (not ref.hasProductCache()) {
24  return Ptr<T>(ref.id(), ref.key(), ref.productGetter());
25  }
26  return Ptr<T>(ref.id(), ref.get(), ref.key());
27  }
28 }
29 #endif
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
Definition: RefToPtr.h:18
Container::value_type value_type
long double T