LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
WrappedTypeID.h
Go to the documentation of this file.
1 #ifndef canvas_Utilities_WrappedTypeID_h
2 #define canvas_Utilities_WrappedTypeID_h
3 // vim: set sw=2:
4 //
5 // WrappedTypeID: A unique identifier for a C++ type.
6 //
7 // The identifier is unique within an entire program, but cannot be
8 // persisted across invocations of the program.
9 
11 
12 namespace art {
13  template <typename T>
14  class Wrapper;
15 
16  struct WrappedTypeID;
17 }
18 
20  template <typename T>
21  static WrappedTypeID make();
24 
25 private:
26  WrappedTypeID(std::type_info const& product_type,
27  std::type_info const& wrapped_product_type);
28 };
29 
31  std::type_info const& prod_type,
32  std::type_info const& wrapped_prod_type)
33  : product_type{prod_type}, wrapped_product_type{wrapped_prod_type}
34 {}
35 
36 template <typename T>
39 {
40  return WrappedTypeID{typeid(T), typeid(Wrapper<T>)};
41 }
42 
43 // Local Variables:
44 // mode: c++
45 // End:
46 #endif /* canvas_Utilities_WrappedTypeID_h */
static WrappedTypeID make()
TypeID wrapped_product_type
Definition: WrappedTypeID.h:23
HLT enums.
WrappedTypeID(std::type_info const &product_type, std::type_info const &wrapped_product_type)
Definition: WrappedTypeID.h:30