test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
produce_helpers.h
Go to the documentation of this file.
1 #ifndef Framework_produce_helpers_h
2 #define Framework_produce_helpers_h
3 // -*- C++ -*-
4 //
5 // Package: Framework
6 // Class : produce_helpers
7 //
16 //
17 // Author: Chris Jones
18 // Created: Fri Apr 15 10:25:20 EDT 2005
19 //
20 
21 // system include files
22 #include <memory>
23 // user include files
24 #include "boost/shared_ptr.hpp"
25 
26 // forward declarations
27 namespace edm {
28  namespace eventsetup {
29 
30  namespace produce { struct Null;}
31 
32  template<typename FromT, typename ToT> void copyFromTo(FromT& iFrom,
33  ToT & iTo) {
34  iTo = iFrom;
35  }
36 
37  namespace produce {
38  struct Null {};
39  template <typename T> struct EndList {
40  typedef T tail_type;
41  typedef Null head_type;
42  };
43  template <typename T> struct product_traits {
44  typedef T type;
45  };
46  template< typename T> struct product_traits<T*> {
47  typedef EndList<T*> type;
48  };
49  template< typename T> struct product_traits<std::auto_ptr<T> > {
51  };
52  template< typename T> struct product_traits<boost::shared_ptr<T> > {
54  };
55  template< typename T> struct product_traits<std::shared_ptr<T> > {
57  };
58 
59 
60  template<typename T> struct size {
61  typedef typename product_traits<T>::type type;
63  };
64  template<> struct size<Null> {
65  enum { value = 0 };
66  };
67 
68  template<typename T> struct smart_pointer_traits {
69  typedef typename T::element_type type;
70  };
71 
72  template<typename T> struct smart_pointer_traits<T*> {
73  typedef T type;
74  };
75  template<typename T> struct smart_pointer_traits< T const *> {
76  typedef T type;
77  };
78 
79  template<typename FromT, typename ToT> void copyFromTo(FromT& iFrom,
80  ToT & iTo) {
81  iTo = iFrom;
82  }
83 
84 
85 
86  template<typename ContainerT, typename EntryT, typename FindT> struct find_index_impl {
89  };
90  template<typename ContainerT, typename T> struct find_index_impl<ContainerT, T,T> {
91  enum { value = 0 };
92  };
93 
94  template<typename T, typename FindT> struct find_index {
97  };
98  namespace test {
99  template<typename T> const char* name(const T*);
100  }
101 
102  }
103  }
104 }
105 
106 #endif
const char * name(const T *)
void copyFromTo(FromT &iFrom, ToT &iTo)
product_traits< T >::type container_type
string const
Definition: compareJSON.py:14
void copyFromTo(FromT &iFrom, ToT &iTo)
product_traits< T >::type type
long double T
product_traits< ContainerT >::type container_type